跳到主要內容

LaTeX 數學字型:粗體、黑板粗體、花體

使用數學字母樣式指令:\mathbf{v} 為粗體,\mathbb{R} 為黑板粗體(amssymb),\mathcal{L} 為花體,\mathfrak{g} 為德文尖角體;\boldsymbol 或 \bm 也能讓希臘字母和符號變成粗體。

數學字母樣式

在數學模式中,字母是斜體的變數。數學字母樣式指令會改變引數中字母的樣式,通常是為了賦予它們特定的意義:粗體表示向量和矩陣,黑板粗體表示數集,花體表示集合族。

指令結果常見用途
\mathbf{v}正體粗體向量、矩陣
\boldsymbol{\alpha}、\bm{\alpha}粗體,保留斜體,也適用於希臘字母和符號粗體的希臘字母向量
\mathbb{R}黑板粗體(amssymb)ℕ、ℤ、ℚ、ℝ、ℂ
\mathcal{L}花體大寫字母拉格朗日量、集合族
\mathfrak{g}德文尖角體李代數、理想
\mathrm{d}正體羅馬體單位、微分符號 d、標籤
\mathit{x}斜體多字母的變數名稱
\mathsf{T}無襯線體轉置、範疇
\mathtt{x}打字機體公式中的程式碼

常用的字母樣式

LaTeX導言區: \usepackage{amssymb,bm}在編輯器中開啟 (在新分頁中開啟)
\mathbf{A}\mathbf{x} = \mathbf{b} \qquad \bm{\mu} \in \mathbb{R}^{44} \qquad
\mathcal{L}(\theta) \qquad \mathfrak{su}(2) \qquad
\int f(x) \, \mathrm{d}x \qquad \mathbf{X}^{\mathsf{T}}

公式中的文字請使用 amsmath 的 \text{..},而不是數學字母樣式:\text 會保留字詞之間的空白。

公式中的文字

f(x) = \begin{cases} 1 & \text{if } x \ge 44, \\ 0 & \text{otherwise.} \end{cases}

數學樣式

\displaystyle、\textstyle、\scriptstyle 和 \scriptscriptstyle 會切換目前群組中其後所有內容的大小:例如,內文中的分數可以用獨立顯示的大小排出。

內文中以獨立顯示大小排出的分數

Compare $\frac{1}{2}$ with $\displaystyle\frac{1}{2}$ in the same line,
and a sum $\sum_{i=1}^{n} x_i$ with $\displaystyle\sum_{i=1}^{n} x_i$.

所有樣式指令

格狀表顯示每個指令套用在字母「Ab」上的結果。按下複製按鈕即可複製指令。

  • \displaystyle
  • \textstyle
  • \scriptstyle
  • \scriptscriptstyle
  • \bf
  • \rm
  • \it
  • \sf
  • \frak
  • \tt
  • \cal
  • \bold
  • \mathbf
  • \bm
  • \boldsymbol
  • \pmb
  • \mathrm
  • \mathit
  • \mathnormal
  • \mathsf
  • \mathfrak
  • \mathtt
  • \Bbb
  • \mathbb
  • \mathcal
  • \mathbin
  • \mathclose
  • \mathinner
  • \mathop
  • \mathopen
  • \mathord
  • \mathpunct
  • \mathrel
  • \Huge
  • \normalsize
  • \huge
  • \small
  • \footnotesize
  • \Large
  • \LARGE
  • \scriptsize
  • \large
  • \tiny

無法使用的功能

常見問題

怎麼在 LaTeX 中寫實數集 ℝ?

載入 amssymb 並寫 \mathbb{R}。ℕ、ℤ、ℚ 和 ℂ 也一樣,分別寫成 \mathbb{N}、\mathbb{Z}、\mathbb{Q} 和 \mathbb{C}。

為什麼 \mathbf 沒有讓我的希臘字母變粗?

在 LaTeX 中,\mathbf 只會改變拉丁字母、數字和大寫希臘字母。粗體的 α 請用 \boldsymbol{\alpha} 或 \bm{\alpha}。

怎麼把積分中的 d 寫成正體?

寫 \mathrm{d}x,並在前面加上細空白 \,:\int f(x)\,\mathrm{d}x。

本頁的每個範例都在建置網站時由 Scissor LaTeX 排版。 最後更新:2026-11-07