Tips and Tricks for Troubleshooting LaTeX
There are a few tips and tricks that you can use to help identify and solve LaTeX problems. We generally recommend you debug with the Stop on First Error compilation mode turned on, as it will let you avoid error pileups. Once you’ve encountered an error, you can follow these steps to resolve it:
Is there an error or warning?
Start by looking at the "Logs and output files" icon, just to the right of the Recompile button.
Warning messages are shown in orange. These are often just alerts that LaTeX has found something out of the ordinary and made automated adjustments. If they do not have an impact on the final look of your document, they can usually be ignored.
For example, many float and margin/space issues are corrected by LaTeX with no need for user correction. Overleaf reports a special class of warning, underfull and overfull box warnings, in blue—most of these can be safely ignored, although they do sometimes highlight a part of your document that needs to be checked.
Error messages are shown in red. They’re usually more problematic and can prevent the document from properly compiling. Fatal errors can prevent the document from compiling entirely.
There is a list of common errors and how to resolve them here. We recommend that errors be corrected as soon as possible, as letting them accumulate may lead to hard-to-debug and fatal errors in future.
Does the message indicate a specific error or line number?
In many cases, the LaTeX engine is smart enough to figure out the exact error and give you a line number. In the example above, there was a symbol
_
, which LaTeX requires you to escape like this:\_
. The error message even indicates that the error is on line 29, highlights the appropriate line, and shows an excerpt of the text where the problem is located. You can click on the error message to jump directly to the file and line number where the error occurs in the source code.If no line number is indicated, continue trying some of the steps below.
Does the error text provide a clue?
In the error message above, a line number is given, but not for a file that you are typically editing. Here, the file extension, .bbl, gives a clue that the error that’s preventing compilation is a BibTeX problem.
Searching for the highlighted text in your .bib file will allow you to find the source of the error. Sometimes checking the auxiliary and log files may reveal more specific information than the briefer message dialogues.
Compare previous versions and roll back changes
If your project was compiling just fine previously, then you've likely introduced an error into the project in your recent edits. You can use the History feature to roll back recent changes.
Try moving \end{document}
If you still haven't narrowed down the location of the error, cut the
\end{document}
from the very end of your main .tex file and try pasting it in various parts of your project. Start with the main .tex file, and then, if necessary, any sub-files that you call in your main file with\input{}
or\include{}
. Move in a methodical fashion from the very end of the project/document toward the beginning of the document, repeating this process one section at a time. Pay particular attention to equations or other complicated sections prone to small errors.This should help you limit your document progressively to a smaller and smaller document until you can isolate the section containing the error. If the document suddenly begins compiling, you know you've located the erroneous section. In many cases, the problem could be something as simple as a mistyped command, an unescaped special character, or a missing bracket.
Is it a compilation "timeout" error?
In some cases, users may face timeout compilation errors under certain conditions. This is due to resource/compilation time limits on our servers. We have different time limits for free accounts and paid accounts. There are a number of tips we have in order to make your document compile faster, and if these don't work, feel free to contact us with a support request.
Is it a “PDF rendering” error?
As with other online services, you can sometimes run into problems when using Overleaf. Browser state, browser extensions, brief outages of service providers, and network configuration issues can potentially cause problems.
If you’re experiencing connection issues, or if part of the editor or PDF viewer is not loading or displaying as expected, please try the troubleshooting steps on this page.
Try the forums
If no line number is given and you aren't able to decipher the given error message, a quick "copy-paste" trip to your favorite search engine may reveal information from expert users who have faced a similar issue. Some excellent TeX-related forums include LaTeX Stack Exchange and LaTeX Community.
Contact us
Last, but not least, you can always send us a support request. No matter your issue, whether LaTeX-specific, or site-specific, we're happy to help you get the most out of your Overleaf experience.
Overleaf guides
- Creating a document in Overleaf
- Uploading a project
- Copying a project
- Creating a project from a template
- Using the Overleaf project menu
- Including images in Overleaf
- Exporting your work from Overleaf
- Working offline in Overleaf
- Using Track Changes in Overleaf
- Using bibliographies in Overleaf
- Sharing your work with others
- Using the History feature
- Debugging Compilation timeout errors
- How-to guides
- Guide to Overleaf’s premium features
LaTeX Basics
- Creating your first LaTeX document
- Choosing a LaTeX Compiler
- Paragraphs and new lines
- Bold, italics and underlining
- Lists
- Errors
Mathematics
- Mathematical expressions
- Subscripts and superscripts
- Brackets and Parentheses
- Matrices
- Fractions and Binomials
- Aligning equations
- Operators
- Spacing in math mode
- Integrals, sums and limits
- Display style in math mode
- List of Greek letters and math symbols
- Mathematical fonts
- Using the Symbol Palette in Overleaf
Figures and tables
- Inserting Images
- Tables
- Positioning Images and Tables
- Lists of Tables and Figures
- Drawing Diagrams Directly in LaTeX
- TikZ package
References and Citations
- Bibliography management with bibtex
- Bibliography management with natbib
- Bibliography management with biblatex
- Bibtex bibliography styles
- Natbib bibliography styles
- Natbib citation styles
- Biblatex bibliography styles
- Biblatex citation styles
Languages
- Multilingual typesetting on Overleaf using polyglossia and fontspec
- Multilingual typesetting on Overleaf using babel and fontspec
- International language support
- Quotations and quotation marks
- Arabic
- Chinese
- French
- German
- Greek
- Italian
- Japanese
- Korean
- Portuguese
- Russian
- Spanish
Document structure
- Sections and chapters
- Table of contents
- Cross referencing sections, equations and floats
- Indices
- Glossaries
- Nomenclatures
- Management in a large project
- Multi-file LaTeX projects
- Hyperlinks
Formatting
- Lengths in LaTeX
- Headers and footers
- Page numbering
- Paragraph formatting
- Line breaks and blank spaces
- Text alignment
- Page size and margins
- Single sided and double sided documents
- Multiple columns
- Counters
- Code listing
- Code Highlighting with minted
- Using colours in LaTeX
- Footnotes
- Margin notes
Fonts
Presentations
Commands
Field specific
- Theorems and proofs
- Chemistry formulae
- Feynman diagrams
- Molecular orbital diagrams
- Chess notation
- Knitting patterns
- CircuiTikz package
- Pgfplots package
- Typesetting exams in LaTeX
- Knitr
- Attribute Value Matrices
Class files
- Understanding packages and class files
- List of packages and class files
- Writing your own package
- Writing your own class