Skip to content

字体

字体类型

以黑板粗体为例,格式是这样的:$\mathbb{AB}$ ,显示为 AB\mathbb{AB}

黑板粗体(blackboard bold)

\mathbb\Bbb ,仅用于大写字母,如

ABCDEFGHIJKLMNOPQRSTUVWXYZ\Bbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}

粗体(boldface)

\mathbf ,如

ABCDEFGHIJKLMNOPQRSTUVWXYZ\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
abcdefghijklmnopqrstuvwxyz\mathbf{abcdefghijklmnopqrstuvwxyz}

对于基于表达式的字符,使用 \boldsymbol 代替, 如 α\boldsymbol{\alpha}

斜体(italics)

\mathit ,这也是公式中默认的字体,如

ABCDEFGHIJKLMNOPQRSTUVWXYZ\mathit{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
abcdefghijklmnopqrstuvwxyz\mathit{abcdefghijklmnopqrstuvwxyz}

加粗斜体(boldfaced italics)

\pmb ,如

ABCDEFGHIJKLMNOPQRSTUVWXYZ\pmb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
abcdefghijklmnopqrstuvwxyz\pmb{abcdefghijklmnopqrstuvwxyz}

打字机字体(typewriter)

\mathtt ,如

ABCDEFGHIJKLMNOPQRSTUVWXYZ\mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
abcdefghijklmnopqrstuvwxyz\mathtt{abcdefghijklmnopqrstuvwxyz}

罗马字体(roman)

\mathrm ,如

ABCDEFGHIJKLMNOPQRSTUVWXYZ\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
abcdefghijklmnopqrstuvwxyz\mathrm{abcdefghijklmnopqrstuvwxyz}

无衬线字体(sans-serif)

\mathsf ,如

ABCDEFGHIJKLMNOPQRSTUVWXYZ\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
abcdefghijklmnopqrstuvwxyz\mathsf{abcdefghijklmnopqrstuvwxyz}

书法字体(calligraphic)

\mathcal ,仅用于大写字母,如

ABCDEFGHIJKLMNOPQRSTUVWXYZ\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}

手写体(script)

\mathscr ,仅用于大写字母,如

ABCDEFGHIJKLMNOPQRSTUVWXYZ\mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}

德国尖角字体(旧德文风格)(Fraktur)

\mathfrak ,如

ABCDEFGHIJKLMNOPQRSTUVWXYZ\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
abcdefghijklmnopqrstuvwxyz\mathfrak{abcdefghijklmnopqrstuvwxyz}

字体大小

以 large 为例,格式是这样的:$\large{LaTeX}$ ,显示为 LaTeX\large{LaTeX}

字体大小从小到达依次有如下这些:

代码显示
\tiny{LaTeX}LaTeX\displaystyle \tiny{LaTeX}
\scriptsize{LaTeX}LaTeX\displaystyle \scriptsize{LaTeX}
\footnotesize{LaTeX}LaTeX\displaystyle \footnotesize{LaTeX}
\small{LaTeX}LaTeX\displaystyle \small{LaTeX}
\normalsize{LaTeX}LaTeX\displaystyle \normalsize{LaTeX}
\large{LaTeX}LaTeX\displaystyle \large{LaTeX}
\Large{LaTeX}LaTeX\displaystyle \Large{LaTeX}
\LARGE{LaTeX}LaTeX\displaystyle \LARGE{LaTeX}
\huge{LaTeX}LaTeX\displaystyle \huge{LaTeX}
\Huge{LaTeX}LaTeX\displaystyle \Huge{LaTeX}

字体颜色

\color{色值}{字符} ,其中色值可以用 red 、green 等常用颜色,也可以用十六进制 rgb 形式,如

\color{red}{F=ma} 显示为 F=ma\color{red} F=ma\color{#228B22}{F=ma} 显示为 F=ma\color{#228B22}{F=ma}