> 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/vi/phong-chu/02-font-typefaces.md).

# Kiểu chữ

## Giới thiệu

Theo mặc định, LaTeX dàn trang tài liệu bằng $$\text{Computer Modern}$$ họ kiểu chữ, nhưng bạn có thể dùng các gói LaTeX để sử dụng các phông chữ khác nhau theo nhu cầu hoặc sở thích của mình.

## Thay đổi phông chữ mặc định của tài liệu

Ví dụ, bằng cách thêm `\usepackage{tgbonum}` vào phần tiền đề của tài liệu, LaTeX sẽ dùng họ phông TEX Gyre Bonum để dàn trang tài liệu của bạn:

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

\begin{document}
Tài liệu này là một tài liệu mẫu để kiểm tra phông
các họ phông và kiểu chữ.

Đoạn văn bản này sử dụng một kiểu chữ khác
\end{document}
```

[Mở ví dụ này trong 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)

Hình sau cho thấy kết quả được tạo ra bởi ví dụ ở trên:

![FontTypefacesEx1OLV2.png](/files/78268923f2a712898f5b82db05bbe20d2eb5828c)

## Thay đổi kiểu chữ phông mặc định

Phông chữ cũng có thể được thay đổi cho một phần tử cụ thể trong tài liệu.

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

\begin{document}
Tài liệu này là một tài liệu mẫu để
kiểm tra các họ phông và kiểu chữ.

{\fontfamily{qcr}\selectfont
Đoạn văn bản này sử dụng một kiểu chữ khác
}
\end{document}
```

[Mở ví dụ này trong 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)

Hình sau cho thấy kết quả được tạo ra bởi ví dụ ở trên:

![FontTypefacesEx2.png](/files/7fc5ee101c1e384b313dd7c94827dfd437c2c3f8)

