Can I choose which file is the main tex file in a project on Overleaf?
Yes, by following these steps:
- Click on the Overleaf menu icon (
), located above the file list.
- Within the menu, locate the Main document option and set it to your preferred
.tex
file: - This will set the file to be compiled and previewed each time you return to your project.
Notes:
- To ensure Overleaf features work correctly, we recommend placing the project's main
.tex
file in the project's top-level folder. For example, features affected include jump-to-location, word count and scripts like makeglossaries etc,
- Any project file that contains a
\documentclass
command can be compiled when opened in the editor by selecting the Recompile button. This allows you to compile multiple documents inside one Overleaf project without changing the project's main file setting.