3

I'm using LateXTools in Sublime 3 running under elementary OS 0.3.

After compiling a .tex file, the PDF viewer Evince opens up to see the final PDF.

I want to change this to open Okular instead. I've looked around the LateXTools.sublime-settings file but couldn't find a way to do this.

Can this be done? If so, how?

3

Quoting from the README:

Only the Evince PDF viewer is supported

Which also adds the note:

I already have patches to support Okular. Indeed, Okular is very easy to support, as it provides a sane command-line interface; Evince insists on using DBus, which requires considerable gyrations (luckily, it was relatively easy to adapt solutions already existing for other editors to ST). What is harder is supporting both Evince and Okular. This would need a revamp of the building-related facilites of the plugin, basically supporting user settings to select a particular viewer. But the incentive to add such support is very low as far as other platforms are concerned: only SumatraPDF supports forward/inverse search on Windows, and Skim is the easiest-to-control and most powerful/complete PDF viewer on OS X that does. Bottom line: multiple viewer support is probably not coming in the near future.

If you're happy modifying the Python code, it's possible to add support for Okular using either this pull request or this one, though it should be noted that:

  1. Any changes you make are likely to get overwritten by a later update to the main code
  2. Obviously neither of these are really supported
  3. Either change will require updates to your configuration to work.

Another option (again unsupported) option would be to create your own jump_to_pdf command in a Python folder in your User package directory, which makes the necessary calls to Okular, perhaps modelled on the first PR I suggested, though it would need some extensive changes to work.

If you're unhappy modifying the Python code, you'll have to wait for a PR that supports Okular to be added.

The second PR linked to is likely to be merged at some point, but there isn't currently a timeline for that (it relies on some complex backend changes).

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.