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.

With short files, if I get an error, I correct it, retypeset, and that's it. If the document becomes long enough (I don't know how many lines are required at least to get it, but I think 1000 should do it), when I retypeset, no matter what, I always get an error like:

./app_An_2.tex:441: File ended while scanning use of \@writefile.  
<inserted text>  
\par  
l. 441 \begin{document}  

where app_An_2.tex is the name of my file. If I trash the aux files, the error vanishes. Why does that happen? Part of the answer lies in the fact that below a certain number of lines the .aux file is left empty throughout the typesetting till the Undefined control sequence is found, whereas above that number (which seems to be around 4 hundred and sixty-something) after typesetting you find the .aux file has something in it. Usually the last line is an incomplete \@writefile{toc}, even removing the \tableofcontents command from the file and not letting there BE ANY .toc file. So why does all that happen above 460-something lines and not below that, and why ON EARTH does it \@writefile{toc} when there is neither any \tableofcontents in the .tex file nor any .toc file in the folder of the .tex file?

share|improve this question
    
A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). Also, you can use backticks ` to mark your inline code –  karlkoeller Dec 7 '13 at 16:55
2  
This often happens when a fragile command is used in a section title. –  egreg Dec 7 '13 at 16:55
    
What do you mean by "fragile"? Besides, section titles in this case, apart from plain text, contain only \s{L}(D,X), \R^m, \R^n and C^0, with definitions \newcommand{\s}{\mathcal}, \newcommand{\R}{\mathbb R}, which seem very simple, so why should that give errors? –  MickG Dec 7 '13 at 21:00
    
And thanks for you tips @karlkoeller. –  MickG Dec 7 '13 at 21:20
    
Though the tip of the code button doesn't solve the problem of posting that example. –  MickG Dec 7 '13 at 21:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.