My setup: AUCTex 11.89.4, MikTeX 2.9 64bit, Emacs 24 on Windows 10. It has no serious customization other than setting the viewer to SumatraPDF and some colors and fonts.

The problem: I compile a long multipart file (a book) with pdflatex from inside AUCTex. I on purpose add a bogus command \dasdasa on some line. AUCTex properly recognizes the error, which is reported by pdflatex with error file and line number information

photons.tex:579: Undefined control sequence

but AUCTex is unable to find the location of the error in the file. It systematically goes to the wrong line! Any hints?

  • To complete the information: Emacs was installed from GNU's repo, AUCTeX was installed using MELPA stable repository. It all is rather easy to do, I am really happy for the outcome other than for this problem.
    – Juanjo
    Commented Sep 6, 2016 at 7:26

1 Answer 1


This is a problem with MiKTeX. You have to complain with MiKTeX developer because the *tex programs included in that distribution give fewer details when one uses the file:line:error message style, that is supposed to give more information. You can add a comment to this bug report: https://sourceforge.net/p/miktex/bugs/2310/

In order to workaround this issue you have to set TeX-file-line-error to nil by either using M-x customize-variable RET TeX-file-line-error RET, or adding the following line to your init file:

(setq TeX-file-line-error nil)

See also the Frequently Asked Questions in AUCTeX manual:

8. Why does TeX-next-error (C-c `) fail?

If TeX-file-line-error is set to nil (not the default), these sort of failures might be related to the the fact that when writing the log file, TeX puts information related to a file, including error messages, between a pair of parentheses. In this scenario AUCTeX determines the file where the error happened by parsing the log file and counting the parentheses. This can fail when there are other, unbalanced parentheses present.

Activating so-called file:line:error messages for the log file usually solves this issue, as these kind of messages are are easier to parse; however, they may lack some details. Activation can be done either in the configuration of your TeX system (consult its manual to see where this is) or by simply keeping the variable TeX-file-line-error to the default value of non-nil.

See also Uninformative error message when using AUCTeX

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .