I have not been using LaTeX for quite some while, so I might be missing something obvious. I have a multiple file document and want to make AUCTeX
aware of the master file. The minimal example looks like this: A master file test.tex
and one section
in test-1.tex
in the same directory.
test.tex
\documentclass[11pt,a4paper]{article}
\usepackage{lipsum}
\begin{document}
\section{First}
\lipsum[1]
\include{test-1}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
test-1.tex
\section{Second}
\lipsum[2]
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "test"
%%% End:
If I compile test.tex
via C-c C-c
everything works fine but if I am in test-1.tex
I get the following error:
ERROR: Undefined control sequence.
--- TeX said ---
l.1 \section
{Second}
--- HELP ---
TeX encountered an unknown command name. You probably misspelled the
name. If this message occurs when a LaTeX command is being processed,
the command is probably in the wrong place---for example, the error
can be produced by an \item command that's not inside a list-making
environment. The error can also be caused by a missing \documentclass
command.
Also Switch to master file C-c ^
does not work, so there is something not working with the multiple file parsing. I have tried C-u C-c C-n
to reset AUCTeX
without any effect. What am I missing?
TeX-parse-self
? Have you tried to hitC-c C-n
intest-1.tex
and intest.tex
? Your example works without a problem for me -- I have setTeX-parse-self
tot
.TeX-parse-self
is set tot
in my config and I triedC-c C-n
in both documents without any change. It is still not working.-Q
switch, eval(package-initialize)
and open your .tex file. This works for me as well.