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

# Kann ich wählen, welche Datei die Haupt-tex-Datei in einem Projekt auf Overleaf ist?

Ja, indem Sie diese Schritte befolgen:

1. Klicken Sie auf das Overleaf-Menüsymbol (![OLmenu.png](/files/7b68ef3c2c4317c2fd57e8e1d17cee6e810159d5)), das sich über der Dateiliste befindet.
2. Suchen Sie im Menü die **Hauptdokument** Option und stellen Sie sie auf Ihre bevorzugte `.tex` Datei legen:

   ![SettingMainTeX.png](/files/217ba9306b14d436f2c00d18ca4b73d63a524da0)
3. Dadurch wird die Datei festgelegt, die jedes Mal kompiliert und in der Vorschau angezeigt wird, wenn Sie zu Ihrem Projekt zurückkehren.

**Hinweise**:

* Um sicherzustellen, dass die Overleaf-Funktionen korrekt funktionieren, empfehlen wir, die Haupt- `.tex` Datei des Projekts im obersten Ordner des Projekts abzulegen. Zu den betroffenen Funktionen gehören beispielsweise [Sprung zur Position](/latex/de/wissensdatenbank/022-can-t-find-jump-to-location-arrows.md), [Wortzählung](/latex/de/wissensdatenbank/099-is-there-a-way-to-run-a-word-count-that-doesn-t-include-latex-commands.md) und Skripte wie [makeglossaries](/latex/de/dokumentstruktur/05-glossaries.md) usw.,
* Jede Projektdatei, die einen `\documentclass` Befehl enthält, kann kompiliert werden, wenn sie im Editor geöffnet wird, indem die **Neu kompilieren** Schaltfläche ausgewählt wird. Dadurch können Sie mehrere Dokumente innerhalb eines Overleaf-Projekts kompilieren, ohne die Einstellung der Hauptdatei des Projekts zu ändern.


---

# 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/de/wissensdatenbank/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.
