SyncTeX – Synchronization between TeX and DVI/PDF

SyncTeX is a method for synchronization between (La)TeX source and its DVI/PDF file.  It is well and officially supported in TeXLive 2008. More information on using SyncTeX on Mac OS can be found here. This post targets Emacs+AucTeX (excellent LaTeX editor) and Skim (excellent PDF viewer) on Mac OS. Carbon Emacs (i.e. Emacs for Mac OS) can be downloaded from its website or from Apple’s website. Skim is located here.

Assuming that you already have Skim and Emacs+AucTeX up and running, this is how you enable SyncTeX in your LaTeX files and synchronize between them and their PDF files:

  • To enable SyncTeX in your LaTeX files, first you must have TeXLive 2008 (or any TeX distribution that supports SyncTeX) installed in your system. When you compile your LaTeX files, use the switch -synctex=1 in your call to latex. Alternatively, you can add a line \synctex=1 in the preamble of the master TeX file. The PDF file compiled from your LaTeX source will be accompanied by a SyncTeX file of the same name, which contains information necessary for the synchronization.
  • In Emacs, you must start the Emacs Server by issuing command server-start (M-x server-start <ENTER>).
  • You must configure Skim to synchronize with Emacs: menu Preferences/Sync/Preset to Emacs.
  • Open the PDF file in Skim. In Skim, hold Shift-Apple and click on any text in the PDF to go directly to the corresponding LaTeX source in Emacs.

That’s easy!

Advertisements
This entry was posted in LaTeX, MacOS and tagged , , , . Bookmark the permalink.

3 Responses to SyncTeX – Synchronization between TeX and DVI/PDF

  1. Pingback: Synchronization with SyncTeX « TRUONG on LaTeX

  2. Kevin says:

    Too bad it can’t go back to the point in the org-mode file that generated the tex file :-/

  3. mankoff says:

    @Kevin I think synctex can work with org although I have not yet been successful myself. See https://stackoverflow.com/questions/9965049/how-to-use-synctex-with-org-mode and my recent post to the org list here: https://lists.gnu.org/archive/html/emacs-orgmode/2014-02/msg00876.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s