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

# LaTeXエラー：\mathrm は数式モードでのみ使用できます

このエラーは、テキストモードで使用したフォントが数式モードでのみ使用できる場合に表示されます。このようなフォントを使うときは、ドル記号で囲んで次のように含めてください `$...$`。数式フォントについて詳しく知りたい場合は、ぜひ当社の [ドキュメント](/latex/ja/shu-xue/12-mathematical-fonts.md)。そのようなフォントの一覧と対応するパッケージを以下に示します

|                  |                                                                                                                                                                                         |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \mathnormal{...} | これは、数式モードの標準イタリック体フォントです。 `$\mathnormal{Hello world}$` は、同じ結果になります `$Hello world$`.                                                                                                     |
| \mathrm{...}     | これは、標準のテキスト用ローマン体フォントです。                                                                                                                                                                |
| \mathbf{...}     | これにより、数式モードで太字の文字が表示されます。                                                                                                                                                               |
| \mathcal{...}    | これは数式モード用の特別な筆記体フォントです。実数を表すなど、大文字にのみ使用できます。 `\mathcal{R}` は ℝ になります。                                                                                                                   |
| \mathsf{...}     | これにより、数式モードでサンセリフ体の文字が表示されます。                                                                                                                                                           |
| \mathit{...}     | これにより、テキストのイタリック体文字が得られます。使用するクラスによっては、数式のイタリック体文字とは異なる場合があります。                                                                                                                         |
| \mathtt{...}     | これにより、使用されるタイプライター体フォントの立体文字が表示されます。                                                                                                                                                    |
| \mathbb{...}     | これは大文字用の「ブラックボード・ボールド」フォントを提供します。 [**`amsfonts`**](https://www.ctan.org/pkg/amsfonts?lang=en) パッケージ、または同等の [**`amssymb`**](https://www.ctan.org/pkg/amssymb?lang=en) パッケージを読み込む必要があります。 |
| \mathfrak{...}   | これは、大文字と小文字の両方のゴシック文字を提供します。 [**`amsfonts`**](https://www.ctan.org/pkg/amsfonts?lang=en) パッケージ、または同等の [**`amssymb`**](https://www.ctan.org/pkg/amssymb?lang=en) パッケージを読み込む必要があります。      |
| euscript         | この [**`euscript`**](http://tug.ctan.org/fonts/amsfonts/doc/euscript.pdf) パッケージは、Euler script と呼ばれる別の筆記体アルファベットを提供します。                                                                   |

**上記の数式フォントに対応するテキスト版：**

| 数式モードのフォント       | テキストでの対応               |
| ---------------- | ---------------------- |
| \mathnormal{...} | \textit{...}。          |
| \mathrm{...}     | \text{...}             |
| \mathbf{...}     | \textbf{...}。          |
| \mathcal{...}    | 対応するテキストモードフォントはありません。 |
| \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/ja/latexer/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.
