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 強調
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{…}
\text{…}格式的強調函數
\'{a} |
\~{a} |
\.{a} |
\H{a} |
\`{a} |
\={a} |
\"{a} |
\v{a} |
\^{a} |
\u{a} |
\r{a} |
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} |
||
\begin{aligned} a&=b+c \\ d+e&=f \end{aligned} |
\begin{alignedat}{2} 10&x+ &3&y = 2 \\ 3&x+&13&y = 4 \end{alignedat} |
||
\begin{gathered} a=b \\ e=b+c \end{gathered} |
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還支持darray
、dcases
和drcases
。
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開發者)
\href{https://katex.org/}{\KaTeX} |
|
\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 :
可以直接輸入上面的字母
\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
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: false
或 strict: "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 註釋
\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} |
\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.
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 垂直佈局
x_n |
\stackrel{!}{=} |
a \atop b |
e^x |
\overset{!}{=} |
a\raisebox{0.25em}{b}c |
_u^o |
\underset{!}{=} |
\sum\limits_{0<i<m\atop0<j<n} |
PS:下面這個用不了,用\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{/\,} |
\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.
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 |
\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} |
|
\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 |
\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 |
\cotg |
\ln |
\det |
\arccos |
\coth |
\log |
\gcd |
\arctan |
\csc |
\sec |
\inf |
\arctg |
\ctg |
\sin |
\lim |
\arcctg |
\cth |
\sinh |
\liminf |
\arg |
\deg |
\sh |
\limsup |
\ch |
\dim |
\tan |
\max |
\cos |
\exp |
\tanh |
\min |
\cosec |
\hom |
\tg |
\Pr |
\cosh |
\ker |
\th |
\sup |
\cot |
\lg |
\argmax |
\argmin |
\plim |
\operatorname{f} |
\operatorname*{f} |
(PS:不支持)
Functions on the right column of this table can take \limits
.
此表右列中的函數可以接受\limits
。
\sqrt 平方根
\sqrt{x}
\sqrt[3]{x}
Relations 關係符
\stackrel{!}{=}
= |
\eqcirc |
\lesseqgtr |
\sqsupset |
< |
\eqcolon |
\lesseqqgtr |
\sqsupseteq |
> |
\Eqcolon |
\lessgtr |
\Subset |
: |
\eqqcolon |
\lesssim |
\subset or \sub |
\approx |
\Eqqcolon |
\ll |
\subseteq or \sube |
\approxeq |
\eqsim |
\lll |
\subseteqq |
\asymp |
\eqslantgtr |
\llless |
\succ |
\backepsilon |
\eqslantless |
\lt |
\succapprox |
\backsim |
\equiv |
\mid |
\succcurlyeq |
\backsimeq |
\fallingdotseq |
\models |
\succeq |
\between |
\frown |
\multimap |
\succsim |
\bowtie |
\ge |
\owns |
\Supset |
\bumpeq |
\geq |
\parallel |
\supset |
\Bumpeq |
\geqq |
\perp |
\supseteq or \supe |
\circeq |
\geqslant |
\pitchfork |
\supseteqq |
\colonapprox |
\gg |
\prec |
\thickapprox |
\Colonapprox |
\ggg |
\precapprox |
\thicksim |
\coloneq |
\gggtr |
\preccurlyeq |
\trianglelefteq |
\Coloneq |
\gt |
\preceq |
\triangleq |
\coloneqq |
\gtrapprox |
\precsim |
\trianglerighteq |
\Coloneqq |
\gtreqless |
\propto |
\varpropto |
\colonsim |
\gtreqqless |
\risingdotseq |
\vartriangle |
\Colonsim |
\gtrless |
\shortmid |
\vartriangleleft |
\cong |
\gtrsim |
\shortparallel |
\vartriangleright |
\curlyeqprec |
\in or \isin |
\sim |
\vcentcolon |
\curlyeqsucc |
\Join |
\simeq |
\vdash |
\dashv |
\le |
\smallfrown |
\vDash |
\dblcolon |
\leq |
\smallsmile |
\Vdash |
\doteq |
\leqq |
\smile |
\Vvdash |
\Doteq |
\leqslant |
\sqsubset |
|
\doteqdot |
\lessapprox |
\sqsubseteq |
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}
.
可擴展箭頭都可以接受可選參數,如\xrightarrow[under]{over}
。
Style, Color, Size, and Font 樣式、顏色、大小和字體
Class Assignment
\mathbin
\mathclose
\mathinner
\mathop
\mathopen
\mathord
\mathpunct
\mathrel
Color
顏色
\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顏色函數是將文字作爲參數使用的:
\textcolor{blue}{F=ma}
\textcolor{#228B22}{F=ma}
\colorbox{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 hexadecimal style. The “#” is optional before a six-digit specification.
對於顏色定義,KaTeX顏色函數將接受標準的HTML預定義顏色名稱。也接受CSS十六進制風格的RGB參數。“#”是六位數字規範之前的可選選項。
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 |
\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 .
可以使用\textXX版本的字體函數來堆疊字體種類、權重和形狀。所以 \textsf{\textbf{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 :
在KaTeX字體沒有粗體字形的情況下,\pmb
可以模擬一個。例如,\pmb{\mu}
呈現爲:
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.
\text{…}
將接受嵌套的$…$
片段,並以數學模式呈現它們。
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 |
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 | |||
mu | |||
others |