> For the complete documentation index, see [llms.txt](https://docs.overleaf.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.overleaf.com/navigating-in-the-editor/working-with-the-pdf-viewer/moving-between-the-editor-and-pdf.md).

# 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

There are several ways that you can use the jump-to-location features:

* In any view, you can double-click on the PDF to cause the editor to scroll to the corresponding location in the source code.
* In **Split view**, you can 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:

<figure><picture><source srcset="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2F01eMRWhGGxn5aR2M7cWF%2FGoToPDFLocation-NewDesign-Dark.png?alt=media&amp;token=7443ba35-ccb2-4121-aa88-40c94a6c158d" media="(prefers-color-scheme: dark)"><img src="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2FQFBclLOwOEOo3RSinA9v%2FGoToPDFlocation-NewDesign-Light.png?alt=media&amp;token=07764ada-b5e0-4f85-99fb-fd61b9d6e032" alt="Image of Go to PDF location button (left arrow)" width="368"></picture><figcaption></figcaption></figure>

<figure><picture><source srcset="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2F2gLluiwZh2bhOBwPgvpn%2FGoToCodeLocation-NewDesign-Dark.png?alt=media&amp;token=cf81b0f9-baa0-49d4-a70e-d20a0df0a850" media="(prefers-color-scheme: dark)"><img src="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2FpmXoHLMEYQihtLALqE4A%2FGoToCodeLocation-NewDesign-Light.png?alt=media&amp;token=2197aa56-10c0-4e70-92d5-6253e2582644" alt="Image of Go to code location button (right arrow)" width="367"></picture><figcaption></figcaption></figure>

* If the PDF is in a separate tab, you can use the **Show in PDF** or **Show in code** buttons. See [#jump-to-location-in-a-separate-tab](#jump-to-location-in-a-separate-tab "mention").

## Jump to location in a separate tab

{% tabs %}
{% tab title="Jump to PDF in a separate tab" %}
{% stepper %}
{% step %}
In the code editor tab, select "Show in PDF".

<figure><img src="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2Fx3u01M6IIIW6g2BqOQGf%2FEditorScrollToPDF-Light-NewEditor.jpg?alt=media&amp;token=5e05f985-97b9-40c1-bd14-317739ada181" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Navigate to your PDF tab to see the content scroll to the corresponding location.

<figure><img src="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2FpgiAou9EVALk7gzy2acv%2FPDFScrollToPDF-NewEditor.gif?alt=media&amp;token=288f2ea9-5ff7-4528-9cd9-161d0df82ab4" alt="GIF of PDF scrolling to code location" width="375"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="Jump to code in a separate tab" %}
{% stepper %}
{% step %}
In the PDF tab, either select "Show in code", or double-click the content.

<figure><img src="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2F2bLL8JMJrk9nzBWtgMfa%2FPDFShowinCodeButton-NewEditor.jpg?alt=media&amp;token=1ba96eb6-f040-4f49-93f6-a2de01700643" alt="Image of Show in Code button in PDF" width="375"><figcaption></figcaption></figure>

{% endstep %}

{% step %}
Navigate to your code editor tab to see the content scroll to the corresponding location.

{% hint style="info" %}
Note that the location is more accurate by double-clicking instead of selecting the "Show in code" button. In the following example, double-clicking correctly highlights the chapter title "Background" in the LaTeX code, versus the subsequent content as a result of selecting "Show in code".
{% endhint %}

{% tabs %}
{% tab title="The scroll from "Show in code"" %}

<figure><picture><source srcset="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2FIVDn43q6FCe4ofziMJ5Z%2FShowinCodeButton-Dark-NewEditor.gif?alt=media&amp;token=b07eee7d-f642-4fc0-90c3-1573323c68bf" media="(prefers-color-scheme: dark)"><img src="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2F3YApcQQ9fvrVMomaTELN%2FShowinCodeButton-Light-NewEditor.gif?alt=media&amp;token=be3ea6d1-ea94-492c-9862-83f07adf1f05" alt="" width="563"></picture><figcaption></figcaption></figure>
{% endtab %}

{% tab title="The scroll from a double-click " %}

<figure><picture><source srcset="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2FfqEKWAHZhFDz7Ttu3R3I%2FShowinCodeDoubleClick-Dark-NewEditor.gif?alt=media&amp;token=8aaf83e5-4043-4ca6-bc50-30fec10bab80" media="(prefers-color-scheme: dark)"><img src="https://3502988919-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVetOkhFZmAC8QCQK0Pi7%2Fuploads%2F7RpK1vCGnOXDJwdSlvNd%2FShowinCodeDoubleClick-Light-NewEditor.gif?alt=media&amp;token=a7f5bd04-2bfc-4b53-a414-3694100f9811" alt=""></picture><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}

## SyncTeX

The [SyncTeX](https://github.com/jlaurens/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](https://docs.overleaf.com/navigating-in-the-editor/generated-files.md) 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

<details>

<summary>I don't see the jump-to-location arrows.</summary>

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”.

</details>

<details>

<summary>The jump-to-location seems to have stopped working.</summary>

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

If the PDF-to-code (left) arrow works but not the code-to-PDF (right) arrow, ensure that [the Main document](https://docs.overleaf.com/getting-started/recompiling-your-project/the-main-document.md) isn't set to "None".

</details>

<details>

<summary>The jump-to-location is not accurate.</summary>

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.

</details>

<details>

<summary>An error "Couldn't find the corresponding source file" was shown.</summary>

Some causes of this error are:

* SyncTeX struggles with bibliographies because the formatted text in the PDF is generated from an intermediate `.bbl` file, rather than being pulled directly from your `.tex` source.
* 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](https://docs.overleaf.com/getting-started/recompiling-your-project/the-main-document.md).
* Using `\input` or `\include` with a preceding `./` on your file paths. For example a usage like`\include{./chapters/intro}` can cause SyncTeX to fail, the preferred syntax omits the leading  `./` , as in:`\include{chapters/intro}.`&#x20;
* Spaces in file names, or unexpected characters such as`()[]`, or other symbols can cause problems of SyncTeX and other tools. Be sure not to include spaces or special characters in file names.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.overleaf.com/navigating-in-the-editor/working-with-the-pdf-viewer/moving-between-the-editor-and-pdf.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
