3

I'd like to follow the advice from @egreg in his answer to the question AUCTeX and XeTeX. However the given code does not work for me.

I have:

\documentclass{article}
\usepackage{fontspec}

\begin{document}
\section{title}

test

\end{document}

%%% Local Variables: 
%%% coding: utf-8
%%% mode: latex
%%% TeX-engine: luatex
%%% End: 

but when I try to compile with C - c C - c I get the classic:

fatal error, fontspec requires...

If I change the TeX-engine globally with M - x -> customize-variable -> TeX-engine everything works fine.

I have emacs 24.4.1 and AUCTex 11.88

  • 1
    The change to the local variables is recognized only the next time the file is visited. – egreg Nov 26 '14 at 12:55
  • @egreg I see... Is there a way to force the reload or something similar without closing/reopening the file? – skey Nov 26 '14 at 13:10
  • Go to the "Command>TeXing Options" menu and choose "Use LuaTeX engine" – egreg Nov 26 '14 at 13:15
  • well, that's it. I removed the menubar but this may be a reason to put it back. thanks – skey Nov 26 '14 at 13:26
  • 1
    Or issue C-c C-n, this resets AUCTeX. – giordano Nov 26 '14 at 13:58
4

The error pointed out in comment is that the file must be reload to change the local variable. Emacs permit to do it using M-x revert-buffer and answer yes to the confirmation.

  • 2
    Alternatively you can run M-x normal-mode on the buffer. – Andrew Swann Aug 14 '15 at 7:56
  • 1
    @AndrewSwann Or M-x TeX-normal-mode... Or C-c C-n... – Paul Gaborit Aug 18 '15 at 21:50
2

There is also the function hack-local-variables. C-h f hack-local-variables RET says:

hack-local-variables is a compiled Lisp function in `files.el'.

(hack-local-variables &optional MODE-ONLY)

Parse and put into effect this buffer's local variables spec. Uses `hack-local-variables-apply' to apply the variables. [...]

M-: (hack-local-variables) RET in a buffer should do the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.