I have a TeX file containing these few lines at the end:

%%% Local Variables:                                                    
%%% mode: latex                                                         
%%% TeX-master: t                                                       
%%% End:

The TeX document only consists of that file, so I want it to be the master file. When I compile it with errors, trying to debug with C-c ` opens an empty buffer on top of the compilation log buffer. I think that the top buffer should be the current file.

A dired on the top buffer however shows that it is in the non-existent folder /folder/of/my/tex/Tex Live 2012/.

I have tried changing the Tex-Master variable to the absolute path of the TeX file, but the problem stays the same.

How can I have my TeX file as the top buffer in the debugging window?

  • 3
    It is not quite clear what you are asking. The settings you show are correct, but C-c ` will just to the file that is having the error according to the log which may not be your main document (in case you did something in the preamble which is causing an internal error in some other package loaded later on, you are not showing code, so we will never know)
    – daleif
    Jul 17, 2014 at 9:05
  • Which version of AUCTeX do you use?
    – giordano
    Jul 17, 2014 at 11:17

1 Answer 1


This is a problem with the way AUCTeX parses the log file. It finds files based on parentheses, and the first "file" it finds is "Tex Live 2012". Part of the problem is that AUCTeX saves the first file it found if the error occurs outside of a file (or what AUCTeX thinks is outside of a file). For more details on the problem and a few semi-solutions see this answer of mine on StackOverflow. You might also want to try using the latest AUCTeX if you're not already.

That said, the best way to fix this is to invoke LaTeX with -file-line-error-style. This gives AUCTeX a much better chance of finding the right spot. One way to do this can be found on this question.

Sorry for so many links to my own answers, but they are the ones I knew how to find.

You must log in to answer this question.

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