I use [1] vimtex
, a vim plugin
that provides support for writing and compiling LaTeX
documents and [2] zathura
as the document viewer.
In the beginning, I was determined to stick to [3] MuPDF
as the PDF viewer due to its fast and complete features despite being small and lightweight but I kept encountering unpleasant experiences while compiling documents where it always froze the screen of my laptop when I closed the viewer. As such, I then decided to just use zathura
that was built from source as I would like it to have both
synctex-forward-search
and synctex-backward/inverse-search
worked properly.
So basically, in order to have a complete functional zathura
that enables full support of synctex
, I need the below dependent
packages (as available on Arch or in the official website of zathura itself) installed first before compiling it from source
:-
synctex
);zathura
itself); &I then downloaded the latest version of [4] zathura
(currently is 0.4.7), extracted it to ~/build
directory, and run make install
to install.
Now, how to do the synctex-forward-search
and synctex-backward-search
in zathura
when compiling .tex documents with latexmk
(the default compiler for vimtex
)?
synctex-forward-search
: Go to nvim (if using this editor) where the .tex doc is opened and point to the sentence we would like to see in zathura, and then press \lv
.zathura
, it brings us to the page containing the sentence we previously pointed from nvim.synctex-backward/inverse-search
: In zathura, press Ctrl + highlight
(Left Click and select the word with touchpad/mouse), the cursor will then automatically be pointed to the front line of the .tex file in nvim where it contains the word highlighted from zathura.
Watch the video below to see it in action (updated on 24 September 2020, and the editor used is VIM).
Zathura
can be customized with a simple config file. Save the config file as zathurarc
in ~/.config/zathura
directory, like the one I have [here].
Related configuration files are as follows:-