Lệnh `\fontfamily{qcr}\selectfont` sẽ đặt *TeX Gyre Cursor* kiểu chữ phông, có mã phông là `qcr`, cho đoạn văn bản bên trong dấu ngoặc nhọn. Còn rất nhiều kiểu chữ phông LaTeX khác có sẵn, xem [hướng dẫn tham khảo](#reference-guide).

Các kiểu chữ phông LaTeX phổ biến bắt nguồn từ bốn họ:

* *Computer Modern* (mặc định trong các lớp LaTeX chuẩn): CM Roman, CM Sans Serif, CM Typewriter
* *Latin Modern*: LM Roman, LM Sans Serif, LM Typewriter, LM Dunhill
* *Phông chữ PostScript*: Times, Utopia/Fourier, Palatino, Bookman, Helvetica, Courier
* *TeX Gyre*

## Hướng dẫn tham khảo

**kiểu chữ Roman, Sans Serif và Typewriter**

| Phông                        | "tên gói phông"      | "mã phông" | Ví dụ                                                                 |
| ---------------------------- | -------------------- | ---------- | --------------------------------------------------------------------- |
| Computer Modern Roman        |                      | `cmr`      | ![Typeface-cmr.png](/files/43f150a31e07af4c389fb715bc6c141cf809a484)  |
| Latin Modern Roman           | `lmodern`            | `lmr`      | ![Typeface-lmr.png](/files/7d2328d599a407f9946d82a9cedc44c116f973af)  |
| Latin Modern Dunhill         | `lmodern`            | `lmdh`     | ![Typeface-lmdh.png](/files/70fea1303120827f8c137325114186e4b029a31b) |
| TeX Gyre Termes              | `tgtermes`           | `qtm`      | ![Typeface-qtm.png](/files/18845d2b1769f4772580d85808bc0ec836447586)  |
| TeX Gyre Pagella             | `tgpagella`          | `qpl`      | ![Typeface-qpl.png](/files/3bf6654d5ce290bf0bd8f2bf2d548d25902aab0d)  |
| TeX Gyre Bonum               | `tgbonum`            | `qbk`      | ![Typeface-qbk.png](/files/f94392ebd4e121582d2eb96e60be66d5f10e9fa9)  |
| TeX Gyre Schola              | `tgschola`           | `qcs`      | ![Typeface-qsc.png](/files/0e7d9e07c26010482b87a9a4db7801e5ab473b71)  |
| Times                        | `mathptmx`           | `ptm`      | ![Typeface-ptm.png](/files/69325a75dc4ae5bc34af384e0c96abb3c055b6d8)  |
| Utopia / Fourier             | `utopia` / `fourier` | `put`      | ![Typeface-put.png](/files/3cde329effb8a8cff654d8532f5b77a0883d4e1e)  |
| Palatino                     | `palatino`           | `ppl`      | ![Typeface-ppl.png](/files/64bc00905efc35efa8c209bc193bbc196c5e1f54)  |
| Bookman                      | `bookman`            | `pbk`      | ![Typeface-pbk.png](/files/b4734000c02f39a88e71c5b9382ff82a87a3759e)  |
| Charter                      | `charter`            | `bch`      | ![Typeface-bch.png](/files/33c7bd5431140c417b54076eb95c6c25146cc217)  |
| Computer Modern Sans Serif   |                      | `cmss`     | ![Typeface-cmss.png](/files/d8c2984824e4909e06b658a9e2ce37f50489fd2c) |
| Latin Modern Sans Serif      | `lmodern`            | `lmss`     | ![Typeface-lmss.png](/files/d0320e15f8457f0947ddf7e48cf3fa94b821150c) |
| TeX Gyre Adventor            | `tgadventor`         | `qag`      | ![Typeface-qag.png](/files/82c988e4220850ad3b78e718d082da76ffc79a51)  |
| TeX Gyre Heros               | `tgheros`            | `qhv`      | ![Typeface-qhv.png](/files/400bcff06d8fafcebe8e2bcf9cfa6b8e6d73ddd5)  |
| Helvetica                    | `helvet`             | `phv`      | ![Typeface-phv.png](/files/5dab2f11603343fd7a674ab2c472ed816b44b46e)  |
| Computer Modern Typewriter   |                      | `cmtt`     | ![Typeface-cmtt.png](/files/a38d94f021d762c2b18f5301196b30b456d723e3) |
| Latin Modern Sans Typewriter | `lmodern`            | `lmtt`     | ![Typeface-lmtt.png](/files/e6353b7eeedf66aef360047a2b97ad033e9071db) |
| TeX Gyre Cursor              | `tgcursor`           | `qcr`      | ![Typeface-qcr.png](/files/19c48e6e6df6b928579c88a66e38de21ad64ae38)  |
| Courier                      | `courier`            | `pcr`      | ![Typeface-pcr.png](/files/fe0634e0ba29c1c2a5ac7fbb428f8f3772179f2b)  |

Xem thêm [Danh mục phông chữ LaTeX](https://tug.org/FontCatalogue/), tuy nhiên lưu ý rằng không phải tất cả các phông được liệt kê trong danh mục đều được phân phối kèm giấy phép cho phép chúng được phân phối như một phần của TeX Live, và do đó không phải tất cả những phông đó đều có sẵn trên Overleaf.

## Đọc thêm

Để biết thêm thông tin, xem:

* [Danh mục phông chữ LaTeX](https://tug.org/FontCatalogue/).
* [In đậm, in nghiêng và gạch chân](/latex/vi/kien-thuc-co-ban-ve-latex/03-bold-italics-and-underlining.md)
* [Kích thước phông chữ, họ phông và kiểu chữ](/latex/vi/phong-chu/01-font-sizes-families-and-styles.md)
* [Hỗ trợ phông chữ hiện đại với XeLaTeX](/latex/vi/phong-chu/03-xelatex.md)
* [Định dạng đoạn văn](/latex/vi/dinh-dang/04-articles-how-to-change-paragraph-spacing-in-latex.md)
* [Ngắt dòng và khoảng trắng](/latex/vi/dinh-dang/05-line-breaks-and-blank-spaces.md)
* [Nhiều cột](/latex/vi/dinh-dang/09-multiple-columns.md)
* [Tài liệu một mặt và hai mặt](/latex/vi/dinh-dang/08-single-sided-and-double-sided-documents.md)
* [Quản lý trong một dự án lớn](/latex/vi/cau-truc-tai-lieu/07-management-in-a-large-project.md)
* [Các dự án LaTeX nhiều tệp](/latex/vi/cau-truc-tai-lieu/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/vi/phong-chu/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.
