Child pages
  • SyncTeX with TeXnicCenter and SumatraPDF (Windows)
Skip to end of metadata
Go to start of metadata

To set up SyncTeX and synchronise your LaTeX source and PDF output, you need a PDF reader capable of forward and backward search. As far as I know, SumatraPDF is the only such program available for Windows, so here is a guide to getting it set up with TeXnicCenter.

  1. Install SumatraPDF. You'll need to download and run the installer, but if you install it to somewhere on your H drive, you don't need administrator privileges. (Maybe this is bad practice, I don't know, but it works.)
  2. Set up pdfLaTeX to generate SyncTeX information: In TeXnicCenter, go to Build/Define Output Profiles. Choose Latex => PDF, and add the following to `Command line arguments...': -synctex=-1
  3. Set up forward search: In the same TeXnicCenter dialogue, choose the Viewer tab.
    1. For `Path to executable', find the file SumatraPDF.exe wherever you chose to install it.
    2. For `View project's output', select DDE command, and enter [Open("%bm.pdf",0,1,1)], SUMATRA and control in the boxes for `Command', `Server' and `Topic' respectively.
    3. For `Forward Search', select DDE command, and enter [ForwardSearch("%bm.pdf","%Wc",%l,0,0,0)], SUMATRA and control in the corresponding boxes.
  4. Set up backward search: In SumatraPDF, go to Settings/Options, and in the `inverse search command line' section, enter "C:\Program Files\TeXnicCenter\TEXCNTR.exe" /ddecmd "[goto('%f', '%l')]", with all the quotes. (You might have to change the path to TeXnicCenter if you have it installed in a funny place.)

Now you should be able to do forward search (source to output) by pressing F5, and backward search by double-clicking in SumatraPDF.

Hope this helps someone! It is a bit tedious to set it up but it's incredibly useful once it works.

  • No labels