0

When I get an error and go back to my old script, I cannot run my document anymore. If I start a new one by just copypasting, it works fine again.

Does someone know what the cause may be?

It would spare me so much time. Thanks for all the support!!!

The error is as follows:

Runaway argument?
{\contentsline
!File ended while scanning use of \@writefile
<inserted text>
            \par
I.4 \begin{document}
  • 1
    Welcome to TeX SE. I'll be hard to understand your problem without a tex code and a log file. – Alain Remillard Jan 23 at 15:47
  • Welcome to TeX.SE! Try deleting automatically-generated files such as the .aux file. Sometimes, compiling one more time after fixing the error is enough to get correct contents in the generated file that causes the error from TeX's point of view. In your case, try deleting the .toc file. – frougon Jan 23 at 15:47
  • 3
    Normally it means that you kill the tex compilation in the wrong way and so got broken auxiliary files. Don't klick on some x to close a window, when you get an error type x on your keyboard and hit enter. – Ulrike Fischer Jan 23 at 15:48
  • youhave an error in the aux file, no need to copy the whole project just delete the aux. And if you do get an error quit cleanly with x do not just kill thejob or you will corrupt files being written as you see... – David Carlisle Jan 23 at 15:48
  • 1
    tex has no control over this, it is your operating system that uses buffered file writing, if you kill the job without flushing all open file write operations then any files that are open for writing are likely to be corrupted. – David Carlisle Jan 23 at 16:07
1

You have an error in the .aux file, no need to copy the whole project just delete the aux (and probably your .toc file as well).

The most common reason for corrupting the aux file in this way is killing the job after an error (by control-c on the command line or deleting the window running the job) This gives the operating system no time to flush any unfinished write operations so can corrupt any file that is open for writing.

If you do get an error quit cleanly by typing x to the ? prompt. Do not just kill the job.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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