> 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/kurasufairu/01-understanding-packages-and-class-files.md).

# パッケージとクラスファイルの理解

LaTeX文書の既定の書式設定は、 **クラス** その文書で使用されます。この既定の外観は変更でき、さらに機能を追加するには、 **パッケージを**。クラスファイル名には **.cls** 拡張子があり、パッケージファイル名には **.sty** 拡張子があります。

## クラスとパッケージの違い

パッケージを書くべきかクラスを書くべきかを選ぶとき、判断が難しいことがあります。基本的なルールとして、ファイルに特定の種類の文書の論理構造の見た目を制御するコマンドが含まれているなら、それはクラスです。そうでなく、文書の種類に依存しない機能、つまり本、レポート、記事などで使える機能を追加するなら、それはパッケージです。

たとえば、ある会社が、特別なフォントを使い、フッターに会社のロゴが入ったブランド付きレポートを必要としている場合、新しいクラスが必要です。

その会社が、文書内の重要な文を強調表示しやすくする新しいコマンドを必要としているなら、この場合は新しいパッケージで対応できます。

## さらに読む

詳細は

* [独自のパッケージを書く](/latex/ja/kurasufairu/03-writing-your-own-package.md)
* [独自のクラスを書く](/latex/ja/kurasufairu/04-writing-your-own-class.md)
* [クラスおよびパッケージ作成者のための LaTeX2ε](http://www.latex-project.org/guides/clsguide.pdf)


---

# 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/kurasufairu/01-understanding-packages-and-class-files.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.
