> 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/uk/baza-znan/122-preamble-organization.md).

# Організація преамбули

## Вступ

## Загальні ідеї

Основна ідея полягає в тому, щоб організувати преамбулу більш деталізовано: починайте з найзагальніших пакетів і налаштувань, а потім послідовно додавайте необхідні пакети й параметри до більш специфічних для проєкту, завершуючи макросами користувача. Це має три основні причини:

1. Це працює для залежностей; макроси користувача загалом залежать від завантажених пакетів. Математичні та інші пакети можуть залежати від завантажених шрифтів.
2. Найчастіше змінювані речі йдуть останніми, ближче до тіла документа.
3. Це допомагає тримати преамбулу добре організованою, а речі — легко знаходити й налаштовувати.

На жаль, із цим є винятки, оскільки існують пакети, для яких порядок завантаження справді має значення, див. [#Винятки з порядку завантаження пакетів](#package-loading-order-exceptions) для списку.

## Декілька прикладів

## Розміщення преамбули в окремому файлі

Можна розмістити преамбулу в окремому файлі. Є три основні способи:

* Перемістіть преамбулу до стандартного `.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/uk/baza-znan/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.
