数式の組み方

文中の数式 \(E = mc^2\) や \(\sum_{i=1}^{n} x_i\) の前後で、和文との間の空きが不自然に広がらないかを見る。数式の中には、和欧間の自動の空きや約物の詰めを入れない。添字のある \(\alpha_{t+1} = \alpha_t - \eta \nabla L(\alpha_t)\) のような式が行の途中に来ても、行間が乱れないかも見る1。

別行立ての数式は、本文の幅に収まらないとき、頁全体を広げずに数式だけが横に流れる。

$$ \mathcal{L}(\theta) = -\sum_{t=1}^{T} \log p_\theta\bigl(x_t \mid x_{\lt t}\bigr) + \lambda \lVert \theta \rVert_2^2 + \frac{\beta}{2} \sum_{k=1}^{K} \Bigl( \mathbb{E}_{q(z_k)}\bigl[\log q(z_k) - \log p(z_k)\bigr] \Bigr)^2 + \gamma \int_{0}^{1} \lVert \nabla_x f_\theta(x) \rVert \, dx $$

短い別行立ての式は中央に置かれる。

$$ \frac{a}{b} = \sqrt{\frac{c^2 + d^2}{e}} $$
記号式値
学習率\(\eta = 10^{-3}\)0.001
正則化\(\lambda \lVert \theta \rVert^2\)—

注

  1. 注の中の数式 \(\int_0^\infty e^{-x}\,dx = 1\)。 ↩

Math in English text

Inline math such as \(f(x) = \frac{1}{1 + e^{-x}}\) should sit on the line without changing the line height much, and hyphenation should not touch it.

$$ p(y \mid x) = \frac{\exp\bigl(s_\theta(x, y)\bigr)}{\sum_{y' \in \mathcal{Y}} \exp\bigl(s_\theta(x, y')\bigr)} $$

الرياضيات في نص عربي

معادلة داخل السطر \(a^2 + b^2 = c^2\) ومعادلة منفصلة:

$$ \sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6} $$