Supported Functions
This is a list of TeX functions supported by KaTeX. It is sorted into logical groups.
There is a similar Support Table, sorted alphabetically, that lists both supported and un-supported functions.
Accents
a' | \tilde{a} | \mathring{g} |
a'' | \widetilde{ac} | \overgroup{AB} |
a^{\prime} | \utilde{AB} | \undergroup{AB} |
\acute{a} | \vec{F} | \Overrightarrow{AB} |
\bar{y} | \overleftarrow{AB} | \overrightarrow{AB} |
\breve{a} | \underleftarrow{AB} | \underrightarrow{AB} |
\check{a} | \overleftharpoon{ac} | \overrightharpoon{ac} |
\dot{a} | \overleftrightarrow{AB} | \overbrace{AB} |
\ddot{a} | \underleftrightarrow{AB} | \underbrace{AB} |
\grave{a} | \overline{AB} | \overlinesegment{AB} |
\hat{\theta} | \underline{AB} | \underlinesegment{AB} |
\widehat{ac} | \widecheck{ac} |
Accent functions inside \text{…}
\'{a} | \~{a} | \.{a} | \H{a} |
\`{a} | \={a} | \"{a} | \v{a} |
\^{a} | \u{a} | \r{a} |
See also letters
Delimiters
( ) | \lparen \rparen | ⌈ ⌉ | \lceil \rceil | \uparrow |
[ ] | \lbrack \rbrack | ⌊ ⌋ | \lfloor \rfloor | \downarrow |
\{ \} | \lbrace \rbrace | ⎰⎱ | \lmoustache \rmoustache | \updownarrow |
⟨ ⟩ | \langle \rangle | ⟮ ⟯ | \lgroup \rgroup | \Uparrow |
| | \vert | ┌ ┐ | \ulcorner \urcorner | \Downarrow |
\| | \Vert | └ ┘ | \llcorner \lrcorner | \Updownarrow |
\lvert \rvert | \lVert \rVert | \left. | \right. | \backslash |
\lang \rang | \lt \gt | ⟦ ⟧ | \llbracket \rrbracket | \lBrace \rBrace |
Delimiter Sizing
\left(\LARGE{AB}\right)
( \big( \Big( \bigg( \Bigg(
\left | \big | \bigl | \bigm | \bigr |
\middle | \Big | \Bigl | \Bigm | \Bigr |
\right | \bigg | \biggl | \biggm | \biggr |
\Bigg | \Biggl | \Biggm | \Biggr |
Environments
\begin{matrix} a & b \\ c & d \end{matrix} | \begin{array}{cc} a & b \\ c & d \end{array} | ||
\begin{pmatrix} a & b \\ c & d \end{pmatrix} | \begin{bmatrix} a & b \\ c & d \end{bmatrix} | ||
\begin{vmatrix} a & b \\ c & d \end{vmatrix} | \begin{Vmatrix} a & b \\ c & d \end{Vmatrix} | ||
\begin{Bmatrix} a & b \\ c & d \end{Bmatrix} | \def\arraystretch{1.5} \begin{array}{c:c:c} a & b & c \\ \hline d & e & f \\ \hdashline g & h & i \end{array} | ||
x = \begin{cases} a &\text{if } b \\ c &\text{if } d \end{cases} | \begin{rcases} a &\text{if } b \\ c &\text{if } d \end{rcases}⇒… | ||
\begin{smallmatrix} a & b \\ c & d \end{smallmatrix} | \begin{CD} A @>a>> B \\ @VbVV @AAcA \\ C @= D \\end{CD} |
|||||
|:---------------------|:---------------------|
| |\begin{align}
a&=b+c \\
d+e&=f
\end{align}
| |\begin{alignedat}{2}
10&x+ &3&y = 2 \\
3&x+&13&y = 4
\end{alignedat}
|\begin{equation}
\begin{split}
a &=b+c\\
&=e+f
\end{split}
\end{equation}
| |\begin{gather}
a=b \\
e=b+c
\end{gather}
KaTeX also supports:
darray
,dcases
, anddrcases
, which render indisplaystyle
align*
,alignat*
,gather*
, andequation*
, which omit equation numbersaligned
,alignedat
, andgathered
, which LaTeX will render while in math mode
Environments align
, alignat
, CD
, equation
, and gather
(and their starred versions) may be called from display mode. This usually means that they may be called from within $$…$$
delimiters or \[…\]
delimiters. They may not be called from within $…$
or \(…\)
delimiters. In the KaTeX auto-render extension, as in LaTeX, these environments are themselves are a way to change from text mode to math display mode, and \[…\]
delimiters are not necessary.
And KaTeX supports matrix*
, pmatrix*
, bmatrix*
, Bmatrix*
, vmatrix*
, and Vmatrix*
, which take an optional argument to set column alignment, as in \begin{matrix}[1]
, \begin{matrix}[c]
, or \begin{matrix}[r]
.
Acceptable line separators include: \\
, \cr
, \\[distance]
, and \cr[distance]
. Distance can be written with any of the KaTeX units.
The {array}
environment supports |
and :
vertical separators.
The {array}
environment does not yet support \cline
or \multicolumn
.
\tag
can not yet be applied to individual environment rows.
HTML
The following "raw HTML" features are potentially dangerous for untrusted
inputs, so they are disabled by default, and attempting to use them produces
the command names in red (which you can configure via the errorColor
option). To fully trust your LaTeX input, you need to pass
an option of trust: true
; you can also enable just some of the commands
or for just some URLs via the trust
option.
\href{https://katex.org/}{\KaTeX} | |
\url{https://katex.org/} | |
\includegraphics[height=0.8em, totalheight=0.9em, width=0.9em, alt=KA logo]{https://katex.org/img/khan-academy.png} | |
…<span id="bar" class="enclosing">…x…</span>… | \htmlId{bar}{x} |
…<span class="enclosing foo">…x…</span>… | \htmlClass{foo}{x} |
…<span style="color: red;" class="enclosing">…x…</span>… | \htmlStyle{color: red;}{x} |
…<span data-foo="a" data-bar="b" class="enclosing">…x…</span>… | \htmlData{foo=a, bar=b}{x} |
\includegraphics
supports height
, width
, totalheight
, and alt
in its first argument. height
is required.
HTML extension (\html
-prefixed) commands are non-standard, so loosening strict
option for htmlExtension
is required.
Letters and Unicode
Greek Letters
Direct Input:
\Alpha | \Beta | \Gamma | \Delta |
\Epsilon | \Zeta | \Eta | \Theta |
\Iota | \Kappa | \Lambda | \Mu |
\Nu | \Xi | \Omicron | \Pi |
\Rho | \Sigma | \Tau | \Upsilon |
\Phi | \Chi | \Psi | \Omega |
\varGamma | \varDelta | \varTheta | \varLambda |
\varXi | \varPi | \varSigma | \varUpsilon |
\varPhi | \varPsi | \varOmega | |
\alpha | \beta | \gamma | \delta |
\epsilon | \zeta | \eta | \theta |
\iota | \kappa | \lambda | \mu |
\nu | \xi | \omicron | \pi |
\rho | \sigma | \tau | \upsilon |
\phi | \chi | \psi | \omega |
\varepsilon | \varkappa | \vartheta | \thetasym |
\varpi | \varrho | \varsigma | \varphi |
\digamma |
Other Letters
\imath | \nabla | \Im | \Reals | \text{\OE} |
\jmath | \partial | \image | \wp | \text{\o} |
\aleph | \Game | \Bbbk | \weierp | \text{\O} |
\alef | \Finv | \N | \Z | \text{\ss} |
\alefsym | \cnums | \natnums | \text{\aa} | \text{\i} |
\beth | \Complex | \R | \text{\AA} | \text{\j} |
\gimel | \ell | \Re | \text{\ae} | |
\daleth | \hbar | \real | \text{\AE} | |
\eth | \hslash | \reals | \text{\oe} |
Direct Input: ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝÞßàáâãäåçèéêëìíîïðñòóôöùúûüýþÿ
Unicode Mathematical Alphanumeric Symbols
Item | Range | Item | Range |
---|---|---|---|
Bold | Double-struck | ||
Italic | Sans serif | ||
Bold Italic | Sans serif bold | ||
Script | Sans serif italic | ||
Fractur | Monospace |
Unicode
The letters listed above will render properly in any KaTeX rendering mode.
In addition, Armenian, Brahmic, Georgian, Chinese, Japanese, and Korean glyphs are always accepted in text mode. However, these glyphs will be rendered from system fonts (not KaTeX-supplied fonts) so their typography may clash.
You can provide rules for CSS classes .latin-fallback
, .cyrillic-fallback
, .brahmic-fallback
, .georgian-fallback
, .cjk-fallback
, and .hangul-fallback
to provide fallback fonts for these languages.
Use of these glyphs may cause small vertical alignment issues: KaTeX has detailed metrics for listed symbols and most Latin, Greek, and Cyrillic letters, but other accepted glyphs are treated as if they are each as tall as the letter M in the current KaTeX font.
If the KaTeX rendering mode is set to strict: false
or strict: "warn"
(default), then KaTeX will accept all Unicode letters in both text and math mode.
All unrecognized characters will be treated as if they appeared in text mode, and are subject to the same issues of using system fonts and possibly using incorrect vertical alignment.
For Persian composite characters, a user-supplied plug-in is under development.
Any character can be written with the \char
function and the Unicode code in hex. For example \char"263a
will render as .
Layout
Annotation
\cancel{5} | \overbrace{a+b+c}^{\text{note}} |
\bcancel{5} | \underbrace{a+b+c}_{\text{note}} |
\xcancel{ABC} | \not = |
\sout{abc} | \boxed{\pi=\frac c d} |
$a_{\angl n} | a_\angln |
\phase{-78^\circ} |
\tag{hi} x+y^{2x}
\tag*{hi} x+y^{2x}
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 | \stackrel{!}{=} | a \atop b |
e^x | \overset{!}{=} | a\raisebox{0.25em}{$b$}c |
_u^o | \underset{!}{=} | a+\left(\vcenter{\hbox{$\frac{\frac a b}c$}}\right) |
\sum_{\substack{0<i<m\\0<j<n}} |
\raisebox
and \hbox
put their argument into text mode. To raise math, nest $…$
delimiters inside the argument as shown above.
\vcenter
can be written without an \hbox
if the strict
rendering option is false. In that case, omit the nested $…$
delimiters.
Overlap and Spacing
{=}\mathllap{/\,} | \left(x^{\smash{2}}\right) |
\mathrlap{\,/}{=} | \sqrt{\smash[b]{y}} |
\sum_{\mathclap{1\le i\le j\le n}} x_{ij}
KaTeX also supports \llap
, \rlap
, and \clap
, but they will take only text, not math, as arguments.
Spacing
Function | Produces | Function | Produces |
---|---|---|---|
\, | ³∕₁₈ em space | \kern{distance} | space, width = distance |
\thinspace | ³∕₁₈ em space | \mkern{distance} | space, width = distance |
\> | ⁴∕₁₈ em space | \mskip{distance} | space, width = distance |
\: | ⁴∕₁₈ em space | \hskip{distance} | space, width = distance |
\medspace | ⁴∕₁₈ em space | \hspace{distance} | space, width = distance |
\; | ⁵∕₁₈ em space | \hspace*{distance} | space, width = distance |
\thickspace | ⁵∕₁₈ em space | \phantom{content} | space the width and height of content |
\enspace | ½ em space | \hphantom{content} | space the width of content |
\quad | 1 em space | \vphantom{content} | a strut the height of content |
\qquad | 2 em space | \! | – ³∕₁₈ em space |
~ | non-breaking space | \negthinspace | – ³∕₁₈ em space |
\<space> | space | \negmedspace | – ⁴∕₁₈ em space |
\nobreakspace | non-breaking space | \negthickspace | – ⁵∕₁₈ em space |
\space | space | \mathstrut | \vphantom{(} |
Notes:
distance
will accept any of the KaTeX units.
\kern
, \mkern
, \mskip
, and \hspace
accept unbraced distances, as in: \kern1em
.
\mkern
and \mskip
will not work in text mode and both will write a console warning for any unit except mu
.
Logic and Set Theory
\forall | \complement | \therefore | \emptyset |
\exists | \subset | \because | \empty |
\exist | \supset | \mapsto | \varnothing |
\nexists | \mid | \to | \implies |
\in | \land | \gets | \impliedby |
\isin | \lor | \leftrightarrow | \iff |
\notin | \ni | \notni | \neg or \lnot |
Direct Input: ℂ ℍ ℕ ℙ ℚ ℝ
Macros
\def\foo{x^2} \foo + \foo | |
\gdef\bar#1{#1^2} \bar{y} + \bar{y} | |
\edef\macroname#1#2…{definition to be expanded} | |
\xdef\macroname#1#2…{definition to be expanded} | |
\let\foo=\bar | |
\futurelet\foo\bar x | |
\global\def\macroname#1#2…{definition} | |
\newcommand\macroname[numargs]{definition} | |
\renewcommand\macroname[numargs]{definition} | |
\providecommand\macroname[numargs]{definition} |
Macros can also be defined in the KaTeX rendering options.
Macros accept up to nine arguments: #1, #2, etc.
\gdef
, \xdef
, \global\def
, \global\edef
, \global\let
, and \global\futurelet
will persist between math expressions.
KaTeX has no \par
, so all macros are long by default and \long
will be ignored.
Available functions include:
\char
\mathchoice
\TextOrMath
\@ifstar
\@ifnextchar
\@firstoftwo
\@secondoftwo
\relax
\expandafter
\noexpand
@ is a valid character for commands, as if \makeatletter
were in effect.
Operators
Big Operators
\sum | \prod | \bigotimes | \bigvee |
\int | \coprod | \bigoplus | \bigwedge |
\iint | \intop | \bigodot | \bigcap |
\iiint | \smallint | \biguplus | \bigcup |
\oint | \oiint | \oiiint | \bigsqcup |
Direct Input: ∯ ∰
Binary Operators
+ | \cdot | \gtrdot | x \pmod a |
- | \cdotp | \intercal | x \pod a |
/ | \centerdot | \land | \rhd |
* | \circ | \leftthreetimes | \rightthreetimes |
\amalg | \circledast | \ldotp | \rtimes |
\And | \circledcirc | \lor | \setminus |
\ast | \circleddash | \lessdot | \smallsetminus |
\barwedge | \Cup | \lhd | \sqcap |
\bigcirc | \cup | \ltimes | \sqcup |
\bmod | \curlyvee | x\mod a | \times |
\boxdot | \curlywedge | \mp | \unlhd |
\boxminus | \div | \odot | \unrhd |
\boxplus | \divideontimes | \ominus | \uplus |
\boxtimes | \dotplus | \oplus | \vee |
\bullet | \doublebarwedge | \otimes | \veebar |
\Cap | \doublecap | \oslash | \wedge |
\cap | \doublecup | \pm or \plusmn | \wr |
Direct Input:
Fractions and Binomials
\frac{a}{b} | \tfrac{a}{b} | \genfrac ( ] {2pt}{1}a{a+1} |
{a \over b} | \dfrac{a}{b} | {a \above{2pt} b+1} |
a/b | \cfrac{a}{1 + \cfrac{1}{b}} |
\binom{n}{k} | \dbinom{n}{k} | {n\brace k} |
{n \choose k} | \tbinom{n}{k} | {n\brack k} |
Math Operators
\arcsin | \cosec | \deg | \sec |
\arccos | \cosh | \dim | \sin |
\arctan | \cot | \exp | \sinh |
\arctg | \cotg | \hom | \sh |
\arcctg | \coth | \ker | \tan |
\arg | \csc | \lg | \tanh |
\ch | \ctg | \ln | \tg |
\cos | \cth | \log | \th |
\operatorname{f} | |||
\argmax | \injlim | \min | \varinjlim |
\argmin | \lim | \plim | \varliminf |
\det | \liminf | \Pr | \varlimsup |
\gcd | \limsup | \projlim | \varprojlim |
\inf | \max | \sup | \operatorname*{f} |
Functions in the bottom five rows of this table can take \limits
.
\sqrt
\sqrt{x}
\sqrt[3]{x}
Relations
\stackrel{!}{=}
= | \doteqdot | \lessapprox | \smile |
< | \eqcirc | \lesseqgtr | \sqsubset |
> | \eqcolon or\minuscolon | \lesseqqgtr | \sqsubseteq |
: | \Eqcolon or\minuscoloncolon | \lessgtr | \sqsupset |
\approx | \eqqcolon or\equalscolon | \lesssim | \sqsupseteq |
\approxcolon | \Eqqcolon or\equalscoloncolon | \ll | \Subset |
\approxcoloncolon | \eqsim | \lll | \subset or \sub |
\approxeq | \eqslantgtr | \llless | \subseteq or \sube |
\asymp | \eqslantless | \lt | \subseteqq |
\backepsilon | \equiv | \mid | \succ |
\backsim | \fallingdotseq | \models | \succapprox |
\backsimeq | \frown | \multimap | \succcurlyeq |
\between | \ge | \origof | \succeq |
\bowtie | \geq | \owns | \succsim |
\bumpeq | \geqq | \parallel | \Supset |
\Bumpeq | \geqslant | \perp | \supset |
\circeq | \gg | \pitchfork | \supseteq or \supe |
\colonapprox | \ggg | \prec | \supseteqq |
\Colonapprox or\coloncolonapprox | \gggtr | \precapprox | \thickapprox |
\coloneq or\colonminus | \gt | \preccurlyeq | \thicksim |
\Coloneq or\coloncolonminus | \gtrapprox | \preceq | \trianglelefteq |
\coloneqq or\colonequals | \gtreqless | \precsim | \triangleq |
\Coloneqq or\coloncolonequals | \gtreqqless | \propto | \trianglerighteq |
\colonsim | \gtrless | \risingdotseq | \varpropto |
\Colonsim or\coloncolonsim | \gtrsim | \shortmid | \vartriangle |
\cong | \imageof | \shortparallel | \vartriangleleft |
\curlyeqprec | \in or \isin | \sim | \vartriangleright |
\curlyeqsucc | \Join | \simcolon | \vcentcolon or\ratio |
\dashv | \le | \simcoloncolon | \vdash |
\dblcolon or\coloncolon | \leq | \simeq | \vDash |
\doteq | \leqq | \smallfrown | \Vdash |
\Doteq | \leqslant | \smallsmile | \Vvdash |
Direct Input: ≔ ≕ ⩴
Negated Relations
\not =
\gnapprox | \ngeqslant | \nsubseteq | \precneqq |
\gneq | \ngtr | \nsubseteqq | \precnsim |
\gneqq | \nleq | \nsucc | \subsetneq |
\gnsim | \nleqq | \nsucceq | \subsetneqq |
\gvertneqq | \nleqslant | \nsupseteq | \succnapprox |
\lnapprox | \nless | \nsupseteqq | \succneqq |
\lneq | \nmid | \ntriangleleft | \succnsim |
\lneqq | \notin | \ntrianglelefteq | \supsetneq |
\lnsim | \notni | \ntriangleright | \supsetneqq |
\lvertneqq | \nparallel | \ntrianglerighteq | \varsubsetneq |
\ncong | \nprec | \nvdash | \varsubsetneqq |
\ne | \npreceq | \nvDash | \varsupsetneq |
\neq | \nshortmid | \nVDash | \varsupsetneqq |
\ngeq | \nshortparallel | \nVdash | |
\ngeqq | \nsim | \precnapprox |
Direct Input:
Arrows
\circlearrowleft | \leftharpoonup | \rArr |
\circlearrowright | \leftleftarrows | \rarr |
\curvearrowleft | \leftrightarrow | \restriction |
\curvearrowright | \Leftrightarrow | \rightarrow |
\Darr | \leftrightarrows | \Rightarrow |
\dArr | \leftrightharpoons | \rightarrowtail |
\darr | \leftrightsquigarrow | \rightharpoondown |
\dashleftarrow | \Lleftarrow | \rightharpoonup |
\dashrightarrow | \longleftarrow | \rightleftarrows |
\downarrow | \Longleftarrow | \rightleftharpoons |
\Downarrow | \longleftrightarrow | \rightrightarrows |
\downdownarrows | \Longleftrightarrow | \rightsquigarrow |
\downharpoonleft | \longmapsto | \Rrightarrow |
\downharpoonright | \longrightarrow | \Rsh |
\gets | \Longrightarrow | \searrow |
\Harr | \looparrowleft | \swarrow |
\hArr | \looparrowright | \to |
\harr | \Lrarr | \twoheadleftarrow |
\hookleftarrow | \lrArr | \twoheadrightarrow |
\hookrightarrow | \lrarr | \Uarr |
\iff | \Lsh | \uArr |
\impliedby | \mapsto | \uarr |
\implies | \nearrow | \uparrow |
\Larr | \nleftarrow | \Uparrow |
\lArr | \nLeftarrow | \updownarrow |
\larr | \nleftrightarrow | \Updownarrow |
\leadsto | \nLeftrightarrow | \upharpoonleft |
\leftarrow | \nrightarrow | \upharpoonright |
\Leftarrow | \nRightarrow | \upuparrows |
\leftarrowtail | \nwarrow | |
\leftharpoondown | \Rarr |
Direct Input: ↽
Extensible Arrows
\xleftarrow{abc} | \xrightarrow[under]{over} |
\xLeftarrow{abc} | \xRightarrow{abc} |
\xleftrightarrow{abc} | \xLeftrightarrow{abc} |
\xhookleftarrow{abc} | \xhookrightarrow{abc} |
\xtwoheadleftarrow{abc} | \xtwoheadrightarrow{abc} |
\xleftharpoonup{abc} | \xrightharpoonup{abc} |
\xleftharpoondown{abc} | \xrightharpoondown{abc} |
\xleftrightharpoons{abc} | \xrightleftharpoons{abc} |
\xtofrom{abc} | \xmapsto{abc} |
\xlongequal{abc} |
Extensible arrows all can take an optional argument in the same manner
as \xrightarrow[under]{over}
.
Special Notation
Bra-ket Notation
\bra{\phi} | \ket{\psi} | \braket{\phi\vert\psi} |
\Bra{\phi} | \Ket{\psi} |
Style, Color, Size, and Font
Class Assignment
\mathbin
\mathclose
\mathinner
\mathop
\mathopen
\mathord
\mathpunct
\mathrel
Color
\color{blue} F=ma
Note that \color
acts like a switch. Other color functions expect the content to be a function argument:
\textcolor{blue}{F=ma}
\textcolor{#228B22}{F=ma}
\colorbox{aqua}{$F=ma$}
\fcolorbox{red}{aqua}{$F=ma$}
Note that, as in LaTeX, \colorbox
& \fcolorbox
renders its third argument as text, so you may want to switch back to math mode with $
as in the examples above.
For color definition, KaTeX color functions will accept the standard HTML predefined color names. They will also accept an RGB argument in CSS hexadecimal style. The "#" is optional before a six-digit specification.
Font
\mathrm{Ab0} | \mathbf{Ab0} | \mathit{Ab0} |
\mathnormal{Ab0} | \textbf{Ab0} | \textit{Ab0} |
\textrm{Ab0} | \bf Ab0 | \it Ab0 |
\rm Ab0 | \bold{Ab0} | \textup{Ab0} |
\textnormal{Ab0} | \boldsymbol{Ab} | \Bbb{AB} |
\text{Ab0} | \bm{Ab0} | \mathbb{AB} |
\mathsf{Ab0} | \textmd{Ab0} | \frak{Ab0} |
\textsf{Ab0} | \mathtt{Ab0} | \mathfrak{Ab0} |
\sf Ab0 | \texttt{Ab0} | \mathcal{AB0} |
\tt Ab0 | \cal AB0 | |
\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 . The other versions do not stack, e.g., \mathsf{\mathbf{H}}
will produce .
In cases where KaTeX fonts do not have a bold glyph, \pmb
can simulate one. For example, \pmb{\mu}
renders as :
Size
\Huge AB | \normalsize AB |
\huge AB | \small AB |
\LARGE AB | \footnotesize AB |
\Large AB | \scriptsize AB |
\large AB | \tiny AB |
Style
\displaystyle\sum_{i=1}^n |
\textstyle\sum_{i=1}^n |
\scriptstyle x (The size of a first sub/superscript) |
\scriptscriptstyle x (The size of subsequent sub/superscripts) |
\lim\limits_x |
\lim\nolimits_x |
\verb!x^2! |
\text{…}
will accept nested $…$
fragments and render them in math mode.
Symbols and Punctuation
% comment | \dots | \KaTeX |
\% | \cdots | \LaTeX |
\# | \ddots | \TeX |
\& | \ldots | \nabla |
\_ | \vdots | \infty |
\text{\textunderscore} | \dotsb | \infin |
\text{--} | \dotsc | \checkmark |
\text{\textendash} | \dotsi | \dag |
\text{---} | \dotsm | \dagger |
\text{\textemdash} | \dotso | \text{\textdagger} |
\text{\textasciitilde} | \sdot | \ddag |
\text{\textasciicircum} | \mathellipsis | \ddagger |
` | \text{\textellipsis} | \text{\textdaggerdbl} |
text{\textquoteleft} | \Box | \Dagger |
\lq | \square | \angle |
\text{\textquoteright} | \blacksquare | \measuredangle |
\rq | \triangle | \sphericalangle |
\text{\textquotedblleft} | \triangledown | \top |
" | \triangleleft | \bot |
\text{\textquotedblright} | \triangleright | \$ |
\colon | \bigtriangledown | \text{\textdollar} |
\backprime | \bigtriangleup | \pounds |
\prime | \blacktriangle | \mathsterling |
\text{\textless} | \blacktriangledown | \text{\textsterling} |
\text{\textgreater} | \blacktriangleleft | \yen |
\text{\textbar} | \blacktriangleright | \surd |
\text{\textbardbl} | \diamond | \degree |
\text{\textbraceleft} | \Diamond | \text{\textdegree} |
\text{\textbraceright} | \lozenge | \mho |
\text{\textbackslash} | \blacklozenge | \diagdown |
\text{\P} | \star | \diagup |
\text{\S} | \bigstar | \flat |
\text{\sect} | \clubsuit | \natural |
\copyright | \clubs | \sharp |
\circledR | \diamondsuit | \heartsuit |
\text{\textregistered} | \diamonds | \hearts |
\circledS | \spadesuit | \spades |
\text{\textcircled a} | \maltese | \minuso |
Direct Input: ‼ ⦵
Units
In KaTeX, units are proportioned as they are in TeX.
KaTeX units are different than CSS units.
KaTeX Unit | Value | KaTeX Unit | Value |
---|---|---|---|
em | CSS em | bp | 1/72 inch × F × G |
ex | CSS ex | pc | 12 KaTeX pt |
mu | 1/18 CSS em | dd | 1238/1157 KaTeX pt |
pt | 1/72.27 inch × F × G | cc | 14856/1157 KaTeX pt |
mm | 1 mm × F × G | nd | 685/642 KaTeX pt |
cm | 1 cm × F × G | nc | 1370/107 KaTeX pt |
in | 1 inch × F × G | sp | 1/65536 KaTeX pt |
where:
F = (font size of surrounding HTML text)/(10 pt)
G = 1.21 by default, because KaTeX font-size is normally 1.21 × the surrounding font size. This value can be overridden by the CSS of an HTML page.
The effect of style and size:
Unit | textstyle | scriptscript | huge |
---|---|---|---|
em or ex | |||
mu | |||
others |