> 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/14-latex-error-environment-xxx-undefined.md).

# LaTeXエラー: 環境XXXが未定義です

LaTeX が認識しない環境を使おうとすると、以下のようなエラーメッセージが表示されます:

main.tex、5行目

LaTeX エラー: 環境 equation\* は未定義です。

説明は LaTeX マニュアルまたは LaTeX Companion を参照してください。すぐにヘルプを表示するには H を入力してください。... l.5 \begin{equation\*} あなたのコマンドは無視されました。I を入力して別のコマンドに置き換えるか、そのまま続行してください。

## 一般的な原因

**パッケージの読み込みを忘れています**

このエラーの一般的な原因は、特定のパッケージに含まれる環境を使おうとしているのに、プリアンブルでそのパッケージの読み込みを忘れている場合です。その一例が **`align`** 環境です。 **`align`** 環境は、〜の一部として含まれています。 **`amsmath`** パッケージです。したがって、その環境を使用するたびに **`align`** 環境を使うときは、必ず含める必要があります **`\usepackage{amsmath}`** 以下に示すようにプリアンブルに含めてください:

```latex
% プリアンブル内

\usepackage{amsmath}

% メインの .tex ファイル内

\begin{align}
2x + 3y &= 7\\
5x - 2y &= 2
\end{align}
```

![Align.PNG](/files/7cf5cc7f5026bfeb7ebf40342d03fc29bfc7ffe2)

含めない場合、 **`\usepackage{amsmath}`** プリアンブルに含めなければ、エラーメッセージが表示されます。

**環境名の綴りが間違っています:**

このエラーの別の一般的な例は、環境名が正しく綴られている場合です。以下にこの間違いの例を示します:

```latex
\begin{lisQ}
    \item これはリスト項目です
    \item これは別のリスト項目です
\end{lisQ}
```

ここにエラーが表示されます。というのも、 **`list`** 環境名が誤って次のように書かれているためです **`lisQ`**。これを修正するには、特定の環境を呼び出すたびに綴りを確認するだけです。

**そのような環境は存在しません**

このエラーが発生するもう一つのケースは、存在しない環境を使用しようとした場合です。LaTeX で使用できる環境や、自分で作成する方法について詳しくは、弊社の [ドキュメント](/latex/ja/komando/02-environments.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/ja/latexer/14-latex-error-environment-xxx-undefined.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.
