Moving between the editor and PDF

Using Overleaf's jump-to-location features

Overleaf enables you to go from a location in the typeset PDF to the corresponding location in your LaTeX source code, and vice-versa. These jump-to-location features are based on a standard utility called SyncTeX and enabled by special features in the Overleaf PDF viewer.

Using Jump-to-location

You can either:

  • Double-click on the PDF which causes Overleaf’s editor to scroll to the corresponding location in the source code

  • Use the arrow keys that sit on the divider between the source code panel and the preview panel, to jump from source-to-preview, or preview-to-source:

SyncTeX

The SyncTeX extension has been available since 2008 and continues to be actively developed by its creator, Jérôme Laurens. It is widely used, including by Overleaf, and is supported by all TeX engines in use today.

Overleaf includes SyncTeX as part of the PDF compilation process, allowing it to write out a special generated file with extension output.synctex.gz which provides the mapping between locations in the .tex file and in the PDF. The Overleaf editor and PDF viewer are SyncTeX aware, and can make use of this file to provide the jump-to-location feature.

Troubleshooting and known limitations

I don't see the jump to location arrows.

If you don’t see those arrows, or double-clicking the PDF doesn’t work, you need to make sure your project’s PDF viewer is set to “Overleaf” and not “Browser”.

The jump-to-location seems to have stopped working.

This may indicate that the SyncTeX file output.synctex.gz needs to be regenerated. Please click on Recompile and try again.

The jump-to-location is not accurate.

A lack of accuracy in the jump-to-location feature can be caused by:

  • Changes in the source since the previous compile. As mentioned above, jump-to-location relies on files that are generated when the project compiles. Recompiling your project may help.

  • SyncTeX is only accurate to the level of lines of code, not positions of individual characters. You can increase the accuracy of SynTeX (and error reporting) by breaking your source code into more lines. A single line end in LaTeX source does not create a new paragraph in the compiled document.

  • Two column and multi-column layouts can result in less accurate results in jump-to-location.

An error "Couldn't find the corresponding source file" was shown.

Some causes of this error are:

  • The main .tex document of an Overleaf is not located at the top-level of the project (i.e. not in a folder). Please see The Main document.

  • Using \input or \include with a preceding ./ on your file paths. For example a usage like\include{./chapters/intro} cancause SyncTeX to fail, the preferred syntax omits the leading ./ , as in:\include{chapters/intro}.

  • Spaces in file names, or unexpected characters such as()[], or other symbols can cause problems of SynTeX and other tools. Be sure not to include spaces or special charcters in file names.

Last updated

Was this helpful?