- Posted by Paulo on September 30, 2022
New feature: Stop on First Error compilation mode
Hey everybody! We are very happy to announce a new feature that will help you handle errors in your document: the Stop on First Error compilation mode! Let’s break it down and learn more about it!
Have you ever been uncertain about which errors are causing your project to not compile? Stop on First Error can help you more quickly and easily identify the problematic errors in your project as soon as they appear!
When writing LaTeX code, it is quite natural to make mistakes — e.g, a LaTeX syntax typo — which, during compilation, cause the compiler to issue error messages that try to explain what the compiler thinks has caused the problem. A single mistake in your code can trigger a cascade of errors, each with its corresponding message. On Overleaf, compilation error messages are reported to the user via a red notification next to the Recompile button, and you can click on the Logs and output files icon to view them.
Overleaf’s default compilation mode tries to compile your LaTeX document despite errors, which means the LaTeX compiler does not stop if errors are detected; instead, it attempts to best guess the user’s intention and applies fixes based on that guess — problematic code may also be skipped.
In this scenario, the compiler might return to a state where the compilation process can eventually complete to create a PDF, although the PDF produced may contain incorrect output. Often, the errors encountered may be too serious, or numerous, for the LaTeX compiler to fix so it might still bail out without producing a PDF.
The more errors a document has, the more challenging it is to fix them. Therefore, finding and fixing errors as early as possible on your project is definitely a good practice and might save you a lot of time later on! For those who want to get rid of the red notification next to the Recompile button, we introduce the Stop on First Error compilation mode!
Users can now change the LaTeX compilation mode by switching to the Stop on first error mode that forces Overleaf to terminate compilation immediately upon detection of the first error. You can enable it by selecting the small triangle next to the Recompile button then choosing Stop on first error from the Recompile drop-down menu:
Note that the Stop on first error mode is a per-user, per-project setting. Enabling this mode will not affect your other projects, or any collaborators in the same project. Also, when this mode is enabled, you can switch back to the default compilation mode by selecting the blue button Disable “Stop on first error” located in the dialog box which appears when there’s a compile error:
We also have a dedicated article in our knowledge base on how to use the Stop on First Error compilation mode. Check it out!
Learning to debug errors is an essential part of learning LaTeX. The Stop on first error mode can help everyone from LaTeX beginners to experts learn and adopt good LaTeX coding habits!
Feel free to reach out to us at firstname.lastname@example.org and share your thoughts about this exciting new feature and also your experience with Overleaf! Every word counts! You can also book an interview with our Product team, so we can dig a little deeper into your needs! And hey, you may also want to join our awesome Beta programme to get early access to new features!
A note about Overleaf On Premises
Stop on First Error will be available in the next Community Edition and Server Pro releases 3.3.