Bug 159074 - Implement DVI specials as in KDVI
Summary: Implement DVI specials as in KDVI
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR wishlist
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 185134 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-10 16:45 UTC by Torquil Macdonald Sørensen
Modified: 2009-03-23 20:45 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Torquil Macdonald Sørensen 2008-03-10 16:45:47 UTC
Version:            (using KDE 4.0.2)
Installed from:    Debian testing/unstable Packages

KDVI has a configuration section called "DVI Specials". Many LaTeX users use this together with the srcltx latex-package to be able to click in DVI files with the middle mouse button so that e.g. kile or kate then will jump to the correct position in the LaTeX source file. If okular will completely replace kdvi, then I'm hoping this functionality will not disappear.

Best regards,
Torquil Sørensen
Comment 1 Pino Toscano 2008-03-12 10:01:03 UTC
Are you referring to the inverse search?

Mostly it's there (core library speaking), what it needs are the following:
a) a good way to trigger them easily (right now you can with Shift+Left Mouse Button, but you have to be quite precise in clicking in the points)
b) possibly a UI to configure the editor (right now the default is Kate, but optionally configurable to be any editor)

(Changing the component to 'general' as the DVI backend already provides all the data.)
Comment 2 Christian Trippe 2009-01-22 08:25:29 UTC
b) is implemented with okular from KDE4.2 RC, but I could not figure out a way to trigger the inverse search.
Comment 3 Yevgen Muntyan 2009-01-26 10:11:15 UTC
This bug is really bad. You can view files in a gazillion different programs, but kdvi was the only functional dvi previewer with inverse search.
Comment 4 Pino Toscano 2009-01-26 10:18:06 UTC
> but I could not figure out a way to trigger the inverse search.

Shift+left mouse button click. Although you still have to be precise.
Comment 5 Yevgen Muntyan 2009-01-27 04:22:16 UTC
I have tried shift-clicking everywhere - from the top of the page, line by line, from left to right - nothing. What exactly do you need to click?
Comment 6 Vít Tuček 2009-01-28 09:05:29 UTC
As I'm working with LaTeX quite a lot I really need this feature. So far I can fallback on kdvi, but it's not very convenient.
Comment 7 Philipp Woelfel 2009-02-04 08:02:54 UTC
I tried Shift+LMB, too, but without success. I use opensuse KDE4.2 packages.

I'd really like to see this feature working in okular. Or even better, inverse search from PDF documents (e.g. pdfsync). Any testing help needed? Just let me know what to do...
Comment 8 Alet Roux 2009-02-17 16:52:35 UTC
It would be great to have this working as in kdvi - it's a real regression from 3.5 and a real shame.

I have tried Shift-LMB, LMB-Shift in 4.2, many other combinations, everywhere on the page, but cannot get this to work at all. If accuracy is required, maybe a solution could be to display the points (maybe with a small circle) so that the user knows where to click? I am happy to assist with testing too, if needed.
Comment 9 Jan Kaspar 2009-02-18 16:18:33 UTC
I even offer a help in implementation. However, my free time is very limited. Is there some small part where I might help out?
Comment 10 Thomas Braun 2009-03-22 14:09:29 UTC
Hi,

I had a look at the source code (branch 4.2) and have some questions if I understood it correctly.

- kdegraphics/okular/generators/dvi/dviRenderer.cpp:
Does parseReference(...) get called on inverse search?
Because here I could not find any place where it get called.

- Judging from the comment in dviRenderer.cpp:621 the format is supposed to be src:1111Filename which at least on my system is wrong.
Here it is "src:1111 Filename" where Filename ends with .tex (and before Filename is a space). I have here TexLive2007 on debian lenny and latex called with -src-specials.

- Where is Shift + LMB set for inverse search in the sourcecode? I could not find that.

Thanks a lot,
Thomas (member of kile dev team)
Comment 11 Luigi Toscano 2009-03-22 16:16:47 UTC
(In reply to comment #10)
> - kdegraphics/okular/generators/dvi/dviRenderer.cpp:
> Does parseReference(...) get called on inverse search?
> Because here I could not find any place where it get called.
> 
> - Judging from the comment in dviRenderer.cpp:621 the format is supposed 
> to be src:1111Filename [...]
That code is not used anymore. It's a leftover of the kviewshell infrastructure (the dvi generator was adapted from the kdvi code). Anyway, in the kdvi code it is used only by the jumpToReference method (dcop interface) which takes an encoded string (as explained in the comment) as input.

> - Where is Shift + LMB set for inverse search in the sourcecode? I could not
> find that.
See PageView::contentsMouseReleaseEvent (ui/pageview.cpp, line 1820 and following lines).
Comment 12 Thomas Braun 2009-03-22 17:38:11 UTC
(In reply to comment #11)
> > - Where is Shift + LMB set for inverse search in the sourcecode? I could not
> > find that.
> See PageView::contentsMouseReleaseEvent (ui/pageview.cpp, line 1820 and
> following lines).
Thanks for the pointer.
I tracked the problem down to SourceRefObjectRect::contains(...) in area.cpp.
And adding some debug output I realized that I never got the situation that I clicked inside the sourceObject. Although I used 400% zoom and really tried hard.
What should the calculation in the return statement of SourceRefObjectRect::contains(...) do?
Comment 13 Pino Toscano 2009-03-23 13:24:09 UTC
Ok, now the inverse search should require less precision and thus be actually usable.
The fixes have been backported to KDE 4.2.2. I consider the problem mostly solved (thus closing this bug), so for further issues please open a new report.
Comment 14 Pino Toscano 2009-03-23 13:26:43 UTC
*** Bug 185134 has been marked as a duplicate of this bug. ***
Comment 15 Thomas Braun 2009-03-23 20:45:08 UTC
Thanks a lot Pino.
I just tried it and it works like a charm now.