Skip to content

Yes: Click on the Overleaf menu icon above the file list, and set the "Main document" option to the .tex file you need. This will be the file that is compiled and previewed each time you return to your project.


In Overleaf v2, any file that contains a \documentclass command will be compiled if it's opened in the editor when you press the Recompile button. We made this change after lots of feedback from users in Overleaf v1 who wanted to be able to compile multiple documents inside one project, without needing to change the main file setting for the project.

We recommend that the main document .tex file is placed in the project's top level to ensure features to work correctly e.g. jump-to-location, word count, scripts like makeglossaries etc.

Overleaf guides

LaTeX Basics


Figures and tables

References and Citations


Document structure





Field specific

Class files

Advanced TeX/LaTeX