tom-tan / auctex-latexmk

This library adds LatexMk support to AUCTeX.
93 stars 24 forks source link

Cannot get it to work with LuaLaTeX #30

Closed sondr3 closed 7 years ago

sondr3 commented 7 years ago

Hello, I have a strange problem with LatexMk and LuaLaTex together with Emacs and AUCTex. I have the following .latexmk file:

# $pdflatex = 'pdflatex -interaction=nonstopmode -synctex=1 %O %S';
$lualatex='lualatex -interaction=nonstopmode -synctex=1 %O %S';
$pdf_mode = 4;
$pdf_previewer = 'open -a skim';
$clean_ext = 'bbl rel %R-blx.bib %R.synctex.gz';

And I've configured AUCTex to automatically use LatexMk when compiling new .tex documents, but I keep getting this error message:

ERROR: Fatal fontspec error: "cannot-use-pdftex"

--- TeX said ---
! 
! The fontspec package requires either XeTeX or LuaTeX.
! 
! You must change your typesetting engine to, e.g., "xelatex" or
! "lualatex"instead of plain "latex" or "pdflatex".
! 
! See the fontspec documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

l.28 \msg_fatal:nn {fontspec} {cannot-use-pdftex}

But I only get this error in Emacs, when I run latexmk -pvc file.tex in my terminal everything goes swimmingly and I get no error messages. Any idea why? It's fairly annoying since it messes the preview of the PDF-document because it doesn't align to where I'm actually editing it, it just jumps around.

sondr3 commented 7 years ago

Nevermind, this was all my fault. I didn't set the engine correctly.