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

# Kan jeg velge hvilken fil som er hoved-tex-filen i et prosjekt på Overleaf?

Ja, ved å følge disse trinnene:

1. Klikk på Overleaf-menykonet (![OLmenu.png](/files/f3f61f3d7ab6f02df68cd391e2c4c12c5671ff53)), som er plassert over fillisten.
2. I menyen finner du **Hoveddokument** alternativet og setter det til din foretrukne `.tex` filen:

   ![SettingMainTeX.png](/files/96102a78e9741c3c7433e89a86ead39547736133)
3. Dette vil sette filen som skal kompileres og forhåndsvises hver gang du går tilbake til prosjektet ditt.

**Merknader**:

* For å sikre at Overleaf-funksjonene fungerer riktig, anbefaler vi å plassere prosjektets hoved `.tex` fil i prosjektets toppnivåmappe. For eksempel inkluderer funksjoner som påvirkes [hopp-til-plassering](/latex/no/kunnskapsbase/022-can-t-find-jump-to-location-arrows.md), [ordtelling](/latex/no/kunnskapsbase/099-is-there-a-way-to-run-a-word-count-that-doesn-t-include-latex-commands.md) og skript som [makeglossaries](/latex/no/dokumentstruktur/05-glossaries.md) osv.,
* Enhver prosjektfil som inneholder en `\documentclass` kommando kan kompileres når den åpnes i editoren ved å velge **Rekompiler** knappen. Dette lar deg kompilere flere dokumenter i ett Overleaf-prosjekt uten å endre prosjektets innstilling for hovedfil.


---

# 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/no/kunnskapsbase/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.
