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

# ¿Puedo elegir qué archivo es el archivo tex principal en un proyecto de Overleaf?

Sí, siguiendo estos pasos:

1. Haga clic en el icono del menú de Overleaf (![OLmenu.png](/files/277b62acfef707887a3ebb61c8bcc17bd254670d)), situado encima de la lista de archivos.
2. Dentro del menú, localice la **Documento principal** opción y configúrela según su preferencia `.tex` archivo:

   ![SettingMainTeX.png](/files/d5ee5ddfe96457f5ea38c057db5aa8c02efc48ba)
3. Esto establecerá el archivo que se compilará y previsualizará cada vez que vuelva a su proyecto.

**Notas**:

* Para asegurarse de que las funciones de Overleaf funcionen correctamente, recomendamos colocar el archivo principal del proyecto `.tex` en la carpeta de nivel superior del proyecto. Por ejemplo, entre las funciones afectadas se incluyen [saltar a la ubicación](/latex/es/base-de-conocimientos/022-can-t-find-jump-to-location-arrows.md), [conteo de palabras](/latex/es/base-de-conocimientos/099-is-there-a-way-to-run-a-word-count-that-doesn-t-include-latex-commands.md) y scripts como [makeglossaries](/latex/es/estructura-del-documento/05-glossaries.md) etc.,
* Cualquier archivo del proyecto que contenga un `\documentclass` comando puede compilarse al abrirlo en el editor seleccionando el **Recompilar** botón. Esto le permite compilar varios documentos dentro de un proyecto de Overleaf sin cambiar la configuración del archivo principal del proyecto.


---

# 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/es/base-de-conocimientos/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.
