Home

Published

- 2 min read

LaTeX support


We can write math and physic equation using LaTeXLaTeX and KaTeXKaTeX

Inline style

Wrap with single dollar sign to create equation inline

   My function: $f(x) = e^{x^2}$

My function: f(x)=ex2f(x) = e^{x^2}

Block style

You can make equation block like this using double dollar sign

   This is the derivation rule of exponent

$$
\begin{align*}
f(x) &= x^2 \\
\frac{d}{dx} f(x) &= 2x
\end{align*}
$$

This is the derivation rule of power

f(x)=x2ddxf(x)=2x\begin{align*} f(x) &= x^2 \\ \frac{d}{dx} f(x) &= 2x \end{align*}

FAQ and Tips

LaTeX\LaTeX in the header

You can also use math mode inside the header component like this:

   ## $\LaTeX$ in the header

Subscript and Superscript

Use _ for subscript and ^ for superscript. Order don’t matter. Multicharacter can be grouped using {}

   $$
\sum_{i=0}^N i
$$
i=0Ni\sum_{i=0}^N i

Greek Letter

Prefix the latin name of the greek letter with \ to render as greek letter

   $$
\alpha \beta \gamma
$$
αβγ\alpha \beta \gamma

Character Spacing

LaTeXLaTeX assume single letter as a symbol. Other than that, we need to use special character

Regular Spacing

   Regular spacing

$$
\begin{align}
abc=def \\
a    b    c = d    e    f \\
\end{align}
$$

Regular spacing

abc=defabc=def\begin{align} abc=def \\ a b c = d e f \\ \end{align}

Extra Spacing

   Extra spacing

$$
\begin{align}
a\,b\,c = d\,e\,f \\
a   \,   b   \,   c = d   \,   e   \,f
\end{align}
$$

Extra spacing

abc=defabc=def\begin{align} a\,b\,c = d\,e\,f \\ a \, b \, c = d \, e \,f \end{align}

Grouping Several Characters

   Making operator name

$$
\begin{align}
\operatorname{sinc}(t) = \frac{\sin(t)}{t}
\end{align}
$$

Making operator name

sinc(t)=sin(πt)t\begin{align} \operatorname{sinc}(t) = \frac{\sin(\pi t)}{t} \end{align}

Related Posts

There are no related posts yet. 😢