I am using miktex, texworks and pdflatex to compile my document, which is in multiple parts. When compiling the main file (which includes all of the other parts using \include{}) it works fine, however when compiling the child parts I hit the problem of them not being complete documents (they only have a section command and the contents of that section). This means I have to have the main file open in the background and keep alt-tabbing when I want to recompile the document. Is there a way to tell it that when I compile one of the child parts it should actually compile the main file?


Thanks to @daleif's comment above I found the answer to be adding

% !Tex root = main.tex

to the top of the child files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.