> 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/loi-latex/11-latex-error-mathrm-allowed-only-in-math-mode.md).

# Lỗi LaTeX: \mathrm chỉ được phép trong chế độ toán

Lỗi này xuất hiện khi chúng ta dùng một phông chữ ở chế độ văn bản mà chỉ được phép dùng ở chế độ toán học. Khi sử dụng các phông chữ như vậy, hãy đảm bảo đặt chúng bên trong dấu đô la như `$...$`. Để tìm hiểu thêm về các phông chữ toán học, bạn có thể xem [tài liệu](/latex/vi/toan-hoc/12-mathematical-fonts.md). Danh sách các phông chữ như vậy, cùng với các gói tương ứng của chúng, được hiển thị bên dưới

|                  |                                                                                                                                                                                                                                                         |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \mathnormal{...} | Đây là phông chữ nghiêng tiêu chuẩn trong chế độ toán học. `$\mathnormal{Hello world}$` sẽ cho cùng một kết quả như `$Hello world$`.                                                                                                                    |
| \mathrm{...}     | Đây là phông chữ Roman văn bản tiêu chuẩn.                                                                                                                                                                                                              |
| \mathbf{...}     | Điều này tạo ra các chữ đậm ở chế độ toán học.                                                                                                                                                                                                          |
| \mathcal{...}    | Đây là một phông chữ kiểu thư pháp đặc biệt trong chế độ toán học. Nó chỉ có thể dùng cho chữ in hoa, chẳng hạn để ký hiệu các số thực. `\mathcal{R}` sẽ cho ra ℝ.                                                                                      |
| \mathsf{...}     | Điều này tạo ra các chữ sans-serif ở chế độ toán học.                                                                                                                                                                                                   |
| \mathit{...}     | Điều này sẽ tạo ra các chữ nghiêng kiểu văn bản. Chúng có thể khác với các chữ nghiêng toán học tùy theo lớp cụ thể được dùng.                                                                                                                          |
| \mathtt{...}     | Điều này tạo ra các chữ đứng thẳng từ kiểu phông máy đánh chữ được dùng.                                                                                                                                                                                |
| \mathbb{...}     | Điều này cung cấp một phông chữ "đậm bảng đen" cho các chữ in hoa. Gói [**`amsfonts`**](https://www.ctan.org/pkg/amsfonts?lang=en) hoặc tương đương, gói [**`amssymb`**](https://www.ctan.org/pkg/amssymb?lang=en) phải được nạp để dùng phông chữ này. |
| \mathfrak{...}   | Điều này cung cấp các chữ Gothic ở cả dạng in hoa và in thường. Gói [**`amsfonts`**](https://www.ctan.org/pkg/amsfonts?lang=en) hoặc tương đương, gói [**`amssymb`**](https://www.ctan.org/pkg/amssymb?lang=en) phải được nạp để dùng phông chữ này.    |
| euscript         | Tính năng [**`euscript`**](http://tug.ctan.org/fonts/amsfonts/doc/euscript.pdf) cung cấp cho chúng ta một bảng chữ thư pháp khác gọi là Euler script.                                                                                                   |

**Các tương đương ở chế độ văn bản của các phông chữ toán học trên:**

| Phông chữ chế độ toán học | Tương đương văn bản                              |
| ------------------------- | ------------------------------------------------ |
| \mathnormal{...}          | \textit{...}.                                    |
| \mathrm{...}              | \text{...}                                       |
| \mathbf{...}              | \textbf{...}.                                    |
| \mathcal{...}             | Không có phông chữ tương đương ở chế độ văn bản. |
| \mathsf{...}              | \textsf{...}.                                    |


---

# 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/loi-latex/11-latex-error-mathrm-allowed-only-in-math-mode.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.
