Preview ‐ Linux⧸GNOME - rzukic/zed-latex GitHub Wiki

The default document viewer packaged into desktop linux distributions using GNOME (such as Ubuntu and Fedora) is called evince.

[!CAUTION] This will not work with evince installed via flatpak.

[!IMPORTANT] If having issues with next section, see issue guidance here.

Build and Preview on Save (forwards+inverse search incl.)

When working correctly, Zed will automatically build (with latexmk) and forward-search (including opening the evince window the first time) on save unless any user workspace settings for texlab specify otherwise.

  • Just save to forwards-search, the window opens on its own the first time
  • ctrl+Click to inverse-search

https://github.com/user-attachments/assets/0ec9a711-165b-4292-923d-d3d45ab7e542

[!WARNING] On save, the position of the cursor is not communicated, so the forward-search location is only an estimate based on LSP communications. See just below for more accurate forward-search using keybinds.

Manual Build and Preview

As with other PDF viewers, you can disable build+preview on save.

One could then in principle use Zed tasks for forward search, and also give them keybindings. As a by-product, the forward search will be more accurate by using the actual position of the cursor in Zed. Such tasks are likely to be added to this extension soon.

Requirements

Desktop Linux distributions using GNOME should already satisfy these requirements, otherwise check that the following are installed:

  • python3 (including its standard library) and on PATH
  • The dbus and gi python3 package (typically provided by packages named python3-dbus and python3-gi)
  • evince on PATH

Dev notes

Evince is treated quite differently from the other PDF viewers that are auto configured. The evince executable does not have a CLI interface to deal with synctex forwards+inverse searching. Instead this must be done through DBUS with a python wrapper which this extension dowloads to its "work" directory (should be $HOME/.local/share/zed/extensions/work/latex).