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.
Accent functions inside \text{…}
aˊaˊ \'{a}a˜a˜ \~{a}a˙a˙ \.{a}a˝a˝ \H{a}aˋaˋ \`{a}aˉaˉ \={a}a¨a¨ \"{a}aˇaˇ \v{a}aˆaˆ \^{a}a˘a˘ \u{a}a˚a˚ \r{a}See also letters and unicode.
Delimiters( )( ) ( )( )( ) \lparenDelimiter Sizing
(��)(AB) \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\BiggrThe auto-render extension will render the following environments even if they are not inside math delimiters such as $$…$$. They are display-mode only.
�=�+�=�+�a=b+c=e+f\begin{equation}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 be applied to individual rows of top-level environments (align, align*, alignat, alignat*, gather, gather*).
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.
KaTeXKATEX\href{https://katex.org/}{\KaTeX}https://katex.org/https://katex.org/\url{https://katex.org/}\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 UnicodeGreek Letters
Direct Input: ABΓΔEZHΘIKΛMNΞOΠPΣTΥΦXΨΩABΓΔEZHΘIKΛMNΞOΠPΣTΥΦXΨΩ ������������������������������ϝαβγδϵζηθικλμνξoπρστυϕχψωεϑϖϱςφϝ
AA \AlphaBB \BetaΓΓ \GammaΔΔ \DeltaEE \EpsilonZZ \ZetaHH \EtaΘΘ \ThetaII \IotaKK \KappaΛΛ \LambdaMM \MuNN \NuΞΞ \XiOO \OmicronΠΠ \PiPP \RhoΣΣ \SigmaTT \TauΥΥ \UpsilonΦΦ \PhiXX \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ϝϝ \digammaOther Letters
ı \imath∇∇ \nablaℑℑ \Im�R \RealsŒŒ \text{\OE}ȷ \jmath∂∂ \partialℑℑ \image℘℘ \wpøø \text{\o}ℵℵ \aleph⅁⅁ \Game�k \Bbbk℘℘ \weierpØØ \text{\O}ℵℵ \alefℲℲ \Finv�N \N�Z \Zßß \text{\ss}ℵℵ \alefsym�C \cnums�N \natnumsa˚a˚ \text{\aa}ıı \text{\i}ℶℶ \beth�C \Complex�R \RA˚A˚ \text{\AA}ȷȷ \text{\j}ℷℷ \gimelℓℓ \ellℜℜ \Reææ \text{\ae}ℸℸ \dalethℏℏ \hbarℜℜ \realÆÆ \text{\AE}ðð \ethℏℏ \hslash�R \realsœœ \text{\oe}Direct Input: ∂∇ℑℲℵℶℷℸ⅁ℏð−∗∂∇ℑℲℵℶℷℸ⅁ℏð−∗ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝÞßàáâãäåçèéêëìíîïðñòóôöùúûüýþÿ ₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ⁺⁻⁼⁽⁾⁰¹²³⁴⁵⁶⁷⁸⁹ᵃᵇᶜᵈᵉᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘʷˣʸᶻᵛᵝᵞᵟᵠᵡ
Math-mode Unicode (sub|super)script characters will render as if you had written regular characters in a subscript or superscript. For instance, A²⁺³ will render the same as A^{2+3}.
Unicode Mathematical Alphanumeric Symbols
ItemRangeItemRangeBold𝐀-𝐙 𝐚-𝐳 𝟎-𝟗A-Z a-z 0-9Double-struck𝔸-Z 𝕜A-Z kItalic𝐴-𝑍 𝑎-𝑧A-Z a-zSans serif𝖠-𝖹 𝖺-𝗓 𝟢-𝟫A-Z a-z 0-9Bold Italic𝑨-𝒁 𝒂-𝒛A-Z a-zSans serif bold𝗔-𝗭 𝗮-𝘇 𝟬-𝟵A-Z a-z 0-9Script𝒜-𝒵A-ZSans serif italic𝘈-𝘡 𝘢-𝘻A-Z a-zFractur𝔄-� 𝔞-𝔷A-Z a-zMonospace𝙰-𝚉 𝚊-𝚣 𝟶-𝟿A-Z a-z 0-9Unicode
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 ☺☺.
LayoutAnnotation55 \cancel{5}�+�+�⏞notea+b+cnote \overbrace{a+b+c}^{\text{note}}55 \bcancel{5}�+�+�⏟notenotea+b+c \underbrace{a+b+c}_{\text{note}}���ABC \xcancel{ABC}≠= \not =���abc \sout{abc}�=��π=dc \boxed{\pi=\frac c d}�nan $a_{\angl n}�nan a_\angln−78∘−78∘\phase{-78^\circ}\tag{hi} x+y^{2x}�+�2�(hi)x+y2x(hi)
\tag*{hi} x+y^{2x}�+�2�hix+y2xhi
Line BreaksKaTeX 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��xn x_n=!=! \stackrel{!}{=}��ba a \atop b��ex e^x=!=! \overset{!}{=}���abc a\raisebox{0.25em}{$b$}c��uo _u^o=!!= \underset{!}{=}�+(���)a+(cba) a+\left(\vcenter{\hbox{$\frac{\frac a b}c$}}\right)∑0<�<�0<�<�0<i<m0<j<n∑\sum_{\substack{0\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{/\,}(�2)(x2) \left(x^{\smash{2}}\right) /=/= \mathrlap{\,/}{=}�y \sqrt{\smash[b]{y}}∑1≤�≤�≤����1≤i≤j≤n∑xij \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
FunctionProducesFunctionProduces\,³∕₁₈ 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\quad1 em space\vphantom{content}a strut the height of content\qquad2 em space\!– ³∕₁₈ em space~non-breaking space\negthinspace– ³∕₁₈ em space\space\negmedspace– ⁴∕₁₈ em space\nobreakspacenon-breaking space\negthickspace– ⁵∕₁₈ em space\spacespace\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.
Direct Input: ∀∴∁∵∃∣∈∉∋⊂⊃∧∨↦→←↔¬∀∴∁∵∃∣∈∈/∋⊂⊃∧∨↦→←↔¬ ℂ ℍ ℕ ℙ ℚ ℝ
Macros�2+�2x2+x2\def\foo{x^2} \foo + \foo�2+�2y2+y2\gdef\foo#1{#1^2} \foo{y} + \foo{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.
Macros defined by \gdef, \xdef, \global\def, \global\edef, \global\let, and \global\futurelet will persist between math expressions. (Exception: macro persistence may be disabled. There are legitimate security reasons for that.)
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.
OperatorsBig Operators∑∑ \sum∏∏ \prod⨂⨂ \bigotimes⋁⋁ \bigvee∫∫ \int∐∐ \coprod⨁⨁ \bigoplus⋀⋀ \bigwedge∬∬ \iint∫∫ \intop⨀⨀ \bigodot⋂⋂ \bigcap∭∭ \iiint∫∫ \smallint⨄⨄ \biguplus⋃⋃ \bigcup∮∮ \oint∯∬ \oiint∰∭ \oiiint⨆⨆ \bigsqcupDirect Input: ∫∬∭∮∏∐∑⋀⋁⋂⋃⨀⨁⨂⨄⨆∫∬∭∮∏∐∑⋀⋁⋂⋃⨀⨁⨂⨄⨆ ∯ ∰
Binary Operators++ +⋅⋅ \cdot⋗⋗ \gtrdot�(mod�)x(moda) x \pmod a−− -⋅⋅ \cdotp⊺⊺ \intercal�(�)x(a) 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 mod mod \bmod⋎⋎ \curlyvee�mod �xmoda 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≀≀ \wrDirect Input: +−/∗⋅∘∙±×÷∓∔∧∨∩∪≀⊎⊓⊔⊕⊖⊗⊘⊙⊚⊛⊝◯∖+−/∗⋅∘∙±×÷∓∔∧∨∩∪≀⊎⊓⊔⊕⊖⊗⊘⊙⊚⊛⊝◯∖
Fractions and Binomials��ba \frac{a}{b}��ba \tfrac{a}{b}(��+1](a+1a] \genfrac ( ] {2pt}{1}a{a+1}��ba {a \over b}��ba \dfrac{a}{b}��+1b+1a {a \above{2pt} b+1}�/�a/b a/b�1+1�1+b1a \cfrac{a}{1 + \cfrac{1}{b}}(��)(kn) \binom{n}{k}(��)(kn) \dbinom{n}{k}{��}{kn} {n\brace k}(��)(kn) {n \choose k}(��)(kn) \tbinom{n}{k}[��][kn] {n\brack k}Math Operatorsarcsinarcsin \arcsincoseccosec \cosecdegdeg \degsecsec \secarccosarccos \arccoscoshcosh \coshdimdim \dimsinsin \sinarctanarctan \arctancotcot \cotexpexp \expsinhsinh \sinharctgarctg \arctgcotgcotg \cotghomhom \homshsh \sharcctgarcctg \arcctgcothcoth \cothkerker \kertantan \tanargarg \argcsccsc \csclglg \lgtanhtanh \tanhchch \chctgctg \ctglnln \lntgtg \tgcoscos \coscthcth \cthloglog \logthth \thff \operatorname{f}arg maxargmax \argmaxinj liminjlim \injlimminmin \minlim→lim \varinjlimarg minargmin \argminlimlim \limplimplim \plimlim‾lim \varliminfdetdet \detlim infliminf \liminfPrPr \Prlim‾lim \varlimsupgcdgcd \gcdlim suplimsup \limsupproj limprojlim \projlimlim←lim \varprojliminfinf \infmaxmax \maxsupsup \supff \operatorname*{f}ff \operatornamewithlimits{f}Functions in the bottom six rows of this table can take \limits.
\sqrt�x \sqrt{x}
�33x \sqrt[3]{x}
Relations=!=! \stackrel{!}{=}
== =≑≑ \doteqdot⪅⪅ \lessapprox⌣⌣ \smile<< <≖≖ \eqcirc⋚⋚ \lesseqgtr⊏⊏ \sqsubset>> >∹−: \eqcolon orDirect 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⪹⪹ \precnapproxDirect 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⇒⇒ \RarrDirect Input: ←↑→↓↔↕↖↗↘↙↚↛↞↠↢↣↦↩↪↫↬↭↮↰↱↶↷↺↻↼↽↾↾↿⇀⇁⇂⇃⇄⇆⇇⇈⇉⇊⇋⇌⇍⇎⇏⇐⇑⇒⇓⇔⇕⇚⇛⇝⇠⇢⟵⟶⟷⟸⟹⟺⟼←↑→↓↔↕↖↗↘↙↚↛↞↠↢↣↦↩↪↫↬↭↮↰↱↶↷↺↻↼↽↾↾↿⇀⇁⇂⇃⇄⇆⇇⇈⇉⇊⇋⇌⇍⇎⇏⇐⇑⇒⇓⇔⇕⇚⇛⇝⇠⇢⟵⟶⟷⟸⟹⟺⟼ ↽
Extensible Arrows
←���abc \xleftarrow{abc}→���������overunder \xrightarrow[under]{over}⇐���abc \xLeftarrow{abc}⇒���abc \xRightarrow{abc}↔���abc \xleftrightarrow{abc}⇔���abc \xLeftrightarrow{abc}↩���abc \xhookleftarrow{abc}↪���abc \xhookrightarrow{abc}↞���abc \xtwoheadleftarrow{abc}↠���abc \xtwoheadrightarrow{abc}↼���abc \xleftharpoonup{abc}⇀���abc \xrightharpoonup{abc}↽���abc \xleftharpoondown{abc}⇁���abc \xrightharpoondown{abc}⇋���abc \xleftrightharpoons{abc}⇌���abc \xrightleftharpoons{abc}⇄���abc \xtofrom{abc}↦���abc \xmapsto{abc}=���abc \xlongequal{abc}Extensible arrows all can take an optional argument in the same manner
as \xrightarrow[under]{over}.
Bra-ket Notation
⟨�∣⟨ϕ∣ \bra{\phi}∣�⟩∣ψ⟩ \ket{\psi}⟨�∣�⟩⟨ϕ∣ψ⟩ \braket{\phi|\psi}⟨�∣⟨ϕ∣ \Bra{\phi}∣�⟩∣ψ⟩ \Ket{\psi}⟨� | ∂2∂�2 | �⟩⟨ϕ∂t2∂2ψ⟩ \Braket{ ϕ | \frac{∂^2}{∂ t^2} | ψ }Style, Color, Size, and FontClass Assignment
\mathbin \mathclose \mathinner \mathop
\mathopen \mathord \mathpunct \mathrel
Color
�=��F=ma \color{blue} F=ma
Note that \color acts like a switch. Other color functions expect the content to be a function argument:
�=��F=ma \textcolor{blue}{F=ma}
�=��F=ma \textcolor{#228B22}{F=ma}
�=��F=ma \colorbox{aqua}{$F=ma$}
�=��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
Ab0Ab0 \mathrm{Ab0}��0Ab0 \mathbf{Ab0}��0Ab0 \mathit{Ab0}��0Ab0 \mathnormal{Ab0}Ab0Ab0 \textbf{Ab0}Ab0Ab0 \textit{Ab0}Ab0Ab0 \textrm{Ab0}��0Ab0 \bf Ab0��0Ab0 \it Ab0Ab0Ab0 \rm Ab0��0Ab0 \bold{Ab0}Ab0Ab0 \textup{Ab0}Ab0Ab0 \textnormal{Ab0}��0Ab0 \boldsymbol{Ab}��AB \Bbb{AB}Ab0Ab0 \text{Ab0}��0Ab0 \bm{Ab0}��AB \mathbb{AB}��0Ab0 \mathsf{Ab0}Ab0Ab0 \textmd{Ab0}��0Ab0 \frak{Ab0}Ab0Ab0 \textsf{Ab0}��0Ab0 \mathtt{Ab0}��0Ab0 \mathfrak{Ab0}��0Ab0 \sf Ab0Ab0Ab0 \texttt{Ab0}��0AB0 \mathcal{AB0}��0Ab0 \tt Ab0��0AB0 \cal AB0��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 HH. The other versions do not stack, e.g., \mathsf{\mathbf{H}} will produce �H.
In cases where KaTeX fonts do not have a bold glyph, \pmb can simulate one. For example, \pmb{\mu} renders as : �μ
Size
��AB \Huge AB��AB \normalsize AB��AB \huge AB��AB \small AB��AB \LARGE AB��AB \footnotesize AB��AB \Large AB��AB \scriptsize AB��AB \large AB��AB \tiny ABStyle
∑�=1�i=1∑n \displaystyle\sum_{i=1}^n∑�=1�∑i=1n \textstyle\sum_{i=1}^n�x \scriptstyle x (The size of a first sub/superscript)�x \scriptscriptstyle x (The size of subsequent sub/superscripts)lim�xlim \lim\limits_xlim�limx \lim\nolimits_xx^2x^2 \verb!x^2!\text{…} will accept nested $…$ fragments and render them in math mode.
Symbols and Punctuation% comment…… \dotsKaTeXKATEX \KaTeX%% \%⋯⋯ \cdotsLaTeXLATEX \LaTeX## \#⋱⋱ \ddotsTeXTEX \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} or \P⋆⋆ \star╱╱ \diagup§§ \text{\S} or \S★★ \bigstar♭♭ \flat§§ \text{\sect}♣♣ \clubsuit♮♮ \natural©c◯ \copyright♣♣ \clubs♯♯ \sharp®® \circledR♢♢ \diamondsuit♡♡ \heartsuit®R◯ \text{\textregistered}♢♢ \diamonds♡♡ \heartsⓈⓈ \circledS♠♠ \spadesuit♠♠ \spadesa◯a◯ \text{\textcircled a}✠✠ \maltese⦵∘− \minusoDirect Input: § ¶ £¥∇∞⋅∠∡∢♠♡♢♣♭♮♯✓…⋮⋯⋱!£¥∇∞⋅∠∡∢♠♡♢♣♭♮♯✓…⋮⋯⋱! ‼ ⦵
UnitsIn KaTeX, units are proportioned as they are in TeX.
KaTeX units are different than CSS units.
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: