KaTeX數學公式語法

Supported Functions 支持功能


This is a list of TeX functions supported by KaTeX. It is sorted into logical groups.
這是一組KaTeX支持的TeX函數列表。按照功能邏輯分類。

There is a similar Support Table, sorted alphabetically, that lists both supported and un-supported functions.

還有一個類似的功能列表,按字母順序排列,列出了受支持和不受支持的函數。

Accents 強調

aa' a' a~\tilde{a} \tilde{a} g˚\mathring{g} \mathring{g}
aa'' a'' ac~\widetilde{ac} \widetilde{ac} AB\overgroup{AB} \overgroup{AB}
aa^{\prime} a^{\prime} AB~\utilde{AB} \utilde{AB} AB\undergroup{AB} \undergroup{AB}
aˊ\acute{a} \acute{a} F\vec{F} \vec{F} AB\Overrightarrow{AB} \Overrightarrow{AB}
yˉ\bar{y} \bar{y} AB\overleftarrow{AB} \overleftarrow{AB} AB\overrightarrow{AB} \overrightarrow{AB}
a˘\breve{a} \breve{a} AB\underleftarrow{AB} \underleftarrow{AB} AB\underrightarrow{AB} \underrightarrow{AB}
aˇ\check{a} \check{a} ac\overleftharpoon{ac} \overleftharpoon{ac} ac\overrightharpoon{ac} \overrightharpoon{ac}
a˙\dot{a} \dot{a} AB\overleftrightarrow{AB} \overleftrightarrow{AB} AB\overbrace{AB} \overbrace{AB}
a¨\ddot{a} \ddot{a} AB\underleftrightarrow{AB} \underleftrightarrow{AB} AB\underbrace{AB} \underbrace{AB}
aˋ\grave{a} \grave{a} AB\overline{AB} \overline{AB} ABundefined\overlinesegment{AB} \overlinesegment{AB}
θ^\hat{\theta} \hat{\theta} AB\underline{AB} \underline{AB} ABundefined\underlinesegment{AB} \underlinesegment{AB}
ac^\widehat{ac} \widehat{ac} acˇ\widecheck{ac} \widecheck{ac}

Accent functions inside \text{…}
\text{…}格式的強調函數

aˊ\text{\'{a}} \'{a} a˜\text{\~{a}} \~{a} a˙\text{\.{a}} \.{a} a˝\text{\H{a}} \H{a}
aˋ\text{\`{a}} \`{a} aˉ\text{\={a}} \={a} a¨\text{\"{a}} \"{a} aˇ\text{\v{a}} \v{a}
aˆ\text{\^{a}} \^{a} a˘\text{\u{a}} \u{a} a˚\text{\r{a}} \r{a}

See also letters
另見 letters

Delimiters 分隔符

( )(~) ( ) ( )\lparen~\rparen \lparen
    ~~~~\rparen
 ⌈~⌉ ⌈ ⌉  \lceil~\rceil \lceil
     ~~~~~\rceil
\uparrow \uparrow
[ ][~] [ ] [ ]\lbrack~\rbrack \lbrack
    ~~~~\rbrack
 ⌊~⌋ ⌊ ⌋  \lfloor~\rfloor \lfloor
     ~~~~~\rfloor
\downarrow \downarrow
{}\{ \} \{ \} {}\lbrace \rbrace \lbrace
    ~~~~\rbrace
⎰⎱ ⎰⎱ \lmoustache \rmoustache \lmoustache
    ~~~~\rmoustache
\updownarrow \updownarrow
 ⟨~⟩ ⟨ ⟩  \langle~\rangle \langle
    ~~~~\rangle
 ⟮~⟯ ⟮ ⟯  \lgroup~\rgroup \lgroup
     ~~~~~\rgroup
\Uparrow \Uparrow
\vert | \vert \vert ┌ ┐ ┌ ┐ \ulcorner \urcorner \ulcorner
    ~~~~\urcorner
\Downarrow \Downarrow
\Vert \| \Vert \Vert └ ┘ └ ┘ \llcorner \lrcorner \llcorner
    ~~~~\lrcorner
\Updownarrow \Updownarrow
 \lvert~\rvert \lvert
    ~~~~\rvert
 \lVert~\rVert \lVert
     ~~~~~\rVert
\left. \right. \\backslash \backslash
 \lang~\rang \lang
    ~~~~\rang
< >\lt~\gt \lt \gt  ⟦~⟧ ⟦ ⟧  \llbracket~\rrbracket \llbracket
    ~~~~\rrbracket
 \lBrace~\rBrace \lBrace \rBrace

Delimiter Sizing
分隔符大小

(AB)\left(\LARGE{AB}\right) \left(\LARGE{AB}\right)

(((((( \big( \Big( \bigg( \Bigg( ( \big( \Big( \bigg( \Bigg(

\left \big \bigl \bigm \bigr
\middle \Big \Bigl \Bigm \Bigr
\right \bigg \biggl \biggm \biggr
\Bigg \Biggl \Biggm \Biggr

Environments 環境

abcd\begin{matrix} a & b \\ c & d \end{matrix} \begin{matrix}
   a & b \\
   c & d
\end{matrix}
abcd\begin{array}{cc}a & b\\c & d\end{array} \begin{array}{cc}
   a & b \\
   c & d
\end{array}
(abcd)\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix}
   a & b \\
   c & d
\end{pmatrix}
[abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix}
   a & b \\
   c & d
\end{bmatrix}
abcd\begin{vmatrix} a & b \\ c & d \end{vmatrix} \begin{vmatrix}
   a & b \\
   c & d
\end{vmatrix}
abcd\begin{Vmatrix} a & b \\ c & d \end{Vmatrix} \begin{Vmatrix}
   a & b \\
   c & d
\end{Vmatrix}
{abcd}\begin{Bmatrix} a & b \\ c & d \end{Bmatrix} \begin{Bmatrix}
   a & b \\
   c & d
\end{Bmatrix}
abcdefghi\def\arraystretch{1.5}\begin{array}{c:c:c} a & b & c \\ \hline d & e & f \\ \hdashline g & h & i \end{array} \def\arraystretch{1.5}
   \begin{array}{c:c:c}
   a & b & c \\ \hline
   d & e & f \\
   \hdashline
   g & h & i
\end{array}
a=b+cd+e=f\begin{aligned} a&=b+c \\ d+e&=f \end{aligned} \begin{aligned}
   a&=b+c \\
   d+e&=f
\end{aligned}
10x+3y=23x+13y=4\begin{alignedat}{2}10&x+&3&y=2\\3&x+&13&y=4\end{alignedat} \begin{alignedat}{2}
   10&x+ &3&y = 2 \\
   3&x+&13&y = 4
\end{alignedat}
a=be=b+c\begin{gathered} a=b \\ e=b+c \end{gathered} \begin{gathered}
   a=b \\
   e=b+c
\end{gathered}
x={aif bcif dx = \begin{cases} a &\text{if } b \\ c &\text{if } d \end{cases} x = \begin{cases}
   a &\text{if } b \\
   c &\text{if } d
\end{cases}
KaTeX parse error: No such environment: smallmatrix at position 7: \begin{̲s̲m̲a̲l̲l̲m̲a̲t̲r̲i̲x̲}̲ a & b \\ c & d… \begin{smallmatrix}
   a & b \\
   c & d
\end{smallmatrix}
KaTeX parse error: No such environment: rcases at position 7: \begin{̲r̲c̲a̲s̲e̲s̲}̲ a &\text{if } … \begin{rcases}
   a &\text{if } b \\
   c &\text{if } d
\end{rcases}⇒…

KaTeX also supports darray, dcases, and drcases.
KaTeX還支持darraydcasesdrcases

Acceptable line separators include: \\, \cr, \\[distance], and \cr[distance]. Distance can be written with any of the KaTeX units.
支持的行分隔符包括:\\, \cr, \\[distance], 和 \cr[distance]Distance可以用任何KaTeX units表示。

The {array} environment supports | and : vertical separators.
{array}環境支持|:垂直分隔符。

The {array} environment does not yet support \cline or \multicolumn.
{array}環境當前不支持\cline\multicolumn

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.
下面的“原始HTML”特性對於不受信任的輸入可能是危險的,因此它們在默認情況下是禁用的,嘗試使用它們會產生紅色的命令名(您可以通過errorColor option來配置)。要完全信任LaTeX輸入,您需要傳遞一個trust: true選項;您還可以啓用其中的一些命令或者只是通過’信任’選項的一些URL。(PS:此處配置是針對Katex開發者)

KaTeX\href{https://katex.org/}{\KaTeX} \href{https://katex.org/}{\KaTeX}
https://katex.org/\url{https://katex.org/} \url{https://katex.org/}
KaTeX parse error: Undefined control sequence: \includegraphics at position 1: \̲i̲n̲c̲l̲u̲d̲e̲g̲r̲a̲p̲h̲i̲c̲s̲[height=0.8em, … \includegraphics[height=0.8em, totalheight=0.9em, width=0.9em, alt=KA logo]{https://katex.org/img/khan-academy.png}
KaTeX parse error: Undefined control sequence: \htmlId at position 1: \̲h̲t̲m̲l̲I̲d̲{bar}{x} \htmlId{bar}{x}
KaTeX parse error: Undefined control sequence: \htmlClass at position 1: \̲h̲t̲m̲l̲C̲l̲a̲s̲s̲{foo}{x} \htmlClass{foo}{x}
KaTeX parse error: Undefined control sequence: \htmlStyle at position 1: \̲h̲t̲m̲l̲S̲t̲y̲l̲e̲{color: red;}{x… \htmlStyle{color: red;}{x}
KaTeX parse error: Undefined control sequence: \htmlData at position 1: \̲h̲t̲m̲l̲D̲a̲t̲a̲{foo=a, bar=b}{… \htmlData{foo=a, bar=b}{x}

\includegraphics supports height, width, totalheight, and alt in its first argument. height is required.
\includegraphics 第一個參數支持 height, width, totalheight, 和 alt . height 是必需的。

HTML extension (\html-prefixed) commands are non-standard, so loosening strict option for htmlExtension is required.
HTML擴展(\ HTML前綴)命令是非標準的,因此需要對設置中的strict->htmlExtension參數進行配置才能用。(PS:此處配置是針對Katex開發者)

Letters and Unicode 字母和Unicode

Greek Letters
希臘字母

Direct Input : ABΓΔEZHΘIKΛMNΞOΠPΣTΥΦXΨΩΑ Β Γ Δ Ε Ζ Η Θ Ι \allowbreak Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ωαβγδϵζηθικλμνξoπρστυϕχψωεϑϖϱςφϝ\allowbreak α β γ δ ϵ ζ η θ ι κ λ μ ν ξ o π \allowbreak ρ σ τ υ ϕ χ ψ ω ε ϑ ϖ ϱ ς φ ϝ
可以直接輸入上面的字母

A\Alpha \Alpha B\Beta \Beta Γ\Gamma \Gamma Δ\Delta \Delta
E\Epsilon \Epsilon Z\Zeta \Zeta H\Eta \Eta Θ\Theta \Theta
I\Iota \Iota K\Kappa \Kappa Λ\Lambda \Lambda M\Mu \Mu
N\Nu \Nu Ξ\Xi \Xi O\Omicron \Omicron Π\Pi \Pi
P\Rho \Rho Σ\Sigma \Sigma T\Tau \Tau Υ\Upsilon \Upsilon
Φ\Phi \Phi X\Chi \Chi Ψ\Psi \Psi Ω\Omega \Omega
Γ\varGamma \varGamma Δ\varDelta \varDelta Θ\varTheta \varTheta Λ\varLambda \varLambda
Ξ\varXi \varXi Π\varPi \varPi Σ\varSigma \varSigma Υ\varUpsilon \varUpsilon
Φ\varPhi \varPhi Ψ\varPsi \varPsi Ω\varOmega \varOmega
α\alpha \alpha β\beta \beta γ\gamma \gamma δ\delta \delta
ϵ\epsilon \epsilon ζ\zeta \zeta η\eta \eta θ\theta \theta
ι\iota \iota κ\kappa \kappa λ\lambda \lambda μ\mu \mu
ν\nu \nu ξ\xi \xi ο\omicron \omicron π\pi \pi
ρ\rho \rho σ\sigma \sigma τ\tau \tau υ\upsilon \upsilon
ϕ\phi \phi χ\chi \chi ψ\psi \psi ω\omega \omega
ε\varepsilon \varepsilon ϰ\varkappa \varkappa ϑ\vartheta \vartheta ϑ\thetasym \thetasym
ϖ\varpi \varpi ϱ\varrho \varrho ς\varsigma \varsigma φ\varphi \varphi
ϝ\digamma \digamma

Other Letters
其他字母

ı\imath \imath \nabla \nabla \Im \Im R\Reals \Reals Œ\text{\OE} \text{\OE}
ȷ\jmath \jmath \partial \partial \image \image \wp \wp ø\text{\o} \text{\o}
\aleph \aleph \Game \Game k\Bbbk \Bbbk \weierp \weierp Ø\text{\O} \text{\O}
\alef \alef \Finv \Finv N\N \N Z\Z \Z ß\text{\ss} \text{\ss}
\alefsym \alefsym C\cnums \cnums N\natnums \natnums a˚\text{\aa} \text{\aa} ı\text{\i} \text{\i}
\beth \beth C\Complex \Complex R\R \R A˚\text{\AA} \text{\AA} ȷ\text{\j} \text{\j}
\gimel \gimel \ell \ell \Re \Re æ\text{\ae} \text{\ae}
\daleth \daleth \hbar \hbar \real \real Æ\text{\AE} \text{\AE}
ð\eth \eth \hslash \hslash R\reals \reals œ\text{\oe} \text{\oe}

Direct Input: ð∂ ∇ ℑ Ⅎ ℵ ℶ ℷ ℸ ⅁ ℏ ðÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝÞßàáâãäåçèéêëìíîïðñòóôöùúûüýþÿ
可以直接輸入上面的字母

Unicode Mathematical Alphanumeric Symbols
Unicode數學字母數字符號

下圖是原符號,看樣子CSDN的KaTex版本不支持顯示

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.
上面列出的字母將在KaTeX渲染模式下渲染。

In addition, 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.
此外,梵文、格魯吉亞文、中文、日文和韓文的字形可以在文本模式下顯示。然而,這些字形將從系統字體(而不是katex提供的字體)呈現,因此它們的排版可能會衝突。
你可以設置.latin-fallback, .cyrillic-fallback, .brahmic-fallback, .georgian-fallback, .cjk-fallback, and .hangul-fallback這些CSS類規則,以給這些語言支持提供備用字體。

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.
使用這些符號可能會導致垂直對齊的小問題:KaTeX對列出的符號和大多數拉丁、希臘和西裏爾字母都有詳細的度量,但是其他公認的符號都被視爲與當前KaTeX字體中的字母M一樣高。

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.
如果KaTeX渲染模式設置爲strict: falsestrict: "warn"(默認),那麼KaTeX將接受所有的Unicode字符,包括文本和數學模式。

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.
對於波斯語合成字符,用戶提供的 插件 正在開發中。

Layout 佈局

Annotation 註釋

5\cancel{5} \cancel{5} a+b+cnote\overbrace{a+b+c}^{\text{note}} \overbrace{a+b+c}^{\text{note}}
5\bcancel{5} \bcancel{5} a+b+cnote\underbrace{a+b+c}_{\text{note}} \underbrace{a+b+c}_{\text{note}}
ABC\xcancel{ABC} \xcancel{ABC} \not = \not =
abc\sout{abc} \sout{abc} π=cd\boxed{\pi=\frac c d} \boxed{\pi=\frac c d}

\tag{hi} x+y^{2x}
x+y2x(hi)\tag{hi} x+y^{2x}

\tag*{hi} x+y^{2x}
x+y2xhi\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.
KaTeX 0.10.0之後的版本將在關係或二進制操作符(如“=”或“+”)之後插入自動換行符。可以通過 \nobreak或用大括號來阻止,如{F=ma}\allowbreak將允許在關係或操作符以外的位置自動換行。

Hard line breaks are \\ and \newline.
硬換行符是\\\newline

In display math, KaTeX does not insert automatic line breaks. It ignores display math hard line breaks when rendering option strict: true.
在顯示數學公式時,KaTeX不插入自動換行符。當渲染選項strict: true時,它會忽略硬換行符。

Vertical Layout 垂直佈局

xnx_n x_n =!\stackrel{!}{=} \stackrel{!}{=} aba \atop b a \atop b
exe^x e^x =!\overset{!}{=} \overset{!}{=} abca\raisebox{0.25em}{b}c a\raisebox{0.25em}{b}c
uo_u^o _u^o =!\underset{!}{=} \underset{!}{=} 0<i<m0<j<n\sum\limits_{0<i<m\atop0<j<n} \sum\limits_{0<i<m\atop0<j<n}

PS:下面這個用不了,用\sum\limits_{0<i<m\atop0<j<n}代替0<i<m0<j<n\sum\limits_{0<i<m\atop0<j<n}
KaTeX parse error: Undefined control sequence: \substack at position 7: \sum_{\̲s̲u̲b̲s̲t̲a̲c̲k̲{0<i<m\\0<j<n}} \sum_{\substack{0<i<m\\0<j<n}}

The second argument of \raisebox can contain math if it is nested within $…$ delimiters, as in \raisebox{0.25em}{$\frac a b$}
'\raisebox’的第二個參數可以包含數學,如果它嵌套在$…$分隔符內,如\raisebox{0.25em}{$\frac a b$}

Overlap and Spacing 重疊和間距

=/{=}\mathllap{/\,} {=}\mathllap{/\,} (x2)\left(x^{\smash{2}}\right) \left(x^{\smash{2}}\right)
/=\mathrlap{\,/}{=} \mathrlap{\,/}{=} y\sqrt{\smash[b]{y}} \sqrt{\smash[b]{y}}

1ijnxij\displaystyle\sum_{\mathclap{1\le i\le j\le n}} x_{ij} \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.
KaTeX也支持\llap, \rlap, and \clap,但是它們的參數只接受文本,不接受數學。

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

Notes:
注意:
distance will accept any of the KaTeX units.
distance接受任何KaTeX單位

\kern, \mkern, \mskip, and \hspace accept unbraced distances, as in: \kern1em.
\kern, \mkern, \mskip, and \hspace 接受寬鬆的寫法如: \kern1em.

\mkern and \mskip will not work in text mode and both will write a console warning for any unit except mu.
\mkern\mskip在文本模式下無效,除了 mu,其他的單位都會在控制檯輸出警告。

Logic and Set Theory 邏輯與集合論

\forall \forall \complement \complement \therefore \therefore \emptyset \emptyset
\exists \exists \subset \subset \because \because \empty \empty
\exist \exist \supset \supset \mapsto \mapsto \varnothing \varnothing
\nexists \nexists \mid \mid \to \to     \implies \implies
\in \in \land \land \gets \gets     \impliedby \impliedby
\isin \isin \lor \lor \leftrightarrow \leftrightarrow     \iff \iff
\notin \notin \ni \ni \notni \notni ¬\neg \neg or \lnot

Direct Input: ¬∀ ∴ ∁ ∵ ∃ ∣ ∈ ∉ ∋ ⊂ ⊃ ∧ ∨ ↦ → ← ↔ ¬ ℂ ℍ ℕ ℙ ℚ ℝ
可以直接輸入上面的符號

Macros 宏

x2+x2\def\foo{x^2} \foo + \foo \def\foo{x^2} \foo + \foo
y2+y2\gdef\bar#1{#1^2} \bar{y} + \bar{y} \gdef\bar#1{#1^2} \bar{y} + \bar{y}
\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.
宏也可以在KaTeX渲染選項中定義。

Macros accept up to nine arguments: #1, #2, etc.
宏最多接受9個參數:#1,#2等。

\gdef and \global\def macros will persist between math expressions.
\gdef and \global\def宏具有全局性,在數學表達式之間持久存在。

Available functions include:
可用函數有:

\char \mathchoice \TextOrMath \@ifstar \@ifnextchar \@firstoftwo \@secondoftwo \relax

@ is a valid character for commands, as if \makeatletter were in effect.
@是命令的有效字符,就好像 \makeatletter 是有效的一樣。

Operators 運算符

Big Operators 大運算符

\sum \sum \prod \prod \bigotimes \bigotimes \bigvee \bigvee
\int \int \coprod \coprod \bigoplus \bigoplus \bigwedge \bigwedge
\iint \iint \intop \intop \bigodot \bigodot \bigcap \bigcap
\iiint \iiint \smallint \smallint \biguplus \biguplus \bigcup \bigcup
\oint \oint \oiint \oiint \oiiint \oiiint \bigsqcup \bigsqcup

Direct Input: ∫ ∬ ∭ ∮ ∏ ∐ ∑ ⋀ ⋁ ⋂ ⋃ ⨀ ⨁ ⨂ ⨄ ⨆
也可以直接輸入上述符號

Binary Operators 二元運算符

++ + \cdot \cdot \gtrdot \gtrdot x(moda)x \pmod a x \pmod a
- - \cdotp \cdotp \intercal \intercal x(a)x \pod a x \pod a
// / \centerdot \centerdot \land \land \rhd \rhd
* * \circ \circ \leftthreetimes \leftthreetimes \rightthreetimes \rightthreetimes
⨿\amalg \amalg \circledast \circledast .\ldotp \ldotp \rtimes \rtimes
&\And \And \circledcirc \circledcirc \lor \lor \setminus \setminus
\ast \ast \circleddash \circleddash \lessdot \lessdot \smallsetminus \smallsetminus
\barwedge \barwedge \Cup \Cup \lhd \lhd \sqcap \sqcap
\bigcirc \bigcirc \cup \cup \ltimes \ltimes \sqcup \sqcup
mod\bmod \bmod \curlyvee \curlyvee xmod  ax \mod a x\mod a ×\times \times
\boxdot \boxdot \curlywedge \curlywedge \mp \mp \unlhd \unlhd
\boxminus \boxminus ÷\div \div \odot \odot \unrhd \unrhd
\boxplus \boxplus \divideontimes \divideontimes \ominus \ominus \uplus \uplus
\boxtimes \boxtimes \dotplus \dotplus \oplus \oplus \vee \vee
\bullet \bullet \doublebarwedge \doublebarwedge \otimes \otimes \veebar \veebar
\Cap \Cap \doublecap \doublecap \oslash \oslash \wedge \wedge
\cap \cap \doublecup \doublecup ±\pm \pm or \plusmn \wr \wr

Direct Input: +/±×÷+ - / * ⋅ ± × ÷ ∓ ∔ ∧ ∨ ∩ ∪ ≀ ⊎ ⊓ ⊔ ⊕ ⊖ ⊗ ⊘ ⊙ ⊚ ⊛ ⊝
也可以直接輸入上述符號

Fractions and Binomials 分數和二項式

ab\frac{a}{b} \frac{a}{b} ab\tfrac{a}{b} \tfrac{a}{b} (aa+1]\genfrac ( ] {2pt}{1}a{a+1} \genfrac ( ] {2pt}{1}a{a+1}
ab{a \over b} {a \over b} ab\dfrac{a}{b} \dfrac{a}{b} ab+1{a \above{2pt} b+1} {a \above{2pt} b+1}
a/ba/b a/b a1+1b\cfrac{a}{1 + \cfrac{1}{b}} \cfrac{a}{1 + \cfrac{1}{b}}
(nk)\binom{n}{k} \binom{n}{k} (nk)\dbinom{n}{k} \dbinom{n}{k} {nk}{n\brace k} {n\brace k}
(nk){n \choose k} {n \choose k} (nk)\tbinom{n}{k} \tbinom{n}{k} [nk]{n\brack k} {n\brack k}

Math Operators 數學運算符

arcsin\arcsin \arcsin cotg\cotg \cotg ln\ln \ln det\det \det
arccos\arccos \arccos coth\coth \coth log\log \log gcd\gcd \gcd
arctan\arctan \arctan csc\csc \csc sec\sec \sec inf\inf \inf
arctg\arctg \arctg ctg\ctg \ctg sin\sin \sin lim\lim \lim
arcctg\arcctg \arcctg cth\cth \cth sinh\sinh \sinh lim inf\liminf \liminf
arg\arg \arg deg\deg \deg sh\sh \sh lim sup\limsup \limsup
ch\ch \ch dim\dim \dim tan\tan \tan max\max \max
cos\cos \cos exp\exp \exp tanh\tanh \tanh min\min \min
cosec\cosec \cosec hom\hom \hom tg\tg \tg Pr\Pr \Pr
cosh\cosh \cosh ker\ker \ker th\th \th sup\sup \sup
cot\cot \cot lg\lg \lg arg max\argmax \argmax arg min\argmin \argmin
plimplim \plim f\operatorname{f} \operatorname{f} *f\operatorname*{f} \operatorname*{f}

(PS:不支持plimplim
Functions on the right column of this table can take \limits.
此表右列中的函數可以接受\limits

\sqrt 平方根

x\sqrt{x} \sqrt{x}

x3\sqrt[3]{x} \sqrt[3]{x}

Relations 關係符

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

== = \eqcirc \eqcirc \lesseqgtr \lesseqgtr \sqsupset \sqsupset
<< < \eqcolon \eqcolon \lesseqqgtr \lesseqqgtr \sqsupseteq \sqsupseteq
>> > \Eqcolon \Eqcolon \lessgtr \lessgtr \Subset \Subset
:: : \eqqcolon \eqqcolon \lesssim \lesssim \subset \subset or \sub
\approx \approx =\Eqqcolon \Eqqcolon \ll \ll \subseteq \subseteq or \sube
\approxeq \approxeq \eqsim \eqsim \lll \lll \subseteqq \subseteqq
\asymp \asymp \eqslantgtr \eqslantgtr \llless \llless \succ \succ
\backepsilon \backepsilon \eqslantless \eqslantless <\lt \lt \succapprox \succapprox
\backsim \backsim \equiv \equiv \mid \mid \succcurlyeq \succcurlyeq
\backsimeq \backsimeq \fallingdotseq \fallingdotseq \models \models \succeq \succeq
\between \between \frown \frown \multimap \multimap \succsim \succsim
\bowtie \bowtie \ge \ge \owns \owns \Supset \Supset
\bumpeq \bumpeq \geq \geq \parallel \parallel \supset \supset
\Bumpeq \Bumpeq \geqq \geqq \perp \perp \supseteq \supseteq or \supe
\circeq \circeq \geqslant \geqslant \pitchfork \pitchfork \supseteqq \supseteqq
:\colonapprox \colonapprox \gg \gg \prec \prec \thickapprox \thickapprox
\Colonapprox \Colonapprox \ggg \ggg \precapprox \precapprox \thicksim \thicksim
:\coloneq \coloneq \gggtr \gggtr \preccurlyeq \preccurlyeq \trianglelefteq \trianglelefteq
\Coloneq \Coloneq >\gt \gt \preceq \preceq \triangleq \triangleq
\coloneqq \coloneqq \gtrapprox \gtrapprox \precsim \precsim \trianglerighteq \trianglerighteq
=\Coloneqq \Coloneqq \gtreqless \gtreqless \propto \propto \varpropto \varpropto
:\colonsim \colonsim \gtreqqless \gtreqqless \risingdotseq \risingdotseq \vartriangle \vartriangle
\Colonsim \Colonsim \gtrless \gtrless \shortmid \shortmid \vartriangleleft \vartriangleleft
\cong \cong \gtrsim \gtrsim \shortparallel \shortparallel \vartriangleright \vartriangleright
\curlyeqprec \curlyeqprec \in \in or \isin \sim \sim :\vcentcolon \vcentcolon
\curlyeqsucc \curlyeqsucc \Join \Join \simeq \simeq \vdash \vdash
\dashv \dashv \le \le \smallfrown \smallfrown \vDash \vDash
\dblcolon \dblcolon \leq \leq \smallsmile \smallsmile \Vdash \Vdash
\doteq \doteq \leqq \leqq \smile \smile \Vvdash \Vvdash
\Doteq \Doteq \leqslant \leqslant \sqsubset \sqsubset
\doteqdot \doteqdot \lessapprox \lessapprox \sqsubseteq \sqsubseteq

Direct Input: =<>:= < > : ∈ ∋ ∝ ∼ ∽ ≂ ≃ ≅ ≈ ≊ ≍ ≎ ≏ ≐ ≑ ≒ ≓ ≖ ≗ ≜ ≡ ≤ ≥ ≦ ≧ ≫ ≬ ≳ ≷ ≺ ≻ ≼ ≽ ≾ ≿ ⊂ ⊃ ⊆ ⊇ ⊏ ⊐ ⊑ ⊒ ⊢ ⊣ ⊩ ⊪ ⊸ ⋈ ⋍ ⋐ ⋑ ⋔ ⋙ ⋛ ⋞ ⋟ ⌢ ⌣ ⩾ ⪆ ⪌ ⪕ ⪖ ⪯ ⪰ ⪷ ⪸ ⫅ ⫆ ≲ ⩽ ⪅ ≶ ⋚ ⪋ ⟂ ⊨ ≔ ≕ ⩴
上述符號可以直接輸入

Negated Relations 否定關係

\not = \not =

\gnapprox \gnapprox \ngeqslant \ngeqslant \nsubseteq \nsubseteq \precneqq \precneqq
\gneq \gneq \ngtr \ngtr \nsubseteqq \nsubseteqq \precnsim \precnsim
\gneqq \gneqq \nleq \nleq \nsucc \nsucc \subsetneq \subsetneq
\gnsim \gnsim \nleqq \nleqq \nsucceq \nsucceq \subsetneqq \subsetneqq
\gvertneqq \gvertneqq \nleqslant \nleqslant \nsupseteq \nsupseteq \succnapprox \succnapprox
\lnapprox \lnapprox \nless \nless \nsupseteqq \nsupseteqq \succneqq \succneqq
\lneq \lneq \nmid \nmid \ntriangleleft \ntriangleleft \succnsim \succnsim
\lneqq \lneqq \notin \notin \ntrianglelefteq \ntrianglelefteq \supsetneq \supsetneq
\lnsim \lnsim \notni \notni \ntriangleright \ntriangleright \supsetneqq \supsetneqq
\lvertneqq \lvertneqq \nparallel \nparallel \ntrianglerighteq \ntrianglerighteq \varsubsetneq \varsubsetneq
\ncong \ncong \nprec \nprec \nvdash \nvdash \varsubsetneqq \varsubsetneqq
\ne \ne \npreceq \npreceq \nvDash \nvDash \varsupsetneq \varsupsetneq
\neq \neq \nshortmid \nshortmid \nVDash \nVDash \varsupsetneqq \varsupsetneqq
\ngeq \ngeq \nshortparallel \nshortparallel \nVdash \nVdash
\ngeqq \ngeqq \nsim \nsim \precnapprox \precnapprox

Direct Input: ∉ ∌ ∤ ∦ ≁ ≆ ≠ ≨ ≩ ≮ ≯ ≰ ≱ ⊀ ⊁ ⊈ ⊉ ⊊ ⊋ ⊬ ⊭ ⊮ ⊯ ⋠ ⋡ ⋦ ⋧ ⋨ ⋩ ⋬ ⋭ ⪇ ⪈ ⪉ ⪊ ⪵ ⪶ ⪹ ⪺ ⫋ ⫌
上述符號可以直接輸入

Arrows 箭頭

\circlearrowleft \circlearrowleft \leftharpoonup \leftharpoonup \rArr \rArr
\circlearrowright \circlearrowright \leftleftarrows \leftleftarrows \rarr \rarr
\curvearrowleft \curvearrowleft \leftrightarrow \leftrightarrow \restriction \restriction
\curvearrowright \curvearrowright \Leftrightarrow \Leftrightarrow \rightarrow \rightarrow
\Darr \Darr \leftrightarrows \leftrightarrows \Rightarrow \Rightarrow
\dArr \dArr \leftrightharpoons \leftrightharpoons \rightarrowtail \rightarrowtail
\darr \darr \leftrightsquigarrow \leftrightsquigarrow \rightharpoondown \rightharpoondown
\dashleftarrow \dashleftarrow \Lleftarrow \Lleftarrow \rightharpoonup \rightharpoonup
\dashrightarrow \dashrightarrow \longleftarrow \longleftarrow \rightleftarrows \rightleftarrows
\downarrow \downarrow \Longleftarrow \Longleftarrow \rightleftharpoons \rightleftharpoons
\Downarrow \Downarrow \longleftrightarrow \longleftrightarrow \rightrightarrows \rightrightarrows
\downdownarrows \downdownarrows \Longleftrightarrow \Longleftrightarrow \rightsquigarrow \rightsquigarrow
\downharpoonleft \downharpoonleft \longmapsto \longmapsto \Rrightarrow \Rrightarrow
\downharpoonright \downharpoonright \longrightarrow \longrightarrow \Rsh \Rsh
\gets \gets \Longrightarrow \Longrightarrow \searrow \searrow
\Harr \Harr \looparrowleft \looparrowleft \swarrow \swarrow
\hArr \hArr \looparrowright \looparrowright \to \to
\harr \harr \Lrarr \Lrarr \twoheadleftarrow \twoheadleftarrow
\hookleftarrow \hookleftarrow \lrArr \lrArr \twoheadrightarrow \twoheadrightarrow
\hookrightarrow \hookrightarrow \lrarr \lrarr \Uarr \Uarr
    \iff \iff \Lsh \Lsh \uArr \uArr
    \impliedby \impliedby \mapsto \mapsto \uarr \uarr
    \implies \implies \nearrow \nearrow \uparrow \uparrow
\Larr \Larr \nleftarrow \nleftarrow \Uparrow \Uparrow
\lArr \lArr \nLeftarrow \nLeftarrow \updownarrow \updownarrow
\larr \larr \nleftrightarrow \nleftrightarrow \Updownarrow \Updownarrow
\leadsto \leadsto \nLeftrightarrow \nLeftrightarrow \upharpoonleft \upharpoonleft
\leftarrow \leftarrow \nrightarrow \nrightarrow \upharpoonright \upharpoonright
\Leftarrow \Leftarrow \nRightarrow \nRightarrow \upuparrows \upuparrows
\leftarrowtail \leftarrowtail \nwarrow \nwarrow
\leftharpoondown \leftharpoondown \Rarr \Rarr

Direct Input: ← ↑ → ↓ ↔ ↕ ↖ ↗ ↘ ↙ ↚ ↛ ↞ ↠ ↢ ↣ ↦ ↩ ↪ ↫ ↬ ↭ ↮ ↰ ↱↶ ↷ ↺ ↻ ↼ ↽ ↾ ↾ ↿ ⇀ ⇁ ⇂ ⇃ ⇄ ⇆ ⇇ ⇈ ⇉ ⇊ ⇋ ⇌⇍ ⇎ ⇏ ⇐ ⇑ ⇒ ⇓ ⇔ ⇕ ⇚ ⇛ ⇝ ⇠ ⇢ ⟵ ⟶ ⟷ ⟸ ⟹ ⟺ ⟼
上述符號可以直接輸入

Extensible Arrows
擴展箭頭

abc\xleftarrow{abc} \xleftarrow{abc} underover\xrightarrow[under]{over} \xrightarrow[under]{over}
abc\xLeftarrow{abc} \xLeftarrow{abc} abc\xRightarrow{abc} \xRightarrow{abc}
abc\xleftrightarrow{abc} \xleftrightarrow{abc} abc\xLeftrightarrow{abc} \xLeftrightarrow{abc}
abc\xhookleftarrow{abc} \xhookleftarrow{abc} abc\xhookrightarrow{abc} \xhookrightarrow{abc}
abc\xtwoheadleftarrow{abc} \xtwoheadleftarrow{abc} abc\xtwoheadrightarrow{abc} \xtwoheadrightarrow{abc}
abc\xleftharpoonup{abc} \xleftharpoonup{abc} abc\xrightharpoonup{abc} \xrightharpoonup{abc}
abc\xleftharpoondown{abc} \xleftharpoondown{abc} abc\xrightharpoondown{abc} \xrightharpoondown{abc}
abc\xleftrightharpoons{abc} \xleftrightharpoons{abc} abc\xrightleftharpoons{abc} \xrightleftharpoons{abc}
abc\xtofrom{abc} \xtofrom{abc} abc\xmapsto{abc} \xmapsto{abc}
=abc\xlongequal{abc} \xlongequal{abc}

Extensible arrows all can take an optional argument in the same manner
as \xrightarrow[under]{over}.
可擴展箭頭都可以接受可選參數,如\xrightarrow[under]{over}

Style, Color, Size, and Font 樣式、顏色、大小和字體

Class Assignment

\mathbin \mathclose \mathinner \mathop

\mathopen \mathord \mathpunct \mathrel

Color
顏色

F=ma\color{blue} F=ma \color{blue} F=ma

Note that KaTeX \color acts like a switch. This aligns with LaTeX and differs from MathJax.
Other KaTeX color functions expect the content to be a function argument:
注意,KaTeX的\color就像一個開關。這與LaTeX一致,與MathJax不同。
其他KaTeX顏色函數是將文字作爲參數使用的:

F=ma\textcolor{blue}{F=ma} \textcolor{blue}{F=ma}

F=ma\textcolor{#228B22}{F=ma} \textcolor{#228B22}{F=ma}

A\colorbox{aqua}{A} \colorbox{aqua}{A}

A\fcolorbox{red}{aqua}{A} \fcolorbox{red}{aqua}{A}

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. The “#” is optional before a six-digit specification.
對於顏色定義,KaTeX顏色函數將接受標準的HTML預定義顏色名稱。也接受CSS十六進制風格的RGB參數。“#”是六位數字規範之前的可選選項。

Font
字體

Ab0\mathrm{Ab0} \mathrm{Ab0} Ab0\mathbf{Ab0} \mathbf{Ab0} Ab0\mathit{Ab0} \mathit{Ab0}
Ab0\mathnormal{Ab0} \mathnormal{Ab0} Ab0\textbf{Ab0} \textbf{Ab0} Ab0\textit{Ab0} \textit{Ab0}
Ab0\textrm{Ab0} \textrm{Ab0} Ab0\bf Ab0 \bf Ab0 Ab0\it Ab0 \it Ab0
Ab0\rm Ab0 \rm Ab0 Ab0\bold{Ab0} \bold{Ab0} Ab0\textup{Ab0} \textup{Ab0}
Ab0\textnormal{Ab0} \textnormal{Ab0} Ab0\boldsymbol{Ab0} \boldsymbol{Ab} AB\Bbb{AB} \Bbb{AB}
Ab0\text{Ab0} \text{Ab0} Ab0\bm{Ab0} \bm{Ab0} AB\mathbb{AB} \mathbb{AB}
Ab0\mathsf{Ab0} \mathsf{Ab0} Ab0\textmd{Ab0} \textmd{Ab0} Ab0\frak{Ab0} \frak{Ab0}
Ab0\textsf{Ab0} \textsf{Ab0} Ab0\mathtt{Ab0} \mathtt{Ab0} Ab0\mathfrak{Ab0} \mathfrak{Ab0}
Ab0\sf Ab0 \sf Ab0 Ab0\texttt{Ab0} \texttt{Ab0} AB0\mathcal{AB0} \mathcal{AB0}
Ab0\tt Ab0 \tt Ab0 AB\mathscr{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}}. The other versions do not stack, e.g., \mathsf{\mathbf{H}} will produce H\mathsf{\mathbf{H}}.
可以使用\textXX版本的字體函數來堆疊字體種類、權重和形狀。所以 \textsf{\textbf{H}}將會產生H\textsf{\textbf{H}}。其他版本不堆疊,例如, \mathsf{\mathbf{H}}}將產生H\mathsf{\mathbf{H}}

In cases where KaTeX fonts do not have a bold glyph, \pmb can simulate one. For example, \pmb{\mu} renders as : μ\pmb{\mu}
在KaTeX字體沒有粗體字形的情況下,\pmb可以模擬一個。例如,\pmb{\mu}呈現爲:μ\pmb{\mu}

Size
大小

AB\Huge AB \Huge AB AB\normalsize AB \normalsize AB
AB\huge AB \huge AB AB\small AB \small AB
AB\LARGE AB \LARGE AB AB\footnotesize AB \footnotesize AB
AB\Large AB \Large AB AB\scriptsize AB \scriptsize AB
AB\large AB \large AB AB\tiny AB \tiny AB

Style
風格

i=1n\displaystyle\sum_{i=1}^n \displaystyle\sum_{i=1}^n
i=1n\textstyle\sum_{i=1}^n \textstyle\sum_{i=1}^n
x\scriptstyle x \scriptstyle x         (The size of a first sub/superscript)
x\scriptscriptstyle x \scriptscriptstyle x (The size of subsequent sub/superscripts)
limx\lim\limits_x \lim\limits_x
limx\lim\nolimits_x \lim\nolimits_x
x^2\verb!x^2! \verb!x^2!

\text{…} will accept nested $…$ fragments and render them in math mode.
\text{…}將接受嵌套的$…$片段,並以數學模式呈現它們。

Symbols and Punctuation 符號和標點符號

% comment \dots \dots KaTeX\KaTeX \KaTeX
%\% \% \cdots \cdots LaTeX\LaTeX \LaTeX
#\# \# \ddots \ddots TeX\TeX \TeX
&\& \& \ldots \ldots \nabla \nabla
_\_ \_ \vdots \vdots \infty \infty
_\text{\textunderscore} \text{\textunderscore} \dotsb \dotsb \infin \infin
\text{--} \text{--} \dotsc \dotsc \checkmark \checkmark
\text{\textendash} \text{\textendash}  ⁣\dotsi \dotsi \dag \dag
\text{---} \text{---} \dotsm \dotsm \dagger \dagger
\text{\textemdash} \text{\textemdash} \dotso \dotso \text{\textdagger} \text{\textdagger}
~\text{\textasciitilde} \text{\textasciitilde} \sdot \sdot \ddag \ddag
^\text{\textasciicircum} \text{\textasciicircum} \mathellipsis \mathellipsis \ddagger \ddagger
` ` \text{\textellipsis} \text{\textellipsis} \text{\textdaggerdbl} \text{\textdaggerdbl}
\text{\textquoteleft} text{\textquoteleft} \Box \Box \Dagger \Dagger
\lq \lq \square \square \angle \angle
\text{\textquoteright} \text{\textquoteright} \blacksquare \blacksquare \measuredangle \measuredangle
\rq \rq \triangle \triangle \sphericalangle \sphericalangle
\text{\textquotedblleft} \text{\textquotedblleft} \triangledown \triangledown \top \top
"" " \triangleleft \triangleleft \bot \bot
\text{\textquotedblright} \text{\textquotedblright} \triangleright \triangleright $$$ \$
 ⁣:\colon \colon \bigtriangledown \bigtriangledown $\text{\textdollar} \text{\textdollar}
\backprime \backprime \bigtriangleup \bigtriangleup £\pounds \pounds
\prime \prime \blacktriangle \blacktriangle £\mathsterling \mathsterling
<\text{\textless} \text{\textless} \blacktriangledown \blacktriangledown £\text{\textsterling} \text{\textsterling}
>\text{\textgreater} \text{\textgreater} \blacktriangleleft \blacktriangleleft ¥\yen \yen
|\text{\textbar} \text{\textbar} \blacktriangleright \blacktriangleright \surd \surd
\text{\textbardbl} \text{\textbardbl} \diamond \diamond °\degree \degree
{\text{\textbraceleft} \text{\textbraceleft} \Diamond \Diamond °\text{\textdegree} \text{\textdegree}
}\text{\textbraceright} \text{\textbraceright} \lozenge \lozenge \mho \mho
\\text{\textbackslash} \text{\textbackslash} \blacklozenge \blacklozenge \diagdown \diagdown
\text{\P} \text{\P} \star \star \diagup \diagup
§\text{\S} \text{\S} \bigstar \bigstar \flat \flat
§\text{\sect} \text{\sect} \clubsuit \clubsuit \natural \natural
©\copyright \copyright \clubs \clubs \sharp \sharp
®\circledR \circledR \diamondsuit \diamondsuit \heartsuit \heartsuit
®\text{\textregistered} \text{\textregistered} \diamonds \diamonds \hearts \hearts
\circledS \circledS \spadesuit \spadesuit \spades \spades
a\text{\textcircled a} \text{\textcircled a} \maltese \maltese

Direct Input: £¥!£ ¥ ∇ ∞ · ∠ ∡ ∢ ♠ ♡ ♢ ♣ ♭ ♮ ♯ ✓ … ⋮ ⋯ ⋱ !
上述符號可以直接輸入

Units單位

In KaTeX, units are proportioned as they are in TeX.
在KaTeX中,單位的比例與在TeX中一樣。

KaTeX units are different than CSS units.
KaTeX單位不同於CSS單位。

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.

此處:
F = (周圍HTML文本的字體大小)/10pt
默認情況下G = 1.21,因爲KaTeX的字體大小通常是1.21×周圍的字體大小。這個值可以被HTML頁面的CSS覆蓋

The effect of style and size:
風格和大小的影響:

Unit textstyle scriptscript huge
em or ex \rule{1em}{1em} \scriptscriptstyle\rule{1em}{1em} \huge\rule{1em}{1em}
mu \rule{18mu}{18mu} \scriptscriptstyle\rule{18mu}{18mu} \huge\rule{18mu}{18mu}
others \rule{10pt}{10pt} \scriptscriptstyle\rule{10pt}{10pt} \huge\rule{10pt}{10pt}
發佈了156 篇原創文章 · 獲贊 353 · 訪問量 72萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章