2

I am using TexStudio on Win10 platform. As external pdf viewer I am using SumatraPDF. Last night I got the new update of Texstudio 3.0.4 (64 distribution) and since then I have problems with the inverse search.

In the texstudio commands settings I inserted the line:

"C:\Users\...\AppData\Local\SumatraPDF/SumatraPDF.exe" -reuse-instance -inverse-search "\"C:\Program Files\texstudio\texstudio.exe\" \"%%f\" -line %%l" -forward-search "?c:am.tex" @ "?am.pdf"

While in Sumatra I set the inverse search command as:

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

Everything works correctly until I close Sumatra. In fact, if I close the app, the next time I run it the inverse search does not work anymore. The command line is indeed reset to

C:\Program

This means every time I open the app I have to insert the command line manually. I noticed that at startup I have the following error message:

Error loading C:\Users\...\Documents\My_tex_project_here\texstudio\texstudio.exe %f -line %l

I do not know why it is trying to set the path to texstudio over there (it's the folder of my tex project). I do not know how to solve the issue, unless to keep Sumatra always running.

2
  • 1
    Just wondering here: Any ready why you don't use the build in PDF viewer in texstudio? There is literally a button in texstudio to make the viewer external (and a button when it it runing externally that brings it back embedded)
    – daleif
    Commented Jan 18, 2021 at 12:11
  • @daleif Honestly, I do not remember for what reasons I started to use Sumatra instead of the built-in pdf viewer. Maybe for some features that were not available at that time in the built-in viewer.
    – Betelgeuse
    Commented Jan 18, 2021 at 12:55

1 Answer 1

0

Texstudio replaces a backslash escaped double quote with three double quotes. https://github.com/texstudio-org/texstudio/blob/master/src/execprogram.cpp#L46:

As of now backslash escaped double-quotes are unusable because the option Tools/SupportShellStyleLiteralQuotes causes BuildManager::parseExtendedCommandLine() to replace \" (backslash-escaped double-quotes) with """ (triple double-quotes)

The solution for this is to use single quotes around the inverse-search command instead.

So the Texstudio settings command is:

"C:\Program Files\SumatraPDF\SumatraPDF.exe" -reuse-instance -inverse-search '"C:\Program Files\TeXstudio\texstudio.exe" "%%f" -line %%l' -forward-search "?c:am.tex" @ "?am.pdf"

You must log in to answer this question.

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