Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
10  
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
1  
@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
1  
@Caramdir: You might want to add your comment as an answer or write an extended one. –  Martin Scharrer Apr 21 '11 at 10:44
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.