粗體、斜體和其他文字樣式
把文字包在 \textbf{...} 中就是粗體,\emph{...} 或 \textit{...} 是斜體,\texttt{...} 是打字機字體。用 \underline{...} 加底線,用 ulem 套件的 \sout{...} 加刪除線。
粗體、斜體和打字機字體
每種樣式都是一個在大括號中接收文字的指令。樣式可以互相巢狀。
常見的文字樣式
This is \textbf{bold}, this is \emph{emphasised},
this is \textit{italic} and this is \texttt{typewriter}.
You can combine them: \textbf{\emph{bold italic}}.\emph 是在一般文字中表示強調時應該使用的指令。在斜體文字中,它會切換回直立字體,讓強調的部分仍然醒目。
斜體文字中的 \emph 會變成直立
\textit{The word \emph{not} is emphasised inside italic text.}| 指令 | 結果 | 在 Scissor LaTeX 中 |
|---|---|---|
\textbf{...}、{\bfseries ...} | 粗體 | 可用 |
\emph{...}、\textit{...}、{\itshape ...} | 斜體 | 可用 |
\textsl{...} | 傾斜體 | 以直立顯示:文字保留,傾斜不保留 |
\texttt{...}、{\ttfamily ...} | 打字機字體 | 可用 |
\textsc{...} | 小型大寫字母 | 在預設的 Latin Modern 字型中顯示為一般字母。搭配 helvet 以及在會議版面中(使用 Latin Modern 的 LNCS 除外),則是真正的小型大寫字母 |
\underline{...} | 底線 | 可用 |
\sout{...}、\xout{...}(ulem) | 刪除線 | 可用 |
\uline{...}(ulem) | 底線 | 可用 |
\uwave{...}(ulem) | 波浪底線 | 文字保留,沒有波浪線 |
\textsuperscript{...}、\textsubscript{...} | 上標、下標 | 可用 |
\textsf{...}、{\sffamily ...} | 無襯線體 | 文字保留,以襯線字型顯示 |
\textrm{...}、\textup{...}、\textmd{...}、\textnormal{...} | 一般文字 | 可用(在這裡不會改變任何東西) |
舊式的兩個字母寫法 {\bf ...}、{\it ...} 和 {\tt ...} 也能使用,但上面的指令比較清楚。
底線和刪除線
\underline 不需要套件就能使用。要加上刪除線,請載入 ulem 並使用 \sout。請以 \usepackage[normalem]{ulem} 載入它,這樣在 TeX 安裝環境中 \emph 也會維持斜體(沒有這個選項時,ulem 會讓 \emph 在那裡變成底線)。
底線和刪除線
\documentclass{article}
\usepackage[normalem]{ulem}
\begin{document}
Please \underline{sign here}. The price was
\sout{\$44} \$38. Footnote\textsuperscript{a} and H\textsubscript{2}O.
\end{document}字級
\tiny、\scriptsize、\footnotesize、\small、\large、\Large、\LARGE、\huge 和 \Huge 會改變後面文字的大小,直到所在群組或環境結束,和 LaTeX 中一樣。如果要自訂大小,請寫 \fontsize{30}{36}\selectfont:Scissor LaTeX 會使用 5 到 144 pt 之間最接近的常用大小,行距會跟著大小調整。
字級切換和 \fontsize
Normal text, {\small small text}, {\large large text}
and {\Huge huge text}.
{\fontsize{30}{36}\selectfont A 30 pt line for a poster.}如果要讓整份文件變大或變小,請使用類別選項:\documentclass[12pt]{article}。標題、文件標題和註腳本來就有各自的大小。會議和期刊版面保持自己的大小,並忽略這些切換指令。
無襯線文字
以無襯線體(\textsf)設定的單一字詞會以襯線字型顯示。不過,整份文件使用無襯線體是可以的:在導言區寫 \renewcommand{\familydefault}{\sfdefault},或以 \sffamily 開始內文。這樣文字就會以 Latin Modern Sans 排版。
整份文件使用無襯線體
\documentclass{article}
\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\section{Notice}
The library closes at 6 pm on Fridays.
\end{document}特殊字元
有十個字元在 LaTeX 中有特殊意義。其中七個只要在前面加上反斜線就能印出;另外三個則需要指令。
| 字元 | 寫法 | 字元 | 寫法 |
|---|---|---|---|
| # | \# | { | \{ |
| $ | \$ | } | \} |
| % | \% | ~ | \textasciitilde |
| & | \& | ^ | \textasciicircum |
| _ | \_ | \ | \textbackslash |
特殊字元
50\% of \$44 is \$22. Use \_ in file names like
\texttt{my\_file.tex}. A path: C:\textbackslash{}Users.
Braces \{ and \}, a tilde \textasciitilde{} and a caret \textasciicircum{}.重音符號和其他語言的字母
你可以直接輸入帶重音的字母,例如 é、ü 或 ñ:編輯器以 UTF-8 讀取原始碼。傳統的重音指令也可以使用。
重音指令和特殊字母
Caf\'e, na\"ive, \^ile, \`a la carte, Fran\c{c}ois,
\v{C}esk\'y, Erd\H{o}s, \ss, \ae, \o, \aa, \L\'od\'z.
Typed directly: café, naïve, Łódź, Straße.破折號、引號和省略號
| 寫法 | 結果 | 用途 |
|---|---|---|
- | - | 連字號:well-known |
-- | – | 短破折號:pages 4--44 |
--- | — | 長破折號:a break---like this |
`` 和 '' | “ 和 ” | 雙引號 |
` 和 ' | ‘ 和 ’ | 單引號 |
\dots 或 \ldots | … | 省略號 |
破折號、引號和省略號
Pages 4--44 of the report---the long version---say
``it works'' and `mostly'. To be continued\dots與 TeX 安裝環境的差異
這些指令在 TeX 安裝環境中也都能使用,所以在這裡看起來正確的文件,可以放心帶到其他地方。
ulem 套件的完整使用手冊,包含所有底線和刪除線指令,位於 ctan.org/pkg/ulem。
常見問題
怎麼在 LaTeX 中把文字設為粗體?
寫 \textbf{your text}。在編輯器中,你也可以選取文字後按 Ctrl+B(Mac 上為 Cmd+B)。
\emph 和 \textit 有什麼不同?
\textit 永遠產生斜體。\emph 則表示強調:在一般文字中是斜體,在斜體文字中則是直立。
怎麼在 LaTeX 中更改字級?
整份文件請使用類別選項,例如 \documentclass[12pt]{article}。部分文字請使用 {\large ...} 這類字級切換或 \fontsize{14}{17}\selectfont。
本頁的每個範例都在建置網站時由 Scissor LaTeX 排版。 最後更新:2026-11-07