The Stack Overflow podcast is back! Listen to an interview with our new CEO.
135

SyncTeX is a utility written by Jérôme Laurens which enables synchronization between your source document and the PDF output. If your editor/viewer supports it, then you can click in your source and jump to the equivalent place in the PDF or click in the PDF and it will jump to the appropriate place in your source document. In TeXShop, for example, Command-...


43

Follow all the steps mentioned in the TeXnicCenter + Sumatra Tutorial, but keep in mind these few things: In the (La)TeX tab / (La)TeX compiler section / Command line arguments to pass to the compiler bar, you should write: -synctex=-1 -interaction=nonstopmode "%Wm" In the Viewer tab / Executable path section, what should be written is: "C:\Program Files\...


31

It's true that gzipping the .synctex file saves space on disk. For a 500 page book, the size is -rw-r--r-- user group 3.9M May 29 01:16 foo.synctex.gz while the unzipped file is -rw-r--r-- user group 18M May 29 01:16 foo.synctex The PDF file turns out to be only 2.2 MiB; the figures speak by themselves: the size grows very fast. Unzipping the file ...


30

This procedure will set up Emacs, AUCTeX, and the Okular viewer to handle integrated forward and inverse search. (These instructions were tested on a Debian system) Install Emacs. To install Emacs, open up the terminal and type the command: sudo apt-get install emacs Install AUCTeX. Within Emacs, run M-x package install RET auctex RET. To test for a ...


18

