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

skey
  • 203
  • 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
  • Emacs offers an on-demand popup-menu of the menu-bar stuff, and also offers a minibuffer navigation of the menubar stuff. So, you can save screen real estate. – lawlist Nov 27 '14 at 21:31

2 Answers2

5

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.

Romain Picot
  • 6,730
  • 4
  • 28
  • 58
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.

Arash Esbati
  • 7,416