4

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"

2
  • What version of AUCTeX, what emacs?
    – vonbrand
    Feb 25, 2020 at 19:26
  • AUCTeX-version 2019-09-27, Emacs 26.3. Feb 25, 2020 at 21:41

2 Answers 2

2

In chapter1.tex, you are setting TeX-master to the symbol 'master. It should be a string instead:

%This is chapter1.tex
Arbitrary text.

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "master"
%%% End:

(Make sure you do M-x revert-buffer to apply the changes.)

1
  • 2
    Thanks for the reply. This was merely a typo in the example, not in the actual code used. I have updated the post. Feb 25, 2020 at 13:20
0

See if you have any stray characters in there.

Create the files in the example from scratch, using emacs (with AUCTeX loaded). See if you get the same behavior. If not, copy and paste...

I've got several, large (30 or so files, scattered among various directories) documents. Works fine with latest xemacs and AUCTeX on Fedora (oldest has lived through several versions since their inception some 10 years back). Never seen your problem.

1
  • 2
    Thanks for the reply. I did as you suggested, this did unfortunately not solve the problem. However, I noticed that the master file could be compiled using the "Run LaTeX" command in the toolbar (I had only tried using C-c C-c latex RET). The issue with "chapter1.tex" not compiling did however persist (both using C-c C-b latex RET and the "Run LaTeX" in the toolbar with "command on" set to buffer). Feb 25, 2020 at 21:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .