Difference between revisions of "SyncTeX"

From Wiki
Jump to navigation Jump to search
(add some basic instructions for using synctex on a limited number of editors and viewers)
 
Line 15: Line 15:
  
 
You may need to modify the command for executing ConTeXt first (you need to add <code>--synctex</code> switch in preferences).
 
You may need to modify the command for executing ConTeXt first (you need to add <code>--synctex</code> switch in preferences).
 +
 +
=== Evince ===
 +
Evince (the GNOME PDF viewer) supports SyncTeX since version 2.32.0.
  
 
=== Skim.app & TextMate (Mac OS X) ===
 
=== Skim.app & TextMate (Mac OS X) ===

Revision as of 22:35, 30 September 2010

Synctext currently doesn't work with MKIV.

With a ConTeXt version > 2009.06.13 you can run

texexec --synctex jobname

that will create a file jobname.synctex.gz. The command

ctxtools --purge --all

or next run without --synctex will remove the file again.

This file can be used by your editor to display the proper file.

Editors & Viewers

TeXWorks

You may need to modify the command for executing ConTeXt first (you need to add --synctex switch in preferences).

Evince

Evince (the GNOME PDF viewer) supports SyncTeX since version 2.32.0.

Skim.app & TextMate (Mac OS X)

In Skim/Preferences/Sync choose TextMate. Key combination

Shift+Apple+MouseClick

will bring you to the corresponding line in text editor.

In TextMate (see ConTeXt Bundle for TextMate) I have created my own command inside ConTeXt bundle:

  • Save: Nothing
  • Command(s)
#!/bin/bash
pdf=${TM_FILEPATH%tex}pdf
/Applications/Skim.app/Contents/SharedSupport/displayline -r "$TM_LINE_NUMBER" "${pdf}"
  • Input: None
  • Output: Discard
  • Activation: Key Equivalent (choose one; I used Ctrl+Alt+Apple+O)
  • Scope Selector: text.tex.context

If you use Apple+R for typesetting that needs to be modified as well (to account for --synctex switch).

Hopefully this functionality will become part of the official ConTeXt bundle one day. (The recipe given above is too specific. The code needs to be written to handle more different viewers and different locations, not only a single viewer at a specified location.)