18

I'm using TeXStudio on Windows 7 with MikTeX. I don't know how to get the "Jump to source" command that appears in the mouse right-click menu, in the pdf viewer, once I compile a *.tex file with Quick Build. This feature is present and works well in TeXStudio under UBUNTU 12.04. How can I get it in Windows 7 too?

3 Answers 3

12

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+').

6
  • Hi Qrrbrbirlbel! That almost worked for me. In the haste I accidentally deleted the command that makes me open the pdf viewer automatically. What should I write after pdflatex -synctex=1 -interaction=nonstopmode %.tex for that to happen? Sep 4, 2012 at 20:55
  • @WobbyWindows That has nothing to do with any *latex commands. Look under the configuration "Build", there should be an item "Build & View". Choose from the dropdown list. I think you want to have txs:///pdf-chain which is later defined as a combination of txs:///pdflatex and txs:///view-pdf. — Hopefully that is correct. I use a SVN version. Sep 4, 2012 at 21:07
  • I went to Options menu > Configure TexStudio > Commands and fixed it from there. I symply checked & unchecked the Pdf Viewer > internal viewer box and it took care of itself by offering me to add -synctex=1 to the pdflatex command. All I did was click Yes. Sep 4, 2012 at 21:14
  • Had the same problem like WobbyWindows (but on a Debian machine). Adding -synctex=1 to the pdflatex command worked for me as well. Regarding the option of checking/unchecking that WobbyWindows mentioned - I do not see that button in my version (2.5.2).
    – Amir
    Mar 22, 2013 at 17:06
  • 3
    Also: latex -synctex=1 -interaction=nonstopmode %.tex
    – user29661
    Apr 25, 2013 at 9:01
6

In my case, the option -synctex=1 was in the command line. Yet it didn't work. What fixed it is deleting a file with the extension *.synctex. After that, syncing worked perfectly. Apparently, the file was a remnant of a previous latex compilation on a different machine.

1

I had the option -synctex=1 in the command line, but I generated the .pdf file and all auxiliary files on a different folder than the .tex file by means of the option -output-directory=/some/different/directory. After having compiled, I had a post-compiling command copy only the .pdf back to the .tex directory.

The problem was that I had to copy also the synctex file (thanks to @FahadAlrashed for the hint). So, when on post-compiling I copied not only the .pdf, but also the .synctex.gz file to the .tex directory the synchronizing feature was again operative.

Conclusion: Be sure that the right file .synctex.gz (Linux) or .synctex (Windows) is at the same directory of the .pdf file accessed by the TexStudio pdf Viewer. :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .