1

OS: Ubuntu 18.04 LTS Bionic
texlive version: 2019
Vim version: 8.1 , big
Vim Plugin Manager: pathogen
Vim Plugins: vim-latex (LatexSuite)

I had changed the settings in my tex.vim file so the default compiler would be pdflatex instead of latex. After compiling tex files in vim with \ll , I tried to use forward searching with the command \ls in vim. However, that would open an evince window (evince is also called 'Document viewer') with the output PDF and two other windows with error messages.

How can I fix this?

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.