# Recompiling your project

A key part of working with LaTeX is compiling your source (`.tex`, `.bib`, images, and other files) into a PDF.

{% hint style="success" %}
You should compile frequently, and always fix any errors that you encounter as soon as they arise.
{% endhint %}

## Compiling

When you press the **Recompile** button, your source code will be compiled to produce the PDF. If there are errors in your project, these will be reported in the error logs.

If you run into trouble when compiling your project, these resources should help:

* [Fixing LaTeX errors](/troubleshooting-and-support/fixing-latex-errors.md)
* [Resolving PDF rendering and project loading problems](/troubleshooting-and-support/resolving-pdf-rendering-and-project-loading-problems.md)
* [Fixing and preventing compile timeouts](/troubleshooting-and-support/fixing-and-preventing-compile-timeouts.md)

## Compile options

The drop-down menu under the **Recompile** button allows you to toggle various compile options.

<figure><img src="/files/QPEisKupdLt9rarO6Z15" alt=""><figcaption></figcaption></figure>

### Auto compile

When this option is turned on, Overleaf automatically compiles your document for you every few seconds.

### Compile Mode

The LaTeX compiler can be given an instruction to produce a fast draft of the PDF, rather than a complete document. The main effect of choosing the **Fast \[draft]** option is to skip over image file processing. This means that the compile will complete more quickly, but all images will be replaced with empty boxes. This mode is helpful when working on large projects, or ones that have many image files.

### Syntax Checks

Overleaf automatically checks your LaTeX code for common syntax issues as you type. These checks help catch typos and errors that could prevent your project from compiling properly. Some things Overleaf's Syntax Checks highlights include unmatched braces or brackets, undefined commands, and missing or extra `\begin \end` statements.\
\
You can read more about Overleaf's syntax checking [here](/troubleshooting-and-support/code-check.md).

### Compile error handling

The default mode for LaTeX compilation on Overleaf is for the compiler to attempt to produce a PDF even if there are errors. In this mode, the compiler will ignore or compensate for errors it encounters when compiling. If errors are encountered, the PDF produced may be helpful in identifying the errors.

When errors are encountered, or if you encounter a compile timeout, it is recommended to switch to [Stop on first error](/troubleshooting-and-support/stop-on-first-error.md) mode. In this mode, the compiler will not attempt to produce a PDF when errors are encountered, but will instead stop and report the error immediately.

### Recompile from scratch

The LaTeX compiler generates temporary helper files when it compiles your project. These files are preserved when possible between compiles, which can help speed up the compilation process. If the files are stale or contain errors from a previous compile, it is sometimes helpful to remove them. Please see [Clearing the project cache](/troubleshooting-and-support/clearing-the-project-cache.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overleaf.com/getting-started/recompiling-your-project.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
