Bug 306844

Summary: Shift+Click should process source references even in selection (or zoom) mode
Product: [Applications] okular Reporter: Christoph Lange <langec>
Component: PDF backendAssignee: Okular developers <okular-devel>
Status: RESOLVED DUPLICATE    
Severity: wishlist CC: aacid, michel.ludwig
Priority: NOR    
Version: 0.15.1   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: TeX source for pdflatex
PDF output from pdflatex
Sync file from pdflatex
TeX source for lualatex
PDF output from lualatex
Sync file from lualatex

Description Christoph Lange 2012-09-15 14:40:03 UTC
When opening a PDF file created with the synctex feature of pdflatex or lualatex, Okular no longer supports inverse search, i.e. it does not respond to Shift+Click.

(Note, I didn't find any corresponding entry in the “configure shortcuts” dialog – could that mean my configuration is broken?)

To make sure that it is not a problem with invoking my editor, I set the command line for the “custom text editor” to “kdialog --msgbox %l”.

BTW, I _think_ that inverse search should work regardless how Okular has been started. If step (1) below shouldn't work for you, try to start Okular by forward search, e.g.

okular --unique 'file:///home/clange/tmp/test-lua.pdf#src:3/home/clange/tmp/./test-lua.tex'

Reproducible: Always

Steps to Reproduce:
1. Open the attached file test-lua.pdf (or test-pdf.pdf) in Okular.
2. Go to some page, do a Shift+Click on some text.
Actual Results:  
Nothing happens

Expected Results:  
Okular should open the TeX source in some editor.
Comment 1 Christoph Lange 2012-09-15 14:40:47 UTC
Created attachment 73940 [details]
TeX source for pdflatex
Comment 2 Christoph Lange 2012-09-15 14:41:16 UTC
Created attachment 73941 [details]
PDF output from pdflatex
Comment 3 Christoph Lange 2012-09-15 14:41:34 UTC
Created attachment 73942 [details]
Sync file from pdflatex
Comment 4 Christoph Lange 2012-09-15 14:41:52 UTC
Created attachment 73943 [details]
TeX source for lualatex
Comment 5 Christoph Lange 2012-09-15 14:42:12 UTC
Created attachment 73944 [details]
PDF output from lualatex
Comment 6 Christoph Lange 2012-09-15 14:42:28 UTC
Created attachment 73945 [details]
Sync file from lualatex
Comment 7 Christoph Lange 2012-09-15 14:43:32 UTC
I should add that I'm using the following program versions to generate the PDF and sync files:

$ lualatex --version
This is LuaTeX, Version beta-0.70.1-2012081406

$ pdflatex --version
pdfTeX 3.1415926-2.4-1.40.13 (TeX Live 2012)
Comment 8 Michel Ludwig 2012-09-15 15:59:41 UTC
When I open your document "test-pdf.pdf" with Okular (after having copied the synctex file as well) and do Shift+click, Okular prints on the console:

Okular::Document::processSourceReference: No such file: "/home/clange/tmp/./test-pdf.tex"

Then, after creating a file at this location, it is opened correctly. So, everything works fine with this file here with Okular from the master branch.

Was your original document located in the directory indicated above?
Comment 9 Christoph Lange 2012-09-15 16:24:41 UTC
Thanks, Michael! – below please find a reply to your comment.

But first of all, note that my bug report turned out to be invalid (sorry!), or at least its title and description should be changed. It turned out that I had the text selection tool (Ctrl+4) enabled when the “bug” occurred. With the hand tool (Ctrl+1) it works.

Now the question is whether that's a bug or a feature. One might argue that for navigating through a document, including navigating from the document to its source code, the hand tool is the right one. On the other hand, does Shift+Click do anything useful with the other tools? If not, one could consider enabling inverse search in these cases as well, as Shift+Click wouldn't shadow any keybindings recognized by these other tools. – For example, I tried the selection tool (Ctrl+3) and had Shift pressed while selecting. This didn't change the selection behavior (as it would do in some other programs, e.g. selecting squares instead of rectangles – which of course wouldn't make that much sense in PDFs).

(In reply to comment #8)
> Okular::Document::processSourceReference: No such file:
> "/home/clange/tmp/./test-pdf.tex"
Oh – sorry, …
> Was your original document located in the directory indicated above?
… but, indeed. I forgot that the source file location ends up hard-coded in the sync file. I should have run my test in a directory that exists everywhere, e.g. /tmp.

Good point about console error messages: It might have helped my investigations if I had got any, but I didn't.
Comment 10 Michel Ludwig 2012-09-16 11:17:41 UTC
Ok, I've changed the title. But Albert has to decide whether this is acceptable for Okular or not ;)

Console debugging output can usually be enabled with "kdebugdialog".
Comment 11 Christoph Lange 2012-09-16 11:37:33 UTC
great, thanks for your help!
Comment 12 Albert Astals Cid 2012-09-16 13:55:45 UTC

*** This bug has been marked as a duplicate of bug 306886 ***