TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From time to time I need to prepare presentations, and I use the beamer class plus the minted package.

I would like to know why sometimes I need to delete the aux file generated by pdflatex to successfully compile. Is there any additional step aside from invoking pdflatex?

share|improve this question
perhaps compiling it with latexmk -pdf would help (you can even set up a latexmkrc file with instructions about what kind of files should be cleaned up after the compilation) – henrique Mar 26 '12 at 2:08
Usually when this happens to me it's after a failed compile so maybe there's some bad data in the .aux file that latex is still trying to use which is now invalid (usually happens when you quit compiling or end the pdflatex command after it finds an error without letting it complete) – Jesus Ramos Mar 26 '12 at 2:09
@henrique that is a good advice. I haven't considered using latexmk because my projects are rather simple, but maybe it is time to switch. Thank you – amc Mar 26 '12 at 2:25
@JesusRamos That is my scenario, after a failed compile. – amc Mar 26 '12 at 2:52
@amorenoc Do you select any options to take or do you hit CTRL-C and exit the pdflatex compiler by selecting an option when it encounters the error? – Jesus Ramos Mar 26 '12 at 2:54
up vote 8 down vote accepted

This happens because of abnormal termination of pdflatex. To avoid this instead of killing pdflatex, use the X option at the error prompt to quit instead.

Took me a while to figure this out (mostly because upon error emacs compilation buffer is read only, so I always had to force it to close)

share|improve this answer
How do you do it then in emacs? – Dror Mar 26 '12 at 6:51
I just use M-x term or M-x shell to do it so that I still get an interactive shell and a Makefile. Or you can use AuCtEx to do it as well. – Jesus Ramos Mar 26 '12 at 22:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.