jaliste / gedit-synctex-plugin

The gedit-synctex-plugin now lives in the gedit-plugin repository in gnome git (branch gnome-2-32)
6 stars 1 forks source link

Status of the plugin #1

Open towolf opened 14 years ago

towolf commented 14 years ago

This plugin is not for general consumption yet, is it?

jaliste commented 14 years ago

Thanks for your interest, the plugin is not yet ready. I will release and make a proper webpage when it's ready for general consumption.

towolf commented 14 years ago

Thanks. I’ll wait.

I compiled Evince 2.31.6 yesterday and wanted to try this out. Related to this, having a DBus interface sure seems like the right implementation, but what will the people do who are using a traditionally text based editor, like Vim or Emacs? Would they need a proxy, like for instance a python script, that deal with the DBus communication?

jaliste commented 14 years ago

That's exactly my idea. Actually the python script is more or less done (see evince_dbus.py), Please keep in mind that there is one patch for evince that is not in git master yet (nor in 2.31.6)

jaliste commented 14 years ago

Just to let you know, I updated the evince_dbus.py script and now there is ForwardSearch support between vim and Evince. Please see http://wiki.github.com/jaliste/gedit-synctex-plugin/ if you want to try it.

towolf commented 14 years ago

I get this error:

towolf@ovo:/tmp$ ~/src/TeX/gedit-synctex-plugin/synctex/evince_dbus.py  document.pdf 20 document.tex
ERROR:dbus.connection:Unable to set arguments ('file:///tmp/document.pdf', True) according to signature u's': : Fewer items found in D-Bus signature than in Python arguments
Traceback (most recent call last):
  File "/home/towolf/src/TeX/gedit-synctex-plugin/synctex/evince_dbus.py", line 117, in 
    a = EvinceController('file://' + path_output, True )
  File "/home/towolf/src/TeX/gedit-synctex-plugin/synctex/evince_dbus.py", line 36, in __init__
    self._get_dbus_name()
  File "/home/towolf/src/TeX/gedit-synctex-plugin/synctex/evince_dbus.py", line 42, in _get_dbus_name
    self.dbus_name = EvinceController.daemon.FindDocument(self.uri, self.spawn, dbus_interface = "org.gnome.evince.Daemon")
  File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 68, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/pymodules/python2.6/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 610, in call_blocking
    message.append(signature=signature, *args)
TypeError: Fewer items found in D-Bus signature than in Python arguments
jaliste commented 14 years ago

yes. there is on patch for evince that has not landed yet. You need to apply that and do the trick described in the wiki so evince daemon can spawn new instances of evince https://bugzilla.gnome.org/attachment.cgi?id=167133

towolf commented 14 years ago

Thanks. I hadn’t seen the Wiki yet.

It seems to work okay. However I see a small number of issues.

jaliste commented 14 years ago

Thanks for testing. I just pushed the first working version of the gedit plugin, which works much better than the vim-latex with the evince_dbus script (my main focus is on the plugin). Backward search is not working yet.

towolf commented 14 years ago

Let’s look at standalone synctex command line tool as distributed by TexLive first. It seems it is broken in terms of column mapping?

It’s clear that we cannot yet get the column in BackwardSearch. That has been a limitation in SyncTeX itself from the beginning.

But it used to be possible to map from linenumber:columnnumber to PDF precisely. Now using only the synctex command from Texlive 2009 and 2010 I always get the same single-line box. This used to be different. I haven’t used SyncTeX for a while so I can’t say when this changed.

I get the same output for column 1 and column 300

synctex view -i 6:1:paragraphs.tex -o paragraphs.pdf -x "echo %{output} page: %{page+1} %{h} %{v} %{width} %{height}"
This is SyncTeX command line utility, version 1.2
SyncTeX: Executing
echo paragraphs.pdf page: 1 133.768354 136.701781 343.711073 8.800175
paragraphs.pdf page: 1 133.768354 136.701781 343.711073 8.800175

synctex view -i 6:300:paragraphs.tex -o paragraphs.pdf -x "echo %{output} page: %{page+1} %{h} %{v} %{width} %{height}"
This is SyncTeX command line utility, version 1.2
SyncTeX: Executing
echo paragraphs.pdf page: 1 133.768354 136.701781 343.711073 8.800175
paragraphs.pdf page: 1 133.768354 136.701781 343.711073 8.800175

I wonder what’s going on.

This is my test document:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\begin{document}

Mauris id velit dolor, quis cursus magna. Suspendisse potenti. Pellentesque suscipit lectus augue, nec venenatis dui. Proin vel justo pulvinar urna volutpat varius. Phasellus eget eros sit amet diam venenatis ullamcorper. Suspendisse sit amet leo ac leo fermentum vulputate at id neque. Pellentesque vitae dui enim. Phasellus congue placerat velit. Nunc mollis fermentum arcu, vel tempus nisi sagittis eu. Vivamus blandit rhoncus orci et luctus.

Sed id rutrum justo. Suspendisse scelerisque tortor eu orci varius bibendum. Suspendisse potenti. Vestibulum et augue dapibus enim pellentesque adipiscing. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ac arcu vel lectus auctor hendrerit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Etiam et scelerisque quam. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec ornare sollicitudin libero a ultricies. Nulla vel tellus sem. Vivamus in tempus metus. Donec molestie rhoncus elit a posuere. Suspendisse facilisis, nibh eu luctus ultricies, nunc leo feugiat augue, vel fringilla dolor leo ac nunc. Aliquam nisl nisi, imperdiet quis lacinia nec, faucibus et massa. Duis hendrerit placerat orci, non placerat neque dignissim sed. Lorem ipsum dolor sit amet, consectetur adipiscing elit. In at ipsum vel augue volutpat dignissim non sed tortor. Cras viverra neque vel tortor pretium ullamcorper.

\end{document}
jaliste commented 14 years ago

Well, when I use the synctex parser library instead of the synctex command line, I get a list of rectangles corresponding to the line. So if you have one- line .tex paragrah, you will get a list of rectangles for each of the lines of the paragraph in the pdf. Currently, we only highlight the first. So, maybe it's better to highlight all. I do not know how to get forward search column precision (although I've seen it in Mac!)

towolf commented 14 years ago

It appears my memory was failing me. This has never worked. Jerome just wrote me this:

Actually, the synctex file format takes into account the column number but it is not used. Unfortunately, no TeX engine keeps track yet of the column number such that no relevant column information is available. I did not work very hard but my first impression is that adding column management in TeX itself is not straightforward. It seems I will not have enough time to develop this feature by myself so we must wait for someone else to do the dirty job!

I added column support to synctex because it was not really difficult and it allowed to anticipate an eventual > enhancement of the TeX engine without breaking the synctex file format.

What you propose is what Texworks is doing. They highlight the whole paragraph for a long line.

What Jerome does with his TexMac solution is to send some surrounding context words to achieve more precision. At least the command line tool allows to specify context words.

jaliste commented 14 years ago

Well, after looking at the code, I think we will stick with the current functionality as we are in feature-freeze. I will look into the two solutions once we branch for gnome 3.0

jaliste commented 14 years ago

Just FYI, it's easy to mark the paragraph if it's going to be in one page of the pdf. However, once you have the result in two different pages, the current implementation breaks (and I am not clear what the behavior should be). When you have the time, please file a bug in evince so I won't forget this ;)

towolf commented 14 years ago

Ok. Done.