I have a long LaTeX article (1000 lines, single file) which also has a lot of figures and a few tables.



The article compiles with a few warnings. However if I uncomment any of the lines in a paragraph near the end of file, I get an error:

! File ended while scanning use of \@writefile
Miktek 2.8 gave \end{document} as location
Miktek 2.9 gives \begin{document} as location

The error appears on 3rd build pass (not on the first 2 after cleaning project). The PDF file seems to be generated normally. However this error makes me nervous.

The offending paragraph:

To check segmentation expertize of the primary author,
%one dataset (F02) was manually segmented both by the primary author
and a neurosurgeon (the second author).
%Dice coefficient is 91\%, which is on par
%with segmentation correlations between neurosurgeons~\cite{ExpertDSCs} (86-96\% DSC).

I am using TeXnicCenter on Win7 x64 with 32-bit MiKTeX.

Should I just ignore this error, or is there a way to fix it?

closed as too localized by egreg, mafp, Claudio Fiandrino, Thorsten, Speravir Apr 5 '13 at 16:51

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Welcome to TeX.sx! for the first Q. A tip: You can use backticks ` to mark your inline code as I did in my edit. – texenthusiast Apr 5 '13 at 15:28
  • What happens if you uncomment just this line: "one dataset (F02) was manually segmented both by the primary author"? – Mario S. E. Apr 5 '13 at 15:31
  • Uncommenting any of those 3 lines leads to the error, including that one. – Dženan Apr 5 '13 at 15:41
  • Have you read your .log file? I remember getting really strange errors on the second or third run once. I didn't understand them until I read through the entire .log file. It turned out I had to many figures and the error was actually "too many unprocessed floats" or something like that. You say you have a lot of those, so you might want to check. – Anke Apr 5 '13 at 15:44
  • 3
    when i see errors like this (i don't think it's specific to miktex) it usually means there's a problem earlier in the file that's incidentally triggered by something happening later on. does the log say something like "\end occurred inside a group at level 1)"? if so, keep moving the \end{document} back until this disappears, using the "divide and conquer" method to isolate the offending paragraph. comment that out, and try running the job through to the end; if the job then completes, you know where to look more closely. – barbara beeton Apr 5 '13 at 15:50

Moving \end{document} around led me to the offending line. It was some \url{} at the very end of the document. Thanks barbara beeton!

It is very strange that such an inconspicuous paragraph triggered the error.

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