I combined some of the links mentioned here, you will find the links in the source comments. This code supports: Forward search (Emacs to Evince, via C-c C-v) Backward/Inverse search (Evince to Emacs, via C-Mouse-1, that is Ctrl + "Left Click" in Evince) Path names with spaces Multifile setups (TeX files requested by Evince will be opened if they aren't ...


16

TexWorks uses the -synctex option which allows you to right click and select view source which takes you back to the source of that line, or right click in the LaTeX source and jump the appropriate spot in the PDF. Most IDEs will also provide this sort of functionality, so if you use an good IDE you can cross reference between the PDF and the LaTeX ...


14

What are you using? (Linux, Windows, Mac) If you're using Linux, then Okular's probably the easiest PDF viewer to set-up synctex forward/backward search with emacs. Once you've installed Okular, you can add the following code to your .emacs config file: ;; Okular (setq TeX-view-program-list '(("Okular" "okular --unique %u"))) (add-hook 'LaTeX-mode-hook ...


12

It seems that Texmaker does not allow DDE commands, but since version 1.9 SumatraPDF supports forward search not only via DDE commands, but also via command line switches. Since version 3.2.1 Texmaker has all variables that are needed to use forward search. These are % for the basename of the master file (without path and without extension), ! for the ...


12

I quote from the Release Notes of version 3.18 Version 3.18 has only a single change: TeXShop contains an obsolete sync method called Search Sync, and a modern replacement by Jerome Laurens called SyncTeX. In recent versions of TeXShop, the obsolete Search Sync from the Preview Window to the Source Window randomly hangs, making TeXShop unresponsive ...


12

To perform an inverse search you can "ctrl+click" on the PDF preview or right click and then clik on "click to jump to the line": As @egreg points out, such information are easily found the user manual: If you add the -synctex=1 option to the pdflatex command, the built-in pdf viewer will jump directly to the position in the PDF file that corresponds ...


12

The binary in question is distributed (only) as part of TeXLive and should be installed in the TeXLive binary folder (something like C:\texlive\2016\bin\win32\synctex.exe). Note, however, that its only installed if you select the full scheme (which is the default). You can probably get away with installing TeXLive, copying the executable and kpathseaXXX.dll ...


11

A propos better SyncTeX'ing... Backwards search in TeX is inherently a badly posed problem. For example, if you ctrl-click on a word in the output title of a latex document, should you be backwarded to the line containing the \maketitle command (the one that created the title) or the line containing the \title command (the one that defined the title). Both ...


11

Synchronization between source TeX files and the resulting dvi or pdf file is done with synctex support. You must add the -synctex=1 option to the pdflatex command to enable synctex and thereby generating fileName.synctex.gz file which stores the linkages between source and pdf. synctex does not like special characters, follow best practices for file names.


11

I just found it out. On Skim, Shift and Apple key then click on the PDF text.


11

The Zathura SyncTeX interface has recently changed (I'm using v0.3.2 at time of writing): there is now no -s flag to activate SyncTeX. It might be the case that SyncTeX is active all the time. The SyncTeX support is complicated by two annoying quirks of Zathura: Zathura doesn't accept --synctex-forward if the file is not already open. The Zathura window ...


10

The switch from relative paths to absolute paths is intentional and will stay, as that is a requirement for the --output-directory switch to work. The fuzzyness with embedded /./ can probably be fixed, but that should be taken up with Jérôme Laurens (the synctex developer). The easiest way to reach him is to send an email message to the TeX Live mailing ...


10

I just made a doc describing how to setup Texmaker and SumatraPDF with forward and inverse search, but fully portable which is bit tricky. Link to the how-to http://goo.gl/hxDeu (without redirect: http://goo.gl/hxDeu+) or see below: 1. Configuring Texmaker to use SumatraPDF as external PDF viewer with forward search Open your portable Texmaker and set path ...


10

This is meant to be a response to the answer from Vlastimil above. I found that inverse search works fine without the batch file. I just use the following line in Sumatra PDF Options (it came up automatically as an option). I'm using Sumatra 2.1.1 and Texmaker 3.5. "C:\Program Files (x86)\Texmaker\texmaker.exe" "%f" -line %l As others have stated, forward ...


9

The "latexmk -pdflatex='pdflatex -file-line-error' -pdf %s" instruction should contain all options we want to pass to pdflatex at execution time, so "latexmk -pdflatex='pdflatex -file-line-error -synctex=1' -pdf %s" should work. The part within single quotes is the command latexmk will issue for compiling the document.


9

You have to add -synctex=1 to the commands: pdflatex -synctex=1 -interaction=nonstopmode %.tex xelatex -synctex=1 -interaction=nonstopmode %.tex lualatex -synctex=1 -interaction=nonstopmode %.tex After the next compilation there is a right-click menu item titled "Go to source" (Or shortcut Ctrl+').


9

The maneuver for going back and forth from the LaTeX file to the PDF file and conversely is Command+Shift+Click


9

Following subham soni's instructions will add the following lines to your .emacs (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(TeX-source-correlate-method (...


8

I'm not using TeXmaker but TeXstudio (formerly known as: TeXmakerX) instead. It is quite similar to the TeXmaker but has some nice additional features like code folding. For this editor I can give you a solution to the Forward Search problem. With TeXstudio you have two options: You can reconfigure the viewer command ("Options/Configure TeXstudio" -> "...


8

In a text file, lines are separated by a newline character, which you get by hitting enter. Even if a single line is broken by the editor (word wrap), as far as SyncTeX is concerned, it is still just a single line. Take the following screenshot from WinEdt. You'll see that even though the first part is divided over several lines in the editor, everything is ...


8

Note (added 2012-07-17). The bug has been fixed in TeX Live 2012 I can only confirm the bad behavior, at least on Mac OS X. It seems that the synchronization with XeTeX is off by one paragraph. I've checked with other documents and different pairs of editor/previewer. The bug seems to have been introduced with the 2011 TeX Live, as synchronization works ...


8

Solution: to use `TeX-view-program-list' in order to define a new viewer description (which contains an Evince command without sync). This new command will override the description of Evince defined in `TeX-view-program-list-builtin' (which contains the problematic command TeX-evince-sync-view). To do so : M-x customize-variable <RET> TeX-view-...


8

I think I solved the problem by using custom preferences in Skim. I changed the command to: /Applications/Aquamacs.app/Contents/MacOS/bin/emacsclient And now the backward search works again! Thank you all for the help.


7

I tried what was described here and it did not work. I found this link from the University of Illinois and their suggestions worked; I'm working in Fedora 17, in case it makes any difference. Here is what they suggest: Open some LaTeX file in Kile Open "Settings -> Configure Kile..." Click "Tools -> Build -> LaTeX" Select the "Modern" ...


7

I had exactly the same problem after moving the last section from one capter_y.tex to somewhere in chapter_x.tex. After moving, the chapter after chapter_y.tex, chapter_z.tex, failed when trying "jump to pdf"/"jump to source" I have no idea why this worked, but solved the problem by including \clearpage before the failing chapter: \documentclass[a4paper,...


7

This answer aims to comprehend the steps for both TeXmaker v4.5 and TeXstudio v2.11.0 with SumatraPDF v3.1.1 TeXmaker In Texmaker, go to Options > Configure Texmaker > Commands In External Viewer field (in case you are using SumatraPDF), type "C:\Program Files\SumatraPDF\SumatraPDF.exe" -1 -s @%.tex %.pdf In SumatraPDF, go to Settings > Options,...


Only top voted, non community-wiki answers of a minimum length are eligible