> 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/narejjibsu/122-preamble-organization.md).

# プリアンブルの構成

## はじめに

## 一般的な考え方

基本的な考え方は、プリアンブルを細かい粒度で整理することです。最も一般的なパッケージや設定から始め、必要なパッケージや設定をよりプロジェクト固有のものへと順に並べ、最後にユーザーマクロを置きます。これには主に3つの理由があります:

1. これは依存関係にも当てはまります。一般にユーザーマクロは読み込まれたパッケージに依存します。数式用パッケージやその他のパッケージは、読み込まれたフォントに依存することがあります。
2. 最も頻繁に変わるものを最後に置くことで、文書本体に最も近くなります。
3. これにより、プリアンブルをきちんと整理し、必要なものを見つけたり調整したりしやすくなります。

残念ながら、読み込み順が重要なパッケージもあるため、例外があります。 [#パッケージ読み込み順の例外](#package-loading-order-exceptions) 一覧について。

## いくつかの例

## プリアンブルを別ファイルに分ける

プリアンブルを別ファイルに置くこともできます。基本的な方法は3つあります:

* プリアンブルを標準的な `.tex` そして `\input{...}`.
* すべてをユーザーパッケージにまとめ、 `\usepackage{...}`.
* すべてをユーザークラスにまとめ、 `\documentclass{...}`.

どちらの場合でも、常に `\documentclass{...}` メインファイルに入れ、メインファイルをプロジェクトの最上位フォルダに置いておくことが望ましいです。

## パッケージ読み込み順の例外

いくつかのパッケージでは読み込み順が重要なため、前に示した一般的な考え方に従えません。


---

# 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/narejjibsu/122-preamble-organization.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.
