If the KaTeX rendering mode is set to strict: false or strict:"warn" (default), then KaTeX will accept all Unicode letters. The letters not listed above will be rendered from system fonts, not KaTeX-supplied fonts, so their typography may clash. They may also cause small vertical alignment issues. KaTeX has detailed metrics for glyphs in Latin, Greek, and Cyrillic, but other glyphs are treated as if they are each as tall as the letter M.

For Persian composite characters, a user-supplied plug-in is under development.

Line Breaks

KaTeX 0.10.0+ will insert automatic line breaks in inline math after relations or binary operators such as “=” or “+”. These can be suppressed by \nobreak or by placing math inside a pair of braces, as in {F=ma}. \allowbreak will allow automatic line breaks at locations other than relations or operators.

Hard line breaks are \\ and \newline.

In display math, KaTeX does not insert automatic line breaks. It ignores display math hard line breaks when rendering option strict: true.

Vertical Layout

x
n
x_n
xn​x_n

=
!
\stackrel{!}{=}
=!\stackrel{!}{=}

a
b
a \atop b
ba​a \atop b

e
x
e^x
exe^x

=
!
\overset{!}{=}
=!\overset{!}{=}

a
b
c
a\raisebox{0.25em}{b}c
abca\raisebox{0.25em}{b}c

u
o
_u^o
uo​_u^o

=
!
\underset{!}{=}
!=​\underset{!}{=}

The second argument of \raisebox can contain math if it is nested within $…$ delimiters, as in \raisebox{0.25em}{$\frac a b$}

For color definition, KaTeX color functions will accept the standard HTML predefined color names. They will also accept an RGB argument in CSS hexa­decimal style.

Font

A
b
0
\mathrm{Ab0}
Ab0\mathrm{Ab0}

A
b
0
\mathbf{Ab0}
Ab0\mathbf{Ab0}

A
b
\mathit{Ab}
Ab\mathit{Ab}

Ab0
\textrm{Ab0}
Ab0\textrm{Ab0}

Ab0
\textbf{Ab0}
Ab0\textbf{Ab0}

Ab
\textit{Ab}
Ab\textit{Ab}

A
b
0
\rm Ab0
Ab0\rm Ab0

A
b
0
\bf Ab0
Ab0\bf Ab0

A
b
\it Ab
Ab\it Ab

Ab0
\textnormal{Ab0}
Ab0\textnormal{Ab0}

A
b
0
\bold{Ab0}
Ab0\bold{Ab0}

A
B
\Bbb{AB}
AB\Bbb{AB}

Ab0
\text{Ab0}
Ab0\text{Ab0}

A
b
\boldsymbol{Ab}
Ab\boldsymbol{Ab}

A
B
\mathbb{AB}
AB\mathbb{AB}

A
b
0
\mathsf{Ab0}
Ab0\mathsf{Ab0}

A
b
\bm{Ab}
Ab\bm{Ab}

A
b
0
\frak{Ab0}
Ab0\frak{Ab0}

Ab0
\textsf{Ab0}
Ab0\textsf{Ab0}

A
b
0
\mathtt{Ab0}
Ab0\mathtt{Ab0}

A
b
0
\mathfrak{Ab0}
Ab0\mathfrak{Ab0}

A
b
0
\sf Ab0
Ab0\sf Ab0

Ab0
\texttt{Ab0}
Ab0\texttt{Ab0}

A
B
0
\mathcal{AB0}
AB0\mathcal{AB0}

A
b
0
\tt Ab0
Ab0\tt Ab0

A
B
\mathscr{AB}
AB\mathscr{AB}

One can stack font family, font weight, and font shape by using the \textXX versions of the font functions. So \textsf{\textbf{H}} will produce
H
\textsf{\textbf{H}}
H. The other versions do not stack, e.g., \mathsf{\mathbf{H}} will produce
H
\mathsf{\mathbf{H}}
H.

In cases where KaTeX fonts do not have a bold glyph, \pmb can simulate one. For example, \pmb{\mu} renders as :
μ
\pmb{\mu}
μ​μ​​μ

Size

A
B
\Huge AB
AB\Huge AB

A
B
\normalsize AB
AB\normalsize AB

A
B
\huge AB
AB\huge AB

A
B
\small AB
AB\small AB

A
B
\LARGE AB
AB\LARGE AB

A
B
\footnotesize AB
AB\footnotesize AB

A
B
\Large AB
AB\Large AB

A
B
\scriptsize AB
AB\scriptsize AB

A
B
\large AB
AB\large AB

A
B
\tiny AB
AB\tiny AB

Style

∑
i
=
1
n
\displaystyle\sum_{i=1}^n
i=1∑n​\displaystyle\sum_{i=1}^n

∑
i
=
1
n
\textstyle\sum_{i=1}^n
∑i=1n​\textstyle\sum_{i=1}^n

x
\scriptstyle x
x\scriptstyle x (The size of a first sub/superscript)