If you want to get PDF output by default using Emacs, you can add this to your .emacs
:
(setq-default TeX-PDF-mode t)
Alternatively, you can declare 'local' variables that are applied per-file. This is done at the end of the file, using a 'Local Variables' block. For example ---
\documentclass{article}
\begin{document}
text
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-PDF-mode: t
%%% End:
--- tells Emacs that the major mode is LaTeX-mode and that you want to get PDF output rather than DVI output. (You could also add \pdfoutput=1
in your preamble; but this has nothing to do with Emacs.) This block, by contrast ---
\documentclass{article}
\begin{document}
text
\end{document}
%%% Local Variables:
%%% mode: latex
%%% mode: flyspell
%%% TeX-engine: luatex
%%% End:
--- tells Emacs you want to use LaTeX-mode, the flyspell minor mode, and use LuaTeX as the backend/engine (LuaTeX produces PDF by default). Regarding the engine, you can switch, say, to LuaTeX even after the local variables have been set by using.
M-x TeX-engine-set <RET> luatex <RET>
Or, if you want to switch to XeTeX, then replace luatex
with xetex
. Note, finally, that we are talking about the engine, so do not use lualatex
or xelatex
in the above settings. AUCTEX is usually clever enough to figure out which format (TeX, LaTeX, ConTeXt) to use by parsing the file.
Best Answer
Add at the end of each chapter file
to point AUCTeX to the main file. Furthermore, (quoting the AUCTeX manual)
Or, if you usually use the same master filename