Syncing between PDF and LaTeX Source in the Editor
This article concerns the
macOS
app.
See other variants:
iOS
Windows

Texpad allows you to synchronise your LaTeX source with the output PDF. There are two ways you may choose to do so, a a one-off sync and a continuous scroll lock.

The data that enables syncing

Texpad relies on the data generated by a tool called SyncTeX supplied by the underlying typesetter to sync between he PDF and the LaTeX source. SyncTeX is a technology built into recent TeX typesetters. It generates the information necessary to convert a position in the typeset PDF with a position in the editor source.

  • For Texpad’s live typesetter TexpadTeX, this data is a by-product of the typeset process and is made available to the sync process when needed. TexpadTeX does not write this data to the disk in order to save time and resources.

  • For external typesetters, such as TeXLive on macOS and our cloud typesetters on iOS, this information is stored as an intermediate file with a .synctex.gz extension in the same folder as the root file. The cloud typesetters are set up to generate and return from the cloud server the corresponding .synctex.gz file with each typeset. Locally, on macOS or Windows, if your TeX distribution supports SyncTeX, Texpad will typeset the project with SyncTeX option automatically on to enable the sync. On macOS, MacTeX has had SyncTeX built in since 2008 so it is overwhelmingly likely that your distribution supports SyncTeX.

As Texpad relies on the sync data produced by the underlying typesetter and ultimately the included packages themselves, it may not always be possible to match the two sides perfectly. We are continually improving the matching system and Texpad users will continue to see improvements as a result over time.

Also note that, SyncTeX is not compatible with all LaTeX document classes; Beamer, for example, often causes trouble.

One-Off Syncing

One-off syncing takes you from a particular Editor location to its corresponding location in PDF, or vice versa.

In either of the two cases below, the other pane will be synchronised as precisely as possible. When syncing from editor to PDF, a light blue box will flash over the matching text, and when syncing PDF to editor, the cursor position will be set as closely as possible, often to the character.

To sync in a one-off manner, you will need to hold the Cmd key on your keyboard and click in the editor or the PDF at the location where you wish to sync.

PDF to Editor

Cmd-clicking on the PDF will jump to that line in the editor pane. You can also use the right-click context menu at any point in the cursor and select the option “Synchronise PDF”.

Editor to PDF

Cmd-clicking on the text will jump to that point in the PDF. You may also click on a row in the Structure section of the Contents pane in the Sidebar .

Info
Note that in versions older than 1.5, a simple click was the default behaviour to go from PDF to editor. If you prefer that option, please use the "Single-click PDF sync with editor" option in the "Document Viewer" section of your Preferences.

Continuous Scroll Lock

It can be useful when editing a document to keep the PDF and editor panes permanently in sync. You can do this by turning the scroll lock on from the right of the PDF toolbar.

  • Scroll lock off:
  • Scroll lock on:

Turning the sync lock on will scroll the top of the two panes to match each other as you scroll.

docs/apps/workspace/document-viewer/toolbar-scroll-lock-on_macos.png