3

I'm still pretty new to LaTeX; and on my home computer, I've got lualatex set up with my first few (pretty simple) LaTeX documents, Skim.app on OS X for viewing, etc etc etc …

… but now that I've cloned that git repository on my laptop, installed the same version of the MacTeX distribution (no custom or special configuration on either!), I'm getting this error with the same file that compiles fine on my home computer:

This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238) 
 restricted \write18 enabled.
(./Exercise-2.tex
LaTeX2e <2015/01/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
! Undefined control sequence.
l.1 \synctex
          =1
? 

The first few lines of that being,

\synctex=1
\documentclass[
   paper=a4,
   fontsize=11pt,
   parskip=no,
   fleqn
]{scrartcl}

...

Am I using the synctex declaration incorrectly, somehow, or …

  • You need to pass that option via the command line as part of the compiler, not your source code. That is, lualatex -synctex=1 <file>. – Werner Feb 3 '16 at 18:03
  • I mean, the \synctex syntax is mentioned here; and it definitely works without any flags on my desktop … (I don't use rubber or anything yet; I'm still at the point in my TeX career where I literally run lualatex *.tex in my homework directory, heh.) – ELLIOTTCABLE Feb 3 '16 at 18:05
  • That may be specific to Vim LaTeX. Is that what you're using? If not, does it work if you call it using --synctex=1 from the command line? – Werner Feb 3 '16 at 18:07
3

With LaTeX kernels older than the 2015 release, the primitive should be called as

\luatexsynctex=1

In the current kernel, the luatex prefix has been dismissed.

For a foolproof setting, do

\ifdefined\synctex\synctex\else\luatexsynctex\fi=1

You see the kernel version at the top of a log file; for instance, the current one prints the following banner:

This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238) 
 restricted \write18 enabled.
(./testsy.tex
LaTeX2e <2016/02/01>
Babel <3.9n> and hyphenation patterns for 79 languages loaded.

and you see the kernel date release after LaTeX2e

  • Amazing! Thank you! How do I know which ‘kernel’ I have, and why might it be different in two downloads of MacTex-2015 downloaded within a couple days of one another? – ELLIOTTCABLE Feb 3 '16 at 18:12
  • @ELLIOTTCABLE I added the information; several other primitives used to be called with the luatex prefix. – egreg Feb 3 '16 at 18:16

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.