Fixing errors in generated files
Introduction
Sometimes Overleaf will report errors which arise from files with names such as output.toc
, output.bbl
, etc., but those files don’t even exist in your project. So where do such files come from and, more importantly, how do you locate and fix the errors?

output.toc
file in my project!”These “mysterious files” are artifacts: ancillary files generated during the LaTeX compilation process, but they can also trigger errors which usually originate from coding issues within your project’s source files. This help article uses a real error-ridden example to show how to track down such errors to their point-of-origin within your project source file(s).
Files generated during the LaTeX compilation process
Apart from the output .pdf
file, the LaTeX compilation process generates several file types which contain information about labels, cross-references, page numbers etc. Some ancillary file types are not directly created by the LaTeX compiler, but by other processing tools used during typesetting, for example, formatted reference lists and indices. These generated files must be read by the compiler on subsequent runs, so that the final .pdf
file is populated with the correct lists, citations and cross-references.
pdflatex
bibtex
pdflatex
pdflatex
On a local LaTeX installation you may need to execute each intermediate step yourself, or you might use a build tool such as make, latexmk or arara, to automate this chain of processes. Overleaf uses latexmk, and the following video shows what happens every time you click the “Recompile” button in your Overleaf project:
Compile errors reported from generated files
Coding errors in the main project .tex
file may be carried through to the generated files. For example, an unescaped &
in \section{Introduction & Background}
would make its way into the generated .toc
file. When the generated .toc
file is subsequently read-in by the next pdflatex
compile run, an error message is then raised as “coming from the .toc file”. However, current LaTeX logs and error-reporting do not make any connection from lines in the .toc
file (and other generated files) to their originating location in the source .tex
file: it may not be immediately obvious where the original error should be corrected.
Here’s an example of how errors are presented in another LaTeX editor: whilst you can click on the error message to open the related line in the generated .toc
or .aux
file, there isn’t a path to go from the error to the originating location in the .tex
file. And even if you correct the error by replacing &
with \&
in the .toc
file, that doesn’t really solve the problem: the next time you compile the .tex
file, the .toc
file is regenerated and the same error will be rewritten to the .toc
file.

When an error is reported as coming from generated files, the correct way to solve them is to locate the actual originating error in the source files, and correct those. The error messages usually include contextual information, some text or code surrounding the error, so doing a text search in the source files will help to locate them. The errors themselves are often common: you may look up some common errors on this help page, or in the TeX FAQ list.
First, try clearing the generated files
Sometimes, errors in the generated files are leftovers from a previous compile. Even if you had corrected the errors in your .tex
file and recompiled, the generated files, still containing the errors, might still be read by the compiler, producing the same errors as before. You can try deleting the generated files before you recompile. Instructions on how to do this on Overleaf can be found here.
If you’re still seeing the same errors even after deleting all generated files and recompiling, it’s likely that there are genuine errors in your source files.
Playing detective: locating errors in generated files
The following sections offer some tips on where to look for such errors. We’ll use the following purposely error-ridden example project for our sleuthing practice. Ready? Let’s go!
Open an error-ridden Overleaf project! The project should look something like this 😲:

Last updated
Was this helpful?