SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 366 forks source link

evince + ST3: inverse search not working #791

Closed chan-y-park closed 8 years ago

chan-y-park commented 8 years ago

Hi,

I am trying to use LaTeXTools for the first time; I successfully installed it and forward search works fine. However, when I try to do inverse search by using Ctrl+click on evince, nothing happens.

I tried looking into the messages coming from running dbus-monitor member=SyncView, but unlike an instance of an forward search, where I get the following messages,

signal sender=org.freedesktop.DBus -> dest=:1.113 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.113"
method call sender=:1.118 -> dest=:1.114 serial=6 path=/org/gnome/evince/Window/0; interface=org.gnome.evince.Window; member=SyncView
   string "/home/chan/osx_home/Dropbox/Research Notes/ADE spectral network and 2d BPS spectra/ade_2d_v4.tex"
   struct {
      int32 529
      int32 1
   }
   uint32 1469563837
method call sender=:1.120 -> dest=:1.114 serial=6 path=/org/gnome/evince/Window/0; interface=org.gnome.evince.Window; member=SyncView
   string "/home/chan/osx_home/Dropbox/Research Notes/ADE spectral network and 2d BPS spectra/ade_2d_v4.tex"
   struct {
      int32 532
      int32 1
   }
   uint32 1469563844
method call sender=:1.137 -> dest=:1.132 serial=6 path=/org/gnome/evince/Window/0; interface=org.gnome.evince.Window; member=SyncView
   string "/home/chan/osx_home/Dropbox/Research Notes/ADE spectral network and 2d BPS spectra/ade_2d_v4.tex"
   struct {
      int32 529
      int32 1
   }
   uint32 1469564010

I don't get any message when I try Ctrl+click on evince.

I checked if python-dbus is installed, and it is installed. Now I don't know what to try. Could you give me some help?

chan-y-park commented 8 years ago

Oh, and I also double-checked sublime option and set it to subl, which works on the command line.

ig0774 commented 8 years ago

For the most part the sublime setting is usually ignored these days. We have some code that does a reasonable job of auto-detecting the sublime executable. That said, if you're on ST2 and you didn't install Sublime using one of the available packages, please ensure that subl is in /usr/bin or /usr/local/bin (using Unity, ST gets launched from the X Windows environment, which uses the /bin/sh shell whose configuration may not match that of your shell).

Assuming it's not that...

The other (slightly esoteric) package we require is either python-gobject or python-gi (or the corresponding python3 versions; if you use those, however, you must have python3-dbus installed as well). One of these is installed by default if you're using a GNOME desktop environment or just have libglib-2.0.0 installed. Basically, it should be safe to assume you already have this. If not, you'll want to install python-gi if your distro and version runs GNOME 3.2.x+ or python-gobject otherwise.

Once you've checked that, the best thing to do is to try manually running the backward search machinery. To do this, cd to the LaTeXTools directory. This is probably something like: ~/.config/sublime-text-3/Packages/LaTeXTools/evince (obviously change -3 to -2 if you're using ST2). From there you can just run the evince_sync script like this:

/bin/sh evince_sync python subl /path/to/pdffile.pdf

This will open Evince with the specified PDF file and should print a message when you ctrl+click in Evince and, hopefully, open ST. If you get to this point, you'll hopefully get some info that you can use either to solve things yourself or report back here and we'll try to get you up and running.

ig0774 commented 8 years ago

PS I apologise for the wall of text, just trying to cover the bases.

chan-y-park commented 8 years ago

Thanks for the detailed instruction! Let me first say that I am using ST3 as I denoted in the title of the issue, and am using python2. All these are being done on Ubuntu 14.04, which is running on Parallels 10 on OS X 10.9.5.

So I followed all the instructions, and after running the command I do get the PDF opened. However, there is no sync nor message I get when I try Ctrl+click. But there is one difference from your instruction, which is that ST is not opened when I run the command. Probably this tells something about this problem? Seems that my system is stuck in a very weird situation.

By the way, I just built another (pure) Ubuntu system, so I can try doing the same on the system and if it works there, then it may be due to the virtual machine issue --- maybe Parallels is doing something over Ctrl+click event?

ig0774 commented 8 years ago

Sorry I missed the ST3 thing.

It occurs to me that ctrl+click on OS X is usually interpreted as a right-click, since some laptop models didn't have the "secondary click" functionality. What that means is that your Linux virtual machine may be seeing a right-click instead of ctrl+click, so it's not even trying to run the SyncSource bit. I'm not familiar with Parallels, but I'm sure there's an option that will allow you to prevent it from treating ctrl+click as a right-click event.

chan-y-park commented 8 years ago

So I tried doing the same thing on Ubuntu 16.04 + ST3 and everything works great! Unfortunately I couldn't figure out how to make it work on Parallels, I searched through its preferences and checked off suspected features but nothing worked. I am pretty sure that the blame is on the virtual machine's side, so let me close this issue.