reddit / emacs

Org-ref not opening PDF file

waterstrider123 ยท 2022-08-04 22:12
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?