I'm writing a thesis with AUCTeX. I have one main document (master.tex) and several chapter files (chapter1.tex, chapter2.tex, etc.) that are included in the master file using the \include
command.
The master file now fails to compile, with AUCTeX returning "master file already set".
The problem can be solved by removing the tail from master.tex (from %%% Local Variables:
and below) and re-compiling (C-c C-c
returning a prompt for the master file). However, this seemingly disables AUCTeX from understanding the document structure, making it impossible to compile _region_.pdf
from chapter.tex
.
MWE:
% This is master.tex
\documentclass{report}
\begin{document}
\include{chapter1}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
...
%This is chapter1.tex
Arbitrary text.
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "master"
%%% End:
AUCTeX-version 2019-09-27, Emacs 26.3.
This question was previously aksed, but the thread was closed as off-topic without any working solution provided. I hope someone can help me.
Link to thread: Auctex not compiling on C-c C-c, "TeX-master-file-ask: Master file already set"