2

I am using TexMaker of Karmic Ubuntu with Okular. I use pdfLatex to compile and I view the PDFs in Okular. How can I configure Okular to inverse search with TexMaker? I have tried the following code:

texmaker %f -line %l

but it does not work. I have tried double clicking, ctrl+click, shift+click, ctrl+shift+click, ctrl+alt+click, alt+shift+click, still nothing. Perhaps I simply don't know what the action is to initiate the inverse search from within Okular.

How can I configure Okular to inverse search with TexMaker?

KBP
  • 1,500
  • 2
  • 14
  • 14
  • What do you mean by inverse search? You want to highlight text in the PDF and then search for that text in the .tex file? What's wrong with `ctrl+c alt+tab ctrl+f ctrl+v` (assuming ctrl+f is the shortcut for "find") – Seamus Mar 30 '10 at 11:48
  • This is one way I can do it, but a rather tedious way. In Most Latex editors and pdf viewers there is a way to click on the text in the pdf or dvi which places your cursor over that exact column and row of the source Tex file. This is especially useful for editing your paper. – KBP Mar 30 '10 at 14:24
  • Hello, I know it's been ages but I am facing the same issue, I cannot make inverse search from Okular to Texmaker to work. How did you end up solving this issue? I applied all solutions below. Thanks! – Christina V Jul 24 '23 at 08:25

6 Answers6

5

The inverse search in okular is initiated by pressing shift+left_mouse_button. Before you can use it you need to enable synctex or pdfsync (predecessor of synctex) in your LaTeX editor. Synctex can be enabled by extending the pdflatex command line by "-synctex=1".

Furthermore, you need an appropriate version of okular that supports synctex, e.g. 0.11.1. Version 0.10.2 as mentioned by Niall Murphy seems to support synctex only for the forward search, but not for the inverse search.

It is very hard to say in which version the inverse search was added, since even the official websites claim that it is still not implemented:

Stefan Endrullis
  • 4,150
  • 2
  • 32
  • 45
3

Shift click does not work in Okular if you are not in Browse mode (if the mouse pointer is an arrow or a cross you're not in Browse mode).

Solution: first select Browse in the toolbar (Settings | Show Toolbar) the mousepointer changes to a hand, and Shift click should work.

Gertjan
  • 31
  • 1
2

Okular's page says it only supports pdfsync, which is the older of the two inverse search technologies. Go to configure in Okular, and make sure your editor is set to texmaker. Then ensure that you have pdfsync active.

Mica
  • 18,501
  • 6
  • 46
  • 43
1

Try using this code in okular's editor menu:

texmaker -use -line %l -column %c

Works for me perfectly well.

Nick
  • 11
  • 1
0

Okular 0.10 also supports synctex which apparently works much better.

However Karmic still uses Texlive 2007 which has a buggy and broken synctex. http://itexmac.sourceforge.net/SyncTeX.html

Lucid will have TexLive 2009 which should make inverse search a lot easier.

Niall Murphy
  • 1,108
  • 1
  • 8
  • 9
  • Where did you found that synctex is already supported in okular 0.10? On the official okular websites ( http://okular.kde.org/ ) it is only mentioned that pdfsync is supported at the moment, see http://okular.kde.org/formats.php. Synctex is still on the features plan: http://techbase.kde.org/Schedules/KDE4/4.3_Feature_Plan I'm using okular 0.10.2 and it is (unfortunately) not able to perform an inverse search on pdfs with synctex support. – Stefan Endrullis Nov 11 '10 at 09:58
0

I'm running Ubuntu in a VirtualBox, and you have to hold the click for an instant (don't let go right away) for this to work.

Perhaps this is because of the VirtualBox behavior, or perhaps it's a quirk of Okular in the way it detects the Shift+Left-Mouse-Button

Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111