0

The document reader Zathura supports synctex forward and backwards search when working with LaTeX documents. The backwards (from Zathura to the editor) search is set through the --synctex-editor-command flag or set synctex-editor-command in the zathurarc config file.

I cannot get the backwards search to work when I set the synctex-editor-command to run Visual Studio Code. For example, I

set synctex-editor-command "code --reuse-window -g %{input}:%{line}"

and Ctrl+click the document does not do anything.

The setting works with some other editors, for example with

set synctex-editor-command "gvim --remote-silent +%{line} %{input}"

and it works. Even with something simple like

set synctex-editor-command "gedit"

(or "gvim"), Ctrl+click would open the specified editor (with a black document) as expected, but not with the command "code".

The man page for Zathura says that the functionality works via the D-Bus interface, which I don't know anything about.

Is it possible to fix this on my side?

I'm using Ubuntu 20.04 (with zathura 0.4.5 as provided by the repo), but a quick trial on the Fedora liveboot suggests that it's the same there.

1 Answer 1

1

--no-sandbox will solve it.

Try with zathura -x "code --no-sandbox -r -g %{input}:%{line}" your_file.pdf.

Configuration for latex-workshop VSCode plugin:

    "latex-workshop.view.pdf.external.viewer.command": "zathura",
    "latex-workshop.view.pdf.external.viewer.args": [
        "--synctex-editor-command",
        "code --no-sandbox -r -g %{input}:%{line}",
        "%PDF%"
    ],

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.