JekTex の特徴は何と言っても、数式をサーバーサイドでレンダリングするという点です。このため、ブラウザに JavaScript を読み込む必要がなく、表示速度と FOUC の点で他を圧倒しています。このページでは、Web フォントも rel="preload" しています。

×B1cEtamp;=4πcjEamp;=4πρ\begin{align} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \end{align}

ディスプレイ数式(数式だけの行)

段落を分けるために前後を空行で囲むのが基本ルールです(例外あり)。

$$...$$

 
$$
\lim_{n\rightarrow\infty} \frac{1}{n} = 0
$$
 
limn1n=0\lim_{n\rightarrow\infty} \frac{1}{n} = 0

\textstyle を追加すると、テキストスタイルになります。

 
$$ \textstyle
\lim_{n\rightarrow\infty} \frac{1}{n} = 0
$$
 
limn1n=0\textstyle \lim_{n\rightarrow\infty} \frac{1}{n} = 0

\[...\]

前後に空行は必要ありませんが、二重の \\\ をエスケープする必要があります。1

テキスト
\\[
\int (x+1)dx=\frac{1}{2}x^2+x+C
\\]
テキスト

テキスト (x+1)dx=12x2+x+C \int (x+1)dx=\frac{1}{2}x^2+x+C テキスト

\textstyle を追加すると、テキストスタイルになります。

テキスト
\\[ \textstyle
\int (x+1)dx=\frac{1}{2}x^2+x+C
\\]
テキスト

テキスト (x+1)dx=12x2+x+C \textstyle \int (x+1)dx=\frac{1}{2}x^2+x+C テキスト

\begin{}...\end{}

MathJax と異なり、空行と $$...$$ で囲む必要があります。

 
$$
\begin{align}
\int \log x dx & = \int (x)\log x dx \\
& = x \log x - \int x (\log x)’ dx \\
& = x \log x - x + C.
\end{align}
$$
 
logxdx=(x)logxdx=xlogxx(logx)dx=xlogxx+C.\begin{align} \int \log x dx & = \int (x)’ \log x dx \\ & = x \log x - \int x (\log x)’ dx \\ & = x \log x - x + C. \end{align}

split は方程式が1行に収まらないので、\textstyle は効きません。

 
$$
\begin{equation} \textstyle
  \begin{split}
    a &= \int_0^\infty f(x) \sin x \cos x \, dx \\
      &\quad + \int_0^\infty f(-x) \sin x \log x \, dx 
  \end{split}
\end{equation}
$$
 
a=0f(x)sinxcosxdx+0f(x)sinxlogxdx\begin{equation} \textstyle \begin{split} a &= \int_0^\infty f(x) \sin x \cos x \, dx \\ &\quad + \int_0^\infty f(-x) \sin x \log x \, dx \end{split} \end{equation}

1行に収まる方程式であれば \textstyle が効きます。MathJax や KaTeX と異なり、ディスプレイ数式(数式だけの行)とするために、空行と $$...$$ が必要です。

 
$$
\begin{aligned} \textstyle
\lim_{h \to 0} \frac{\sqrt{a+h}-\sqrt{a}}{h}
\end{equation}
$$
 
limh0a+hah\begin{aligned} \textstyle \lim_{h \to 0} \frac{\sqrt{a+h}-\sqrt{a}}{h} \end{aligned}

インライン数式(文章中の数式)

前後を空行で囲まず、1つの段落中に数式を記述します。

$...$

デフォルトでは $...$ は使えないので、$$...$$ で囲みます。

テキスト
$$
\lim_{h \to 0} \frac{\sqrt{a+h}-\sqrt{a}}{h}
$$
テキスト

テキスト limh0a+hah\lim_{h \to 0} \frac{\sqrt{a+h}-\sqrt{a}}{h} テキスト

\(...\)

二重の \\\ をエスケープする必要があります。1

テキスト
\\(
\lim_{h \to 0} \frac{\sqrt{a+h}-\sqrt{a}}{h}
\\)
テキスト

テキスト limh0a+hah \lim_{h \to 0} \frac{\sqrt{a+h}-\sqrt{a}}{h} テキスト

\begin{}...\end{}

MathJax と異なり、alignequationsplit はディスプレイ数式(数式だけの行)でしか使えません。インライン数式(文章中の数式)なら alignedgathered を使います。

テキスト
$$
\begin{gathered}
  a &= \int_0^\infty f(x) \sin x \cos x \, dx \\
    &\quad + \int_0^\infty f(-x) \sin x \log x \, dx 
\end{gathered}
$$
テキスト テキスト テキスト テキスト テキスト テキスト テキスト テキスト テキスト テキスト テキスト テキスト

テキスト a=0f(x)sinxcosxdx+0f(x)sinxlogxdx\begin{gathered} a &= \int_0^\infty f(x) \sin x \cos x \, dx \\ &\quad + \int_0^\infty f(-x) \sin x \log x \, dx \end{gathered} テキスト テキスト テキスト テキスト テキスト テキスト テキスト テキスト テキスト テキスト テキスト テキスト

様々な数式

$$
\sin x = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!} x^{2n+1}
$$
sinx=n=0(1)n(2n+1)!x2n+1\sin x = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!} x^{2n+1}

Cauchy の積分公式

$$
\frac{1}{2 \pi i}\oint_{C}\frac{f(z)}{z-\zeta} dz = f(\zeta)
$$
12πiCf(z)zζdz=f(ζ)\frac{1}{2 \pi i}\oint_{C}\frac{f(z)}{z-\zeta} dz = f(\zeta)

テキスト

$$
f(n) = \begin{cases} n/2,  & \text{if }n\text{ is even} \\3n+1, & \text{if }n\text{ is odd} \end{cases}
$$
f(n)={n/2,if n is even3n+1,if n is oddf(n) = \begin{cases} n/2, & \text{if }n\text{ is even} \\3n+1, & \text{if }n\text{ is odd} \end{cases}

ボックスで囲まれた式

$$
\boxed{S_n=\displaystyle\sum_{k=1}^{n} (x_k)^2}
$$
Sn=k=1n(xk)2\boxed{S_n=\displaystyle\sum_{k=1}^{n} (x_k)^2}