> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/latex/zh-tw/zi-xing/02-font-typefaces.md).

# 字型樣式

## 簡介

預設情況下，LaTeX 會使用 $$\text{Computer Modern}$$ 字型家族來排版文件，但你可以根據需求或偏好使用 LaTeX 套件來採用不同的字型。

## 變更預設文件字型

例如，加入 `\usepackage{tgbonum}` 到文件導言區後，LaTeX 便會使用 TEX Gyre Bonum 字型家族來排版你的文件：

```latex
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tgbonum}

\begin{document}
這份文件是一份用於測試字型
家族與字型樣式的範例文件。

這段文字使用了不同的字型樣式
\end{document}
```

[在 Overleaf 中開啟此範例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Change+LaTeX+fonts\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5BT1%5D%7Bfontenc%7D%0A%5Cusepackage%7Btgbonum%7D%0A%0A%5Cbegin%7Bdocument%7D%0AThis+document+is+a+sample+document+to+test+font+%0Afamilies+and+font+typefaces.%0A%0AThis+text+uses+a+different+font+typeface%0A%5Cend%7Bdocument%7D)

下圖顯示了上述範例產生的輸出：

![FontTypefacesEx1OLV2.png](/files/b8bbcda725fd9aadc548d778ffc34a6abef4393f)

## 變更預設字型樣式

文件中的特定元素也可以變更字型。

```latex
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{tgbonum}

\begin{document}
這份文件是一份用於
測試字型家族與字型樣式的範例文件。

{\fontfamily{qcr}\selectfont
這段文字使用了不同的字型樣式
}
\end{document}
```

[在 Overleaf 中開啟此範例](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=Change+LaTeX+fonts\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%5BT1%5D%7Bfontenc%7D%0A%5Cusepackage%7Btgbonum%7D%0A%0A%5Cbegin%7Bdocument%7D%0AThis+document+is+a+sample+document+to+%0Atest+font+families+and+font+typefaces.%0A%0A%7B%5Cfontfamily%7Bqcr%7D%5Cselectfont%0AThis+text+uses+a+different+font+typeface%0A%7D%0A%5Cend%7Bdocument%7D)

下圖顯示了上述範例產生的輸出：

![FontTypefacesEx2.png](/files/a772bfcc61df59e1cc6779827e7088798e3b5e7d)

