TransWikia.com

TexStudio forward- and inverse search with build in and Sumtra PDF

TeX - LaTeX Asked on July 27, 2021

There is so much about forward- and inverse search in the net – first it worked with the configurations I found online. But now it does not even work with the build in Viewer after deleting the ini to go back to the standard option.

My setup: Windows 10, TexStudio, Build in Viewer , Sumtra PDF.
Under Commands, External PDF Viewer I put: “C:/Program Files (x86)/SumatraPDF/SumatraPDF.exe” -reuse-instance -inverse-search “”C:texstudio/texstudio.exe” “%%f” -line %%l” -forward-search “?c:am.tex” @ “?am.pdf”

It sill jumps to random places – with both viewers. What option do I need?

(I also fixed my name of a .tex file that included in _ to -. No change to the better.)

2 Answers

I found Alper Yazar's blog helpful. Below is a brief summary:

Step 1. Open configurations - TexStudio >> Options >> Configure TeXstudio... Step 2 Commands >> External PDF Viewer:

"C:Program FilesSumatraPDFSumatraPDF.exe" -reuse-instance %.pdf

Step 3a. Build >> PDF Viewer >> External PDF Viewer

Step 3b. Build >> User Commands >> Add

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

Step 4. Shortcuts >> Menus >> Tools >> User: change current shortcut to F2

Step 5. SumatraPDF >> Settings >> Options >> Set inverse search command-line

"C:/Program Files/texstudio/texstudio.exe" "%f" -line %l

Notes: (1) Please adjust paths according to your installation; (2) do not forget quotation marks in step 5; (3) I used SumatraPDF v3.2 64-bit and TeXstudio 3.1.1; (4) in TeXstudio tex-code press F2 to jump to SumatraPDF [forward-search], in SummatraPDF double-click in text to jump to TeXstudio [inverse-search]; (5) if needed: TeXstudio has forward and inverse search, i.e. (a) undo step 3a [use internal viewer] (b) right-click in tex code and select "Go to PDF" (c) in PDF right-click + Go to Source

Answered by Wolfgang on July 27, 2021

The following -- rather simple -- setup works for me. In TeXstudio, under Options > Configure TeXstudio > Commands, I set External PDF Viewer to

C:/Program Files/SumatraPDF/SumatraPDF.exe" -forward-search "?c:am.tex" @ "?am.pdf"

and in SumatraPDF, under Settings > Options, I set Set inverse search command-line to

C:Program Files (x86)TeXstudiotexstudio.exe "%f" -line %l

This works even for filenames containing dashes, underscores, spaces, umlauts and other such things. You may need to adjust those paths, of course.

Answered by chsk on July 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP