1

When I attempt to include a table of contents in any file, it will not compile and I get a strange list of errors. For example,

\documentclass[11pt]{amsart}

\begin{document}



\section{Dummy section}

\end{document}

compiles with no trouble, while

\documentclass[11pt]{amsart}

\begin{document}

\tableofcontents

\section{Dummy section}

\end{document}

gives five errors, beginning with

Paragraph ended before \contentsline was complete
You can't use '\lastskip' in vertical mode.

No output is produced. Please help, and thanks.

4
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Have you tried removing the .aux file and compiling twice? – yo' Nov 11 '14 at 20:04
  • Yes. To make the situation more bizarre, I have two identical copies of the same file. One of which compiles perfectly well, the other one not at all. When I remove the table of contents from the second, it also compiles perfectly well. – Michael Nov 11 '14 at 20:07
  • Sorry, and have you removed the .toc file as well? – yo' Nov 11 '14 at 20:08
  • This worked. Can you explain to me why this error happened, and why that fixed it? – Michael Nov 11 '14 at 20:10
2

I can't say exactly what happened, but obviously LaTeX got interrupted by something during one of your compilations. This caused some incomplete data written into .aux and/or .toc and/or .lot, .lof, ... file. It is difficult to say what exactly it was, but deleting these files should solve the problem.

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.