I use AUCTeX. AUCTeX has inserted a comment at the end of my test4.tex file that reads:
%%% TeX-master: "test3"
What does it mean?
When I try to compile and pdf-print test4.tex, the document that gets opened is test3.pdf. Why?
The tex master tells emacs which document to pass to latex.
So you can have a section or even just a single equation in a file that is \input into your master document, and when you use C-c C-c or any other command that requires a full document, then the master document will be run.
TeX-master, check the documentation for options.
– Arash Esbati
May 14 '17 at 10:43
C-c C-cruns LaTeX ontest3.texinstead of the file corresponding to the current buffer”. Useful if you are working on a subfile and want to compile the main document, instead. – egreg May 14 '17 at 10:04