I want to run Latexmk automatically with the correct TeX-engine as set in the local file variable at the end of the file, for example:
%% Local Variables:
%% TeX-engine: luatex
%% End:
In my .emacs
file I tried something like:
(add-hook 'LaTeX-mode-hook (lambda ()
(push
'("Latexmk" "latexmk %(-PDF) %s" TeX-run-TeX nil t
:help "Run Latexmk on file")
TeX-command-list)
'("%(-PDF)"
(lambda ()
(if (equal TeX-engine 'luatex)
"-lualatex" "-pdf"))))
but it doesn't work.
So how can I get the desired result?
*scratch*
. Place the cursor at the start and hitM-C-q
to indent the code. Select the whole block and indent it four spaces withC-u C-x TAB
. Then paste it into your question.) – Harald Hanche-Olsen Jan 30 '16 at 21:37M-x untabify
. – Harald Hanche-Olsen Jan 30 '16 at 22:02