2

I am trying to export an org document to html, using the program bibtex2html, which I have installed:

$ which bibtex2html
/usr/bin/bibtex2html

Accordingly, I checked the exec-path variable in emacs:

("/app/bin" "/usr/bin" "/home/sean/.var/app/org.gnu.emacs/data/node/bin" "/home/sean/.var/app/org.gnu.emacs/data/cargo/bin" "/home/sean/.var/app/org.gnu.emacs/data/python/bin" "/app/libexec/emacs/27.2/x86_64-pc-linux-gnu/")

However, when I run the export command, which calls bibtex2html, I get the following message: Searching for program: no such file or directory, bibtex2html

I'm at a bit of a loss here. I tried using https://github.com/purcell/exec-path-from-shell, which I found from the answers at this question, but it did not help.

More specifics, as requested: I am trying to use org-export-dispatch to export the document to an HTML file. I am using doom emacs, and my keybindings for this command are SPC m e h h. Document export succeeds if I do not try to include a bibliography. I have (require 'ox-bibtex'), which in my doom/config.el file, as such:

(use-package! org-roam-bibtex
  :after org-roam
  :config
  (require 'org-ref)
  (require 'ox-bibtex))

I call ox-bibtex according to the documentation in its codec, by including the following line at the end of my org document:

#+BIBLIOGRAPHY: bibfilename stylename optional-options
  • That sounds strange. Is this all local, or is Tramp involved in this workflow somehow? If it is, see `C-h v tramp-remote-path` -- although `/usr/bin` should be present in pretty much *any* default path, so I doubt it's that either. – phils Feb 02 '22 at 05:49
  • Were you running `which bibtex2html` from inside Emacs? If not, test `M-! which bibtex2html`. Also run `M-: (executable-find "bibtex2html")` which will use `exec-path`. Also triple-check that there isn't a typo somewhere. – phils Feb 02 '22 at 05:57
  • Last questions for now: Where is Emacs getting "bibtex2html" from? Where is that configured? Sanity-check that. And please update the question with specific details of how you are (attempting to) export this. Specifically which library, command, key sequence, etc, are you using. – phils Feb 02 '22 at 06:03
  • Thanks phils. I run Tramp occasionally, but it is not involved in this case. I was running `which bibtex2html` from the terminal, not inside emacs. From emacs, I get a similar message: `which: no bibtex2html in (/app/bin:/usr/bin:/home/sean/.var/app/org.gnu.emacs/data/node/bin:/home/sean/.var/app/org.gnu.emacs/data/cargo/bin:/home/sean/.var/app/org.gnu.emacs/data/python/bin)`. `M-: (executable-find "bibtex2html")` returns `nil`. Strange indeed! I will update the question with specific details now. – Sean Johnsen Feb 02 '22 at 14:33

1 Answers1

2

I solved this problem. The error was that I was using the flatpak version of Emacs. Flatpak sandboxes applications in such a way to prevent accessing external files (in this case, bibtex2html).

To fix, I uninstalled the flatpak version, and re-installed using https://launchpad.net/~kelleyk/+archive/ubuntu/emacs

  • This isn't the first time I've seen a problem traced back to a flatpak Emacs build, so you're probably also saving yourself some other future pain by avoiding it. – phils Feb 02 '22 at 21:09