## Why do I keep getting the compile timeout error message?

A ‘compile timeout’ means that it took too long to make the PDF for your document. This page explains why this can happen and how to fix it.

### Large, High Resolution Images

If you have several high resolution PNG or JPEG images in your document, LaTeX has to resize them every time we compile the PDF, and this can take a long time. Here are some ways to get around this:

• Use PDF files instead of PNG files for diagrams and plots. If your drawing or plotting software exports to PDF, that will be much faster (and the output will look better).
• Use draft mode when working online, by adding the draft option to your \documentclass command, like this:
\documentclass[12pt,draft]{article}
This replaces all of your graphics with boxes and makes the PDF compile much faster.
• Use lower resolution images for the online version of the document.

### Complicated TikZ or pgfplots Drawings

TikZ and pgfplots produce great graphics, but they can take a long time to compile. There are several ways you can externalize the tikz pictures so that latex doesn't have to redraw them from scratch every time it makes a new PDF.

### Infinite Loops

LaTeX can fall into an infinite loop when it tries to make the PDF — no matter how long you wait, it will never finish. Infinite loops are most commonly caused by bugs in packages or in user-defined commands, e.g. when a command expands to itself.

### Tracing/Debugging Calls

If you happen to have a \tracingall in your document (perhaps leftover from a template or a project from a local machine), it'll be recording lots and lots of lines in the .log file (which can quickly grow to hundreds of MBs) and showing no sign of stopping. Remove the \tracingall call from your Overleaf project; or use the trace package instead, if you need to debug online.

### Fair Use Limits

If you have a very large document, it may just take a long time to compile. If you sign up for a free account, and you are signed in when you are editing your documents, we will give your documents more time to compile than if you are not signed in. If this is still not enough, we offer even longer compile times on our paid plans:

Anonymous Free Pro/Pro+
Timeout 30 seconds 1 minute 4 minutes

We have to set timeouts in order to deal with infinite loops, and also to ensure that we are fair to all of our users.

### Still Stuck?

If you have a compile timeout error that you cannot resolve, please let us know and we'll take a look for you.