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

# Mohu si v projektu na Overleafu zvolit, který soubor je hlavní .tex soubor?

Ano, postupujte podle těchto kroků:

1. Klikněte na ikonu nabídky Overleaf (![OLmenu.png](/files/1e615007ff476d6a7aa553651c4974b1f326fbce)), která se nachází nad seznamem souborů.
2. V nabídce najděte **Hlavní dokument** možnost a nastavte ji na preferovanou `.tex` souboru následující řádek:

   ![SettingMainTeX.png](/files/43fdfa6dd9135fc08030008ec1ab912cbcf63a63)
3. Tím se soubor nastaví jako ten, který se bude při každém návratu do projektu kompilovat a zobrazovat v náhledu.

**Poznámky**:

* Aby funkce Overleaf fungovaly správně, doporučujeme umístit hlavní `.tex` soubor projektu do kořenové složky projektu. Například mezi ovlivněné funkce patří [jump-to-location](/latex/cs/znalostni-baze/022-can-t-find-jump-to-location-arrows.md), [počet slov](/latex/cs/znalostni-baze/099-is-there-a-way-to-run-a-word-count-that-doesn-t-include-latex-commands.md) a skripty jako [makeglossaries](/latex/cs/struktura-dokumentu/05-glossaries.md) atd.
* Jakýkoli soubor projektu, který obsahuje `\documentclass` příkaz, lze po otevření v editoru zkompilovat výběrem tlačítka **Překompilovat** . To vám umožní kompilovat více dokumentů v jednom projektu Overleaf, aniž byste museli měnit nastavení hlavního souboru projektu.


---

# 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/cs/znalostni-baze/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.
