2

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

3

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 Files\SumatraPDF\SumatraPDF.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

1
  • Welcome to TeX.SE!
    – Mensch
    Mar 17 at 11:05
0

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)\TeXstudio\texstudio.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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.