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

# Kan jag välja vilken fil som är huvud-texfilen i ett projekt i Overleaf?

Ja, genom att följa dessa steg:

1. Klicka på Overleaf-menyns ikon (![OLmenu.png](/files/e195529c64b998fe25bbf036cb6079b13740aa61)), som finns ovanför fillistan.
2. I menyn, leta reda på **Huvuddokument** alternativet och ställ in det på din önskade `.tex` fil:

   ![SettingMainTeX.png](/files/6b4c0b044a06e4d06833cfc02739416df8d5e426)
3. Detta ställer in filen som ska kompileras och förhandsvisas varje gång du återvänder till ditt projekt.

**Anteckningar**:

* För att säkerställa att Overleaf-funktionerna fungerar korrekt rekommenderar vi att du placerar projektets huvud `.tex` fil i projektets rotmapp. Exempel på funktioner som påverkas är [hoppa-till-plats](/latex/sv/kunskapsbas/022-can-t-find-jump-to-location-arrows.md), [ordräkning](/latex/sv/kunskapsbas/099-is-there-a-way-to-run-a-word-count-that-doesn-t-include-latex-commands.md) och skript som [makeglossaries](/latex/sv/dokumentstruktur/05-glossaries.md) osv,
* Alla projektfiler som innehåller ett `\documentclass` kommando kan kompileras när den öppnas i editorn genom att välja **Återkompilera** knappen. Detta gör att du kan kompilera flera dokument i ett och samma Overleaf-projekt utan att ändra inställningen för projektets huvudfil.


---

# 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/sv/kunskapsbas/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.
