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

# Puis-je choisir quel fichier est le fichier tex principal d’un projet sur Overleaf ?

Oui, en suivant ces étapes :

1. Cliquez sur l’icône de menu Overleaf (![OLmenu.png](/files/606cb3df16b956f60210039b1ead1fd02b637f06)), située au-dessus de la liste des fichiers.
2. Dans le menu, repérez le **Document principal** option et définissez-la sur votre `.tex` fichier :

   ![SettingMainTeX.png](/files/4a752ba799ad56af1c676002df2e7065e7211f1a)
3. Cela définira le fichier à compiler et à prévisualiser chaque fois que vous revenez à votre projet.

**Remarques**:

* Pour garantir le bon fonctionnement des fonctionnalités d’Overleaf, nous recommandons de placer le fichier principal du projet `.tex` dans le dossier racine du projet. Par exemple, les fonctionnalités concernées incluent [aller à l’emplacement](/latex/fr/base-de-connaissances/022-can-t-find-jump-to-location-arrows.md), [nombre de mots](/latex/fr/base-de-connaissances/099-is-there-a-way-to-run-a-word-count-that-doesn-t-include-latex-commands.md) et des scripts tels que [makeglossaries](/latex/fr/structure-du-document/05-glossaries.md) etc.,
* Tout fichier du projet contenant une `\documentclass` peut être compilé à l’ouverture dans l’éditeur en sélectionnant le bouton **Recompiler** . Cela vous permet de compiler plusieurs documents au sein d’un même projet Overleaf sans modifier le paramètre du fichier principal du projet.


---

# 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/fr/base-de-connaissances/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.
