Friday, August 13, 2010

SyncTeX support in Gnome 2.32

In the 2.32 release, Gnome is getting SyncTeX support. For those of you that don't use LaTeX, SyncTeX is a method (created by Jêrome Laurens) that enables synchronization between the TeX source file and the resulting Pdf or Dvi output. Here the required screencast.



So to implement SyncTeX in Gnome, together with Carlos Garcia Campos we added SyncTeX support to evince and exported a new DBUS API so editors can communicate with Evince. Next, I added a "synctex" plugin for gedit, to use the DBUS API exported by Evince. We support both Backward Search (Evince to Gedit synchronization) and Forward Search (Gedit to Evince synchronization).

We also added a new modeline parser, so if you add a complex project with several TeX files you can put
% mainfile: mainfile.tex
either in the first or last three lines of each included TeX file, and ForwardSearch will just work (BackwardSearch should always work, even if you don't add the modeline).

17 comments:

  1. Excellent. Will this be a separate plugin in gedit-plugins, or will this be included in gedit natively?

    ReplyDelete
  2. Jim, the synctex plugin will be included in gedit-plugins module

    ReplyDelete
  3. Does this play together with Michael Zeisig's LaTeX plugin?

    Also, you should have a Flattr button on your blog :-)

    ReplyDelete
  4. Alexander, it currently does not, but I hopefully will find the time to fix that soon.

    ReplyDelete
  5. Does it easily work with Emacs?

    ReplyDelete
  6. What excactly is needed for this?
    Evince 2.32?
    gedit 2.32?

    I am asking because in Ubuntu Maverick is still no gedit 2.32, just 2.30 :(

    ReplyDelete
  7. looks like there will not be a gedit 2.32 (gedit mailing list), but there will be gedit plugins 2.32.

    ubuntu maverick already has evince 3.32, but not gedit plugins 2.32. i install gedit plugins 2.32 from source. enabled the synctex plugin in gedit. added '-synctex=1' to the pdflatex command. this made a main.synctex.gz file. however click on things in gedit or evince does nothing. what do i need to do?

    ReplyDelete
  8. @samtygier, as Tiffany point out, you need to do Ctrl+Click. There is also a Forward Search item in the tools Menu that does exactly the same.

    @Mo, unfortunately, gedit-plugins-2.32 is not packaged for Ubuntu Maverick. I will try to add a ppa for the plugin asap.

    @rvb, currently, only gedit is supported AFAIK, although it should be easy to make a plugin for emacs.

    ReplyDelete
  9. Jalist'

    Thank you so much for this, I have been waiting for such a functionality for a long time. Unfortunately, maverick does not package gedit-plugins-2.32, as you have noted. even the current version for natty is gedit-plugins-2.30. If you find any work-around for this (I am scared to compile the thing myself - ubuntu can be weird sometimes) please, please let us know.

    ReplyDelete
  10. @coxackie, you just download the gedit-plugins-2.32.0.tar.gz package and copy the files and directories inside plugins/synctex directory to your ~/.gnome2/gedit/plugins/ directory (create it if it does not exist), then you copy the synctex.gedit-plugin.in to synctex.gedit-plugin and you should be done.

    Unfortunately, I don't have the time to package gedit-plugins for Ubuntu (the plugin works on gedit-2.30)

    ReplyDelete
  11. Hi Jalist,

    thank you for let available this nice plugin.
    I am trying to install it on my computer, but I did not understood what we should do in the last step:
    " then you copy the synctex.gedit-plugin.in to synctex.gedit-plugin and you should be done.then you copy the synctex.gedit-plugin.in to synctex.gedit-plugin and you should be done."

    I uncompress the file, went to the synctex directory but I do not found this file there.

    ReplyDelete
  12. Awesome! Forward search would also be useful as a lo-fi laser pointer replacement to highlight the line of a slide you're talking about.

    I saw the note in the Gnome Journal article that you're planning a Telepathy-based online presentation assistant thing using this—sounds great, I'd love to have such a tool. Do drop by #telepathy or the Telepathy mailing list if you need any advice with the Telepathy side of things!

    ReplyDelete
  13. I just downloaded the latest gedit-plugins from the Natty repos and synctex support isn't there. What's the deal?

    ReplyDelete
  14. Lumpy, I don't have any relation with Ubuntu, so I don't know... Probably, their gedit-plugins is not depending on dbus-python, so the synctex plugin is not getting included in the compiled deb.

    ReplyDelete
  15. Or also yo might need the packages from the GNOME 3 ppa

    ReplyDelete