指令 `\fontfamily{qcr}\selectfont` 將會設定 *TeX Gyre Cursor* 字型樣式，其字型代碼為 `qcr`，用於大括號內的文字。還有更多 LaTeX 字型樣式可供使用，請參見 [參考指南](#reference-guide).

常見的 LaTeX 字型樣式源自四個家族：

* *Computer Modern* （標準 LaTeX 類別中的預設值）：CM Roman、CM Sans Serif、CM Typewriter
* *Latin Modern*：LM Roman、LM Sans Serif、LM Typewriter、LM Dunhill
* *Post Script 字型*：Times、Utopia/Fourier、Palatino、Bookman、Helvetica、Courier
* *TeX Gyre*

## 參考指南

**羅馬體、無襯線與打字機體字型樣式**

| 字型                           | 「字型套件名稱」             | 「字型代碼」 | 範例                                                                    |
| ---------------------------- | -------------------- | ------ | --------------------------------------------------------------------- |
| Computer Modern Roman        |                      | `cmr`  | ![Typeface-cmr.png](/files/a2870f58679aff7c264266c529c143cc945dfaed)  |
| Latin Modern Roman           | `lmodern`            | `lmr`  | ![Typeface-lmr.png](/files/4d12825927823fe826a1301e5324ad680a096d4a)  |
| Latin Modern Dunhill         | `lmodern`            | `lmdh` | ![Typeface-lmdh.png](/files/e1d42552c75cb4c50463091c8e8132107af59ace) |
| TeX Gyre Termes              | `tgtermes`           | `qtm`  | ![Typeface-qtm.png](/files/6048693c5c98a3d6ff366753f60e4935b2240536)  |
| TeX Gyre Pagella             | `tgpagella`          | `qpl`  | ![Typeface-qpl.png](/files/03f6b8f4e83a9eb1094bd1c15b30ed21d08d2417)  |
| TeX Gyre Bonum               | `tgbonum`            | `qbk`  | ![Typeface-qbk.png](/files/ffa7351b384b6d204ed5e71796d51a7d5bf64311)  |
| TeX Gyre Schola              | `tgschola`           | `qcs`  | ![Typeface-qsc.png](/files/861848d2bf57d3cdc007fabed768d249282e53be)  |
| Times                        | `mathptmx`           | `ptm`  | ![Typeface-ptm.png](/files/627fa27aba0affaba92163a3fcd303352496753e)  |
| Utopia / Fourier             | `utopia` / `fourier` | `put`  | ![Typeface-put.png](/files/6506d7ba31f03b0c0157efd7d5efdbc3411aba7b)  |
| Palatino                     | `palatino`           | `ppl`  | ![Typeface-ppl.png](/files/cafd93a9731f9d0fad1fcd4272c9142abccffe6b)  |
| Bookman                      | `bookman`            | `pbk`  | ![Typeface-pbk.png](/files/cfdc0104241844a71173baef72ea531c4ffaea6f)  |
| Charter                      | `charter`            | `bch`  | ![Typeface-bch.png](/files/e84702926c5bc141466254926cd186d84568f255)  |
| Computer Modern Sans Serif   |                      | `cmss` | ![Typeface-cmss.png](/files/a2cff83adace5f4f1be7330ae5360e0fbda8556f) |
| Latin Modern Sans Serif      | `lmodern`            | `lmss` | ![Typeface-lmss.png](/files/0f65a4077cc3938876c5695048457e02f39baad3) |
| TeX Gyre Adventor            | `tgadventor`         | `qag`  | ![Typeface-qag.png](/files/2107cf2ec181fd4d5dddf1ba94352cbde042187c)  |
| TeX Gyre Heros               | `tgheros`            | `qhv`  | ![Typeface-qhv.png](/files/4a5b1f6f711f35bef71a589109c7d59d362d7d16)  |
| Helvetica                    | `helvet`             | `phv`  | ![Typeface-phv.png](/files/ba82ac537c6b936563deb2611d2e1649e10683aa)  |
| Computer Modern Typewriter   |                      | `cmtt` | ![Typeface-cmtt.png](/files/7e3d43ef08125e696bebd92a4ecf2fe18673d8fc) |
| Latin Modern Sans Typewriter | `lmodern`            | `lmtt` | ![Typeface-lmtt.png](/files/147d3c220d34ffb4a221797ab6e6e424cd17a3d5) |
| TeX Gyre Cursor              | `tgcursor`           | `qcr`  | ![Typeface-qcr.png](/files/2e7cd648d9e447def982028acf16e08458bb8bdc)  |
| Courier                      | `courier`            | `pcr`  | ![Typeface-pcr.png](/files/baacf40758251dadb6451055310b486c7def9dfb)  |

另請參閱 [LaTeX 字型目錄](https://tug.org/FontCatalogue/)，但請注意，目錄中列出的字型並非全部都以允許作為 TeX Live 一部分散佈的授權發行，因此並非所有這些字型都可在 Overleaf 上使用。

## 延伸閱讀

更多資訊請參見：

* [LaTeX 字型目錄](https://tug.org/FontCatalogue/).
* [粗體、斜體與底線](/latex/zh-tw/latex-ji-chu/03-bold-italics-and-underlining.md)
* [字型大小、字族與樣式](/latex/zh-tw/zi-xing/01-font-sizes-families-and-styles.md)
* [使用 XeLaTeX 支援現代字型](/latex/zh-tw/zi-xing/03-xelatex.md)
* [段落格式](/latex/zh-tw/ge-shi-hua/04-articles-how-to-change-paragraph-spacing-in-latex.md)
* [換行與空白](/latex/zh-tw/ge-shi-hua/05-line-breaks-and-blank-spaces.md)
* [多欄](/latex/zh-tw/ge-shi-hua/09-multiple-columns.md)
* [單面與雙面文件](/latex/zh-tw/ge-shi-hua/08-single-sided-and-double-sided-documents.md)
* [大型專案中的管理](/latex/zh-tw/wen-jian-jie-gou/07-management-in-a-large-project.md)
* [多檔案 LaTeX 專案](/latex/zh-tw/wen-jian-jie-gou/08-multi-file-latex-projects.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/latex/zh-tw/zi-xing/02-font-typefaces.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
