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

# Понимание пакетов и файлов классов

Форматирование по умолчанию в документах LaTeX определяется **классом** используемым этим документом. Этот внешний вид по умолчанию можно изменить, а дополнительные возможности можно добавить с помощью **пакет**. Имена файлов классов имеют **.cls** расширение, а имена файлов пакетов имеют **.sty** расширение.

## Разница между классами и пакетами

Иногда бывает трудно принять решение, когда нужно выбрать, писать пакет или класс. Основное правило таково: если ваш файл содержит команды, которые управляют внешним видом логической структуры особого типа документа, то это класс. В противном случае, если ваш файл добавляет возможности, не зависящие от типа документа, то есть может использоваться в книгах, отчётах, статьях и так далее; тогда это пакет.

Например, если компании нужны фирменные отчёты, использующие особый шрифт и содержащие логотип компании в нижнем колонтитуле; вам нужен новый класс.

Если компании нужна новая команда, которая облегчает выделение важных предложений внутри документа, в этом случае подойдёт новый пакет.

## Дополнительное чтение

Для получения дополнительной информации см.

* [Создание собственного пакета](/latex/ru/faily-klassov/03-writing-your-own-package.md)
* [Создание собственного класса](/latex/ru/faily-klassov/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/ru/faily-klassov/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.
