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

After doing some changes to my document, I get a “Runaway Argument” error on compilation. After undoing these changes the error persists. However, when I copy the code to a new file or rename the .tex file, the error goes away. What is wrong?

[Note: question heavily edited by Caramdir.]

share|improve this question
Hmmm.... So I changed the file name and that seemed to fix it. Interesting. – Michael Mar 4 '11 at 1:09
Maybe there was something wrong still in the .aux file. If you get strange errors it often helps to delete all automatically created files. – Caramdir Mar 4 '11 at 2:36
@Micheal: Could you please tell us, whether deleting the .aux file helped. If so, I'd like to reformulate this question to be a bit more general (so that it might help other people with the same problem). – Caramdir Mar 5 '11 at 0:32
I rewrote your question, because I think the more general form might help some other people too. I hope you are ok with this. Otherwise please revert my changes. – Caramdir Mar 6 '11 at 0:35
@Caramdir: You might want to add your comment as an answer or write an extended one. – Martin Scharrer Apr 21 '11 at 10:44

During compilation, external files are read in, such as

  • .aux files - auxiliary files - which contain for example information for cross-referencing

  • a .toc file for the table of contents, .lof and .lot files for list of figures and list of tables, respectively

  • possibly an .ind file which contains the processed index, a .bbl file containing bibliography commands and more.

If such an external file contains an error, it can go away by renaming the main document and recompiling. And it can come back afterwards.

For example, if a sectioning command or a caption command contains code with an error, after renaming it may happen that

  • on the next compiling run there's no error, the wrong code is just written into the external file (.toc etc.)

  • in the following run that file is read in and processed, so the error can occur again.

Check toc, lof and lot files for errors if it happens repeatedly. "Strange" errors can sometimes be resolved by removing the .aux files, as Caramdir said. Don't worry about removing such LaTeX-generated files: they will come back in the next run.

A good start for locating the error would be examining the content of the .log file.

share|improve this answer

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.