0

I've done something to my .tex file that is resulting in the following error:

File ended while scanning use of @ newl@bel. \par 1.137 \begin{document}

This happens even when all the content is commented out.

I've found that duplicating the file and recompiling it temporarily solves the problem. However, once I introduce a syntax error into my LaTeX code, I get the same error, and can't find a way to debug it. It's driving me nuts.

epR8GaYuh
  • 2,432
  • This looks like an error that manifests itself in the .aux file. The .aux file is a temporary file that LaTeX needs to be able to resolve cross references and the like (basically everything that may involve code having to look into the future, see https://tex.stackexchange.com/q/111280/35864 for a nice explanation of the \label-\ref mechanism using .aux files). – moewe Aug 04 '20 at 21:41
  • Errors like this can be a bit of pain to deal with, because they may persist in the temporary file even if the problematic code in the .tex file has been fixed or removed completely. Plus, it can be a bit tricky to find the corresponding .tex code. Often the error message contains some (con)text that may help you locate the problematic code. If that is not the case, you need to open the .aux file, look for the problematic line and hope that it gives some hints as to where it came from in the .tex file. – moewe Aug 04 '20 at 21:41
  • delete the aux file. Also when you get an error make sure to exit cleanly by typing x not by quitting the window, that can corrupt any files that are being written. – David Carlisle Aug 04 '20 at 22:01
  • This might help: there is another error message that says "Label fig:exblah multiply defined. I can't find duplicates of labels that have used this macro. Also, in addition to the .synctec.gz file, there is also a sync.tex(busy) file. The problem goes away when I delete all the associated .gz, .log, .aux, .out, .pdf files and recompile. – Scentless Apprentice Aug 04 '20 at 22:16
  • Just saw all these comments. Thanks for the help! – Scentless Apprentice Aug 04 '20 at 22:17

0 Answers0