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

I am trying to make tables in LaTeX. However, each time I make a mistake the compiler crashes even by removing the mistake with the following message:

Runaway argument? {lof ! File ended while scanning use of \@writefile. \par l.19 \begin{document}

Then, I have to delete all files except the .tex file and compile the program again. Would somebody please help me to solve it?

share|improve this question
Welcome to TeX.SE. Without more information not sure how someone is going to be able to help you. Perhaps the OS, Editor, version that you are using woudl be helpful. Furthermore, we'd probbaly need to see a complete documenent in the form of a Minimum Working Eexample including \documentclass and the appropriate packages that serves as a test case that can reproduce your problem. – Peter Grill Dec 7 '12 at 8:40
Perhaps you could try just deleting all the temporary files that were created during the first run as they are might have been left in a corrupt state due to the error. Depending on the editor you are using there is usually a pull down menu of the form Trash aux files), or Remove aux files. – Peter Grill Dec 7 '12 at 8:44
up vote 2 down vote accepted

My crystal ball says: your error concerns mismatched curly braces in the \caption or \label of the table, or some other part that is written to external files because it influences cross-references or the ToC or the List of Tables.

share|improve this answer
Thank you. It worked. – Saeed RamezanJamaat Dec 11 '12 at 2:13

It is failing to write to the list of figures, so most likely you have a fragile command in a figure \caption that should be preceded by \protect. But you will need to delete the lof and aux files initially as if a bad file is written on the previous run it is still input at the start of the next run.

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.