17.4.15

Create Search Link Between TeXstudio and SumatraPDF

I use TeXstudio for my LaTeX works. SumatraPDF is also good, lightweight PDF reader. It is possible to create a forward search from TeXstudio to SumatraPDF. You may find PDF output of a LaTeX code. Similarly, a backward search is possible: find LaTeX source code from PDF output.


Note: This post will be based on http://robjhyndman.com/hyndsight/texstudio-sumatrapdf/ . But since it was published in 2011, there are some slight changes in software menus. You may also read it. 

1 - Open TexStudio. Navigate Options -> Configure TeXstutdio...

TeXstudio options
Configure TeXstudio...


2 - Click Commands tab, and find External PDF Viewer option.
External PDF Viewer
External PDF Viewer
3 - Change it like:

"C:/Program Files (x86)/SumatraPDF/SumatraPDF.exe" -reuse-instance %.pdf

You should put your path to SumatraPDF.exe between quotation marks.

Update (08 Feb 2015): I use pdflatex. According to Vojtech Vozda (see comments), if you use DVI -> PS ->PDF chain you should also add -synctex=1 option to LaTeX part as in PdfLaTeX option in order to create search link between your source code and PDF file. See also: What exactly is SyncTeX?

4 - Click Build tab, find PDF Viewer option and change it to External PDF Viewer.
Use External PDF Viewer
Use External PDF Viewer
5 - At same window, locate User Commands tab.

User Commands
User Commands

Add the following statements:


user0:Forward Search

to first column and

dde:///"C:/Program Files (x86)/SumatraPDF/SumatraPDF.exe":SUMATRA/control/  [ForwardSearch("?am.pdf","?c:am.tex",@,0,0,1)]

to second column.

You should put your path to SumatraPDF.exe between quotation marks.

Click OK.

6 - Now let's open Options -> Configure TeXstutdio...  again and select Shortcuts tab. ExpandMenus -> Tools -> User tree. Now you should see a user command called Forward Search. Now its default shortcut is Alt+Shift+F1. But you can also assign another shortuct to forward search likeF2. But this step is optional.
User Commands Shortcut
User Commands Shortcut
7 - Now we are done with TeXstudio. Let's set up SumatraPDF. Open SumatraPDF. Click Settings -> Options.
Sumatra Settings
Sumatra Settings
8 - Locate Set inverse search command-line.
Sumatra Inverse Search
Sumatra Inverse Search
Type:


"C:\Program Files (x86)\TeXstudio\texstudio.exe" "%f" -line %l

You should put your path to texstudio.exe between quotation marks.

Click OK and exit.

Now let's try your new setup.

Compile a LaTeX code in TeXstudio and produce PDF output. If you press F2 (if you assign that shortcut in TeXstudio settings), SumatraPDF should highlight corresponding output of your cursor position. In SumatraPDF, double-clicking shows corresponding LaTeX code in TeXstudio.

1 comentario:

  1. El Blog Del Latex Fino: Latex, Beamer Y Otras Cosas Útiles By The Latex Expert!: Create Search Link Between Texstudio And Sumatrapdf >>>>> Download Now

    >>>>> Download Full

    El Blog Del Latex Fino: Latex, Beamer Y Otras Cosas Útiles By The Latex Expert!: Create Search Link Between Texstudio And Sumatrapdf >>>>> Download LINK

    >>>>> Download Now

    El Blog Del Latex Fino: Latex, Beamer Y Otras Cosas Útiles By The Latex Expert!: Create Search Link Between Texstudio And Sumatrapdf >>>>> Download Full

    >>>>> Download LINK 29

    ResponderEliminar