[Tex/LaTex] Emacs gives me “Latex: problems after [0] pages”

auctexemacs

Yesterday, out of the blue, my emacs+auctex configuration stopped working and I started getting the following error when trying to do pdflatex, "Latex: problems after [0] pages".

Hitting Ctrl+C+L I see

Running `LaTeX' on `final' with ``pdflatex -synctex=1 -file-line-error %(extraopts) --synctex=1 -interaction=nonstopmode "\input" /home/mdn/research/final.tex''
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `pdflatex -synctex=1 -file-line-error %(extraopts) --synctex=1 -interaction=nonstopmode "\input" /home/mdn/research/final.tex'

I have not been able to figure out a solution. Actually, after updating my system (to Fedora 21) my emacs has started to act a bit weirdly, with several minor glitches. If anybody could share a working, minimal, synctex-enabled .emacs file I'd greatly appreciate it.

Best Answer

I would search your init files for references to TeX-expand-list. It's possible you're removing the value, though it seems unlikely.

Next, try updating AUCTeX (M-x list-packages) and restarting Emacs. Might be that simple.

If all else fails, try sticking this in your .emacs:

(add-to-list
 'TeX-expand-list
 (list "%(extraopts)"
       (lambda nil TeX-command-extra-options)))

This makes the extraopts key available to TeX-expand-command.