Forcing AucTex to properly show error messages

From the very-detailed-information dept:

I use Auctex with Emacs.app on my Mac to write papers. It’s the best editor I’ve come across for Latex support.

I was having trouble with one feature, however. If your source file contains an error (e.g., an unescaped underscore), the engine via Auctex will complain when you try to compile. In my case, I always use pdflatex to generate PDF output.

At that point you will get "Latex errors in `Document.tex output'. Use C-c ` to display". If you type C-c ` (TeX-next-error), the idea is that Emacs splits into two windows, with one window showing the error message, and the other showing the location of the problem in the source file. For some reason this wasn’t working on my machine, and I kept getting this strange blank window.

After some digging, I’ve determined the problem to be that pdflatex does not report errors using file-name, only line number. This means Auctex cannot determine the proper source file to open.

Following information on this mailing list post, the following steps should fix it (on a Mac):

  1. Edit the file /usr/local/texlive/2010/texmf.cnf. This is where user-specific customizations to the general config file for TexLive live.
  2. Add the line file-line-error = t at the end. This forces pdflatex to output the file name for each error.
  3. Update TexLive using sudo tlmgr update -all which, in addition to updating all the packages in your installation, will recognize your new config option. Possibly there is a shorter way to do this, but who doesn’t want to update their packages?
  4. Done!
About these ads

4 Comments

Filed under Uncategorized

4 responses to “Forcing AucTex to properly show error messages

  1. This problem is also mentioned here: http://stackoverflow.com/questions/7885853/emacs-latexmk-function-throws-me-into-an-empty-buffer
    I followed this advice and also tried your solution but it did not work for me (with Gnu Emacs 24 on Mac OS X 10.7.3 and with AUCTeX 11.86)

  2. okay, it works, I had to use “file_line_error_style=t” so with ending _style and with underscores.

  3. I was searching Google for this problem, and yours was one of the first pages that came up. Thank for put up the solution. I used your solution (with the fix suggested by Marius), and it worked. Also, as you suggested, there is in fact a faster way to reload the configuration change than running a full update. Just run the program mktexlsr (with root permissions if texlive is installed by root on your system). I am just putting it up there for the next person who might find this page looking about this problem. Thanks again for posting this solution, and please feel free to delete this comment if it does not agree with your policies.

  4. Ale

    I found out here
    http://tex.stackexchange.com/questions/91522/how-can-i-get-my-latex-set-up-on-emacs-auctex-to-use-the-file-line-error-option
    that it is possible to modify directly the command inside emacs and it works!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s