1

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.

  • 1
    I'd suggest to use texstudio instead. This started out as a clone of texmaker, but is now much more powerful and will automatically guess the main document and for the rare case in which this fails, supports so called "magic comments" in which you can set the main document. – samcarter_is_at_topanswers.xyz Aug 29 '22 at 13:36
  • Excellent! Thanks for the prompt response. I will give texstudio a try. – Ahmad Abuaish Aug 29 '22 at 17:33

1 Answers1

3

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 to Options > 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.

DLCom
  • 210
  • 1
  • 9