Starting from this version of AUCTeX, the option
TeX-file-line-error enables by default the
file:line:error messages that solve the problem. Thus, from this version you shouldn't run anymore into this kind of problems. I also suggest to revert any change to
LaTeX-command-style, in order to be sure to use the default value.
See below for previous versions.
AUCTeX 11.88 or earlier
Instead of editing the
texmf.cnf file you can just add
-file-line-error option to your TeX processor. To do this add the following code to your
(setq LaTeX-command-style '(("" "%(PDF)%(latex) -file-line-error %S%(PDFout)")))
See also the AUCTeX FAQ:
8. Why does
TeX-next-error (C-c `) fail?
When writing the log file, TeX puts information related to a file,
including error messages, between a pair of parentheses. 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.
As a workaround you can activate so-called file:line:error messages
for the log file. (Those are are easier to parse, but may lack some
details.) Either you do this in the configuration of your TeX system
(consult its manual to see where this is) or you add a command line
switch to the (la)tex call, e.g. by customizing
Note: already answered here.