> 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/006-can-i-choose-which-file-is-the-main-tex-file-in-a-project-on-overleaf.md).

# Чи можу я вибрати, який файл є основним tex-файлом у проєкті в Overleaf?

Так, виконавши такі кроки:

1. Натисніть на значок меню Overleaf (![OLmenu.png](/files/66c881cad4025f0fa9c140488779034713de2eb5)), розташований над списком файлів.
2. У меню знайдіть **Основний документ** параметр і встановіть його на бажаний `.tex` файлу такий рядок:

   ![SettingMainTeX.png](/files/0c15aeb511b5be512afbc7b604d0340bc9230ddd)
3. Це налаштує файл, який буде компілюватися й переглядатися щоразу, коли ви повертаєтеся до свого проєкту.

**Примітки**:

* Щоб переконатися, що функції Overleaf працюють коректно, ми рекомендуємо розміщувати головний `.tex` файл проєкту в папці верхнього рівня проєкту. Наприклад, серед функцій, на які це впливає, є [перехід до місця](/latex/uk/baza-znan/022-can-t-find-jump-to-location-arrows.md), [підрахунок слів](/latex/uk/baza-znan/099-is-there-a-way-to-run-a-word-count-that-doesn-t-include-latex-commands.md) та скрипти, як-от [makeglossaries](/latex/uk/struktura-dokumenta/05-glossaries.md) тощо,
* Будь-який файл проєкту, який містить `\documentclass` команду, можна скомпілювати під час відкриття в редакторі, вибравши **Перекомпіляція** кнопку. Це дає змогу компілювати кілька документів в одному проєкті Overleaf, не змінюючи налаштування головного файла проєкту.


---

# 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/006-can-i-choose-which-file-is-the-main-tex-file-in-a-project-on-overleaf.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.
