I recently switched to Texmaker, as it compiles faster compared to web-based solutions, i.e., Overleaf.
I like the F1 shortcut for performing a Quick build. However, it seems that Quick build only works when I am viewing main.tex. For example, if I am editing a sub-document, e.g., intro.tex and I press F1 or click on Quick build, I get an error about Missing \begin{document} (it seems that Texmaker is trying to compile intro.tex independently). However, when I switch the editor to main.tex, which has the command \input{intro.tex}, the compilation is successful.
My question is: is there a way to Quick build the document when viewing any sub-document in the directory?
Many thanks in advance.
Yes! There is a build in option in Texmaker for that exact problem. While viewing the master file (so the file that contains
\begin{document}and\end{document}), go toOptions>Define Current Document as 'Master Document'. After you've done that, Texmaker will always compile the master file, even while you're viewing another file. You can return to the normal mode by just toggling the option again. The shortcut for it is Ctrl+0 by default.