[zz]Using SyncTeX with LaTeX

Using SyncTeX with LaTeX

 

23 Nov 09

SynchronisationWorking with LaTeX involves writing in one application (TeXShop, TextMate, etc.) and viewing your document in a pdf reader (Acrobat Reader, Skim, etc.). To see the result of your work, to correct or improve it, it is often practical to quickly go back and forth between the working text and the resulting pdf.

In a recent past, this involved using the package pdfsync with the command \usepackage{pdfsync} inserted in the preamble or configuring your text editor to use pdfsync by default. Starting with the 2008 distribution of TeX it is now possible to use SyncTeX, written by Jerôme Laurens, the creator of psfsync. SyncTeX replaces pdfsync.

The advantages of SyncTeX are many: you do not need to load pdfsync; synchronisation between the two files is more precise; compatibility issues are basically irrelevant; etc.

To enable synchronisation, SyncTeX creates an auxiliary file in the format nameofthefile.synctex.gz.

Several text editors use SyncTeX by default. In TeXShop for example, SyncTeX is used by default in Preferences>Composition>SyncMethod. SyncTeX is also invoked by default in Preferences>Engines>pdfTex. It is also used by default in TextMate. If SyncTex is not used by default you can always use the command -synctex=1 if you use the terminal or insert the following line in the preamble to force the use of SyncTeX.

\synctex=1

To deactivate SyncTeX, simply comment out the comment in the tex file or use -synctex=0 where you find synctex=1. In TextMate you just need to add -synctex=0 in the options of the Preferences in the LaTeX bundle.

To go from the tex file to the pdf file in TextMate simply do ⌃⌥⌘-o (the letter o, not zero); in TeXShop ⌘-click.

Conversely, to go from the pdf file to the tex file in TextMate do ⇧ ⌘-click; inTeXShop ⌘-click in the location of the pdf file that you want to land to in the tex file.

In Skim a small red dot shows up by default in the pdf file that you targeted. The color can be changed in Preferences. The frame marks will not be printed.

To make things easier, you can leave both files open if your monitor is big enough or if you use two monitors. But then do not forget that the pdf file you see is the last compilation before you started making changes in the tex file, unless your pdf reader is set up for automatic refresh.

SyncTeX works fine for me using XƎTeX and TextMate on Snow Leopard.

Some Interesting Links

转载于:https://www.cnblogs.com/nn0p/archive/2012/11/13/2767965.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值