Trying to compile the following using C-c C-c in emacs + auctex freezes emacs:
\documentclass{article}
\begin{document}
asdf
\end{document}
%%% Local Variables:
%%% TeX-engine: lualatex
%%% TeX-master: t
%%% End:
Is there a mistake in my local variables? I was following following advice: link. My emacs and my auctex should be up to date.
emacs version: GNU Emacs 25.1.1
auctex version: 11.90.0
Best Answer
With the "Local Variables" settings, you may declare the 'engine' that Emacs will call. Usually your choice will be one of
default
¹luatex
, orxetex
. Themode
, conversely will name the format you are using (e.g.,context
,latex
, ortex
).Thus, for a LaTeX document that requires the LuaTeX engine, which you'd normally call with the command
lualatex
in a terminal, you could use the following:When Emacs opens a new
.tex
file in the buffer, it queries what my master file will be (default ist
, which means the current new file/buffer will be its own master) and presumes thelatex
format. Now, if I want to specify the engine, I can add theTeX-engine
line. You can also temporarily select the engine (for the remainder of the time Emacs is visiting the file withM-x TeX-engine-set RET <default|luatex|xetex> RET
.Another thing you can do for a whole directory is create a file called
.dir-locals-el
that contains the line:This sets the default engine for the directory to
luatex
. If you want to name the master file, you could additionally do:¹ My
.emacs
haspdfTeX
as my default engine, which is surely what the default default is; but this could be changed.