thomasjo / atom-latex

Compile LaTeX or knitr documents from within Atom
https://atom.io/packages/latex
MIT License
223 stars 42 forks source link

An error occured while trying to run Evince opener #546

Closed celdorwow closed 2 years ago

celdorwow commented 3 years ago

This is a follower of the issue https://github.com/thomasjo/atom-latex/issues/503.

This package still does not work with Evince in Ubuntu 20.04 as of this date. Has anyone found any workaround? According to the previous issue I referred to, the problem is about the wrong path to Evince. In Ubuntu 20.04 evince is located in /user/bin/evince. I tried to alter the file related to it but I don't really understand it. There are paths to daemons which I can't find running in the system. Anyway, I hope someone comes with a solution before this ticket gets in stale and closed.

Thanks

Tehgg commented 3 years ago

The following hacks to the file ~/.atom/packages/latex/lib/openers/evince-opener.js worked for me.

First, in the method open, you should add just after the try { the code

latex.process.executeChildProcess("evince "+pathToUri(filePath))

On my machine, dbus' FindDocument doesn't open an evince window for the document if there is none and the above fixes it.

Next, you can either replace

fdApplicationObject: '/org/gtk/Application/anonymous',

by

fdApplicationObject: '/org/gnome/evince/Evince',

or you can comment the following part:

if (this.dbusNames.fdApplicationObject) {
      // Get the GTK/FreeDesktop application interface so we can activate the window
      console.log(this.dbusNames.fdApplicationObject);
      windowInstance.fdApplication = await this.getInterface(documentName, this.dbusNames.fdApplicationObject, this.dbusNames.fdApplicationInterface)
    }

I don't really know what I'm doing but it works.

If you don't care about synctex, you can also just select a custom viewer and put /bin/evince in the custom path.

stale[bot] commented 2 years ago

This issue has been marked as stale because due to inactivity. It will be closed in 14 days if no further activity occurs.