I am using Okular to view LaTeX documents as I am writing them and occasionally compiling. I used to use Evince but I had a lot of trouble setting up forward/reverse searching, which is easy to do in Okular.

For doing forward searching from the text editor (I am using GVim if it is relevant) it is useful to open Okular with the --unique option so that new instances are not continually opened by forward searches.

However, I often have two different documents open in two different workspaces, in two different instances of my text editor. The result is that whichever instance of Okular was opened with --unique first ends up being used for forward search when I call it in either document. This is bad because if document A was called first and I am working on document B in a different workspace, then a forward search called for document B will jump back to the document A window.

It seems like to work around this I need to be able to have multiple windows with "--unique" and have some way of referring to which instance is really the one I want. Is there a way to do this, perhaps with some creative shell scripting? Suggestions of other workarounds would also be appreciated.

  • What editor are you using? And some details of how you set the editor up to use Okular would probably also be relevant. Personally I'm still using Evince with emacs and synctex, but since I'm mostly using Okular now, I'd like to switch to Okular. – Faheem Mitha Apr 11 '16 at 16:19
  • I'm using GVim with the vimtex package. Have you managed to get Evince to work with forward/reverse sync? I would be happy to go back to Evince if I could get those to work. – evencoil Apr 11 '16 at 22:14
  • By forward/reverse sync, do you mean changes in the editor reflect in Evince and changes in Evince reflect in the editor? – Faheem Mitha Apr 11 '16 at 22:39
  • @FaheemMitha Not changes to the document content, navigation in the document (e.g. search in the PDF, click somwhere and the cursor moves to that point in the TeX source). – Gilles 'SO- stop being evil' Apr 11 '16 at 23:01
  • @Gilles Yes, by "changes" I meant cursor movement, sorry. – Faheem Mitha Apr 11 '16 at 23:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.