[Okular-devel] [PATCH] Re: how to invoke okular with inverse search with pdf?

Oliver Heins heins at sopos.org
Wed Aug 26 10:14:37 CEST 2009


Hello Jochen, 

thank you very much for the help.  Forward Search now works with okular,
within the limitations of the two bugs.

Jochen Trumpf <Jochen.Trumpf at anu.edu.au> writes:

> (defun Okular-make-url () (concat
>   "file://"
>   (expand-file-name (funcall file (TeX-output-extension) t))
>   "#src:"
>   (TeX-current-line)
>   (TeX-current-file-name-master-relative)))

There is a little problem with your emacs-setup: If you have tex-files
in subfolders, the fully qualified url is calculated wrong.  For
instance, I have the main document ./diss.tex which includes several
files from ./Chapters/.  When I start forward-search from emacs, I will
get something like 

okular --unique file:///home/kde-devel/diss/Chapters/diss.pdf#src:231Chapters/Chapter11.tex

This should be

okular --unique file:///home/kde-devel/diss/diss.pdf#src:231Chapters/Chapter11.tex

It looks to me, like a default directory for `expand-file-name' should
be set, probably from `TeX-master-file'.  This seems to do the job:

(defun Okular-make-url () (concat
   "file://"
   (expand-file-name (funcall file (TeX-output-extension) t)
                     (file-name-directory (TeX-master-file)))
   "#src:"
   (TeX-current-line)
   (TeX-current-file-name-master-relative)))

Best regards,
 olli

-- 
Oliver Heins heins at sopos.org    http://oliverheins.net/
http://blog.overheins.net/     F27A BA8C 1CFB B905 65A8
http://scriptorium-adp.de/     2544 0F07 B675 9A00 D827
1024D/9A00D827 2004-09-24 -- gpg --recv-keys 0x9A00D827
Please avoid sending me Word or PowerPoint attachments:
http://www.gnu.org/philosophy/no-word-attachments.html


More information about the Okular-devel mailing list