I have been trying to use the org-ref
package with emacs and I copied the setup presented in the package where I placed the .bib
files in a directory called ~/papers/
along with any pdfs of the papers in the same folder:
(use-package ivy-bibtex
:straight t
:init
(setq bibtex-completion-bibliography '("~/papers/phd_ref.bib"
"~/papers/masc_ref.bib")
bibtex-completion-library-path '("~/papers/")
bibtex-completion-notes-path "~/papers/"
bibtex-completion-notes-template-multiple-files "* ${author-or-editor}, ${title}, ${journal}, (${year}) :${=type=}: \n\nSee [[cite:&${=key=}]]\n"
bibtex-completion-additional-search-fields '(keywords)
bibtex-completion-display-formats
'((article . "${=has-pdf=:1}${=has-note=:1} ${year:4} ${author:36} ${title:*} ${journal:40}")
(inbook . "${=has-pdf=:1}${=has-note=:1} ${year:4} ${author:36} ${title:*} Chapter ${chapter:32}")
(incollection . "${=has-pdf=:1}${=has-note=:1} ${year:4} ${author:36} ${title:*} ${booktitle:40}")
(inproceedings . "${=has-pdf=:1}${=has-note=:1} ${year:4} ${author:36} ${title:*} ${booktitle:40}")
(t . "${=has-pdf=:1}${=has-note=:1} ${year:4} ${author:36} ${title:*}"))
bibtex-completion-pdf-open-function
(lambda (fpath)
(call-process "open" nil 0 nil fpath))))
(use-package org-ref
:straight t
:init
(setq bibtex-autokey-year-length 4
bibtex-autokey-name-year-separator "-"
bibtex-autokey-year-title-separator "-"
bibtex-autokey-titleword-separator "-"
bibtex-autokey-titlewords 2
bibtex-autokey-titlewords-stretch 1
bibtex-autokey-titleword-length 5)
)
(define-key org-mode-map (kbd "C-c ]") org-ref-insert-cite-function)
(define-key org-mode-map (kbd "C-c r") org-ref-insert-ref-function)
(define-key org-mode-map (kbd "C-c l") org-ref-insert-label-function)
I am able to insert the citation using C-c ]
and when I click on the citation, I can press p to open its pdf which I have also downloaded and kept in the same ~/papers/
folder. But when I press p
, it does not open the pdf file and simply states Searching for program: No such file or directory, open. My goal was to click on the citation link and have org-noter open it up so I can start taking notes on the paper. So how can I configure org-ref
to properly open up the pdf file?
Here is the error I receive:
Debugger entered--Lisp error: (file-missing "Searching for program" "No such file or directory" "open")
call-process("open" nil 0 nil "/home/user/papers/huang91_optic_coher_tomog.pdf")
(lambda (fpath) (call-process "open" nil 0 nil fpath))("/home/user/papers/huang91_optic_coher_tomog.pdf")
org-ref-open-pdf-at-point()
funcall-interactively(org-ref-open-pdf-at-point)
call-interactively(org-ref-open-pdf-at-point)
hydra--call-interactively-remap-maybe(org-ref-open-pdf-at-point)
org-ref-citation-hydra/org-ref-open-pdf-at-point-and-exit()
funcall-interactively(org-ref-citation-hydra/org-ref-open-pdf-at-point-and-exit)
call-interactively(org-ref-citation-hydra/org-ref-open-pdf-at-point-and-exit nil nil)
command-execute(org-ref-citation-hydra/org-ref-open-pdf-at-point-and-exit)
M-x toggle-debug-on-error
and redoing thep
. You should get a backtrace which you should add to your question. That will give much more information about what is going on and limit the number of wrong turns that we might make.open /path/to/some/file.pdf
on the command line? Is this on a MacOSX system?open
, not about the PDF file.open
in ubuntu andxdg-open
works but it shuts down the pdf right away soevince
was the only one that worked.