I went to the 'Help' section of evince and found out about Synctex. The instructions online say that you should install the whole gedit-plugins
, however my solution involved installing only gedit-plugin-synctex
. So I ran:
apt-get update && apt-get upgrade
sudo !!
apt-get install gedit-plugin-synctex
Then thanks to this link, I was able to find the location of the Synctex files. The gedit plugin files, in general, are located at
/usr/lib/x86_64-linux-gnu/gedit/plugins/
There, you should find the Synctex folder, and inside it you should find the file evince_dbus.py
.You can now continue with the official instructions. I copied the file to the folder ~/texlive/2019/bin/x86_64-linux
because it was in the $PATH
. To find which folders are in your $PATH
, you can run echo $PATH
on the terminal.
Now, you have to add some fixes. Ubuntu 18 does not include the python
command, and instead the default is python3
. Also, the evince_dbus.py
file is written in python3 (you can verify this by looking at the code lines that use print
. In python3, print is a function so the argument goes in parentheses.), so you can use python3 to run the file. You need to open the file first, which can be done with:
vim evince_dbus.py
Then, you go to the first line, which is the shebang line, and add a 3
at the end, so python
will become python3
. Then, on the line 165, you delete the necessary characters to get:
input_file = sys.argv[3]
path_output = output_file
path_input = os.getcwd() + '/' + input_file
And that is it.You should now be able to do forward searching with the command \ls
.