I'm using org-roam with doom-emacs and I want to know how to properly configure org-roam-bibtex?

I copied the org-roam-bibtex config from https://github.com/jethrokuan/dots/blob/master/.doom.d/config.el to get started but I don't know how to extract or create references into my roam directory.

(use-package! org-roam-bibtex
  :after (org-roam)
  :hook (org-roam-mode . org-roam-bibtex-mode)
  (setq org-roam-bibtex-preformat-keywords
   '("=key=" "title" "url" "file" "author-or-editor" "keywords"))
  (setq orb-templates
        `(("w" "ref" plain (function org-roam-capture--get-point)
           :file-name "papers/${slug}"
           :head ,(concat
                   "#+title: ${=key=}: ${title}\n"
                   "#+roam_key: ${ref}\n\n"
                   "* ${title}\n"
                   "  :PROPERTIES:\n"
                   "  :Custom_ID: ${=key=}\n"
                   "  :URL: ${url}\n"
                   "  :AUTHOR: ${author-or-editor}\n"
                   "  :NOTER_DOCUMENT: %(orb-process-file-field \"${=key=}\")\n"
                   "  :NOTER_PAGE: \n"
                   "  :end:\n")
           :unnarrowed t))))

I watched this video https://www.youtube.com/watch?v=Wy9WvF5gWYg explained how to use it but I got lost in how he did it work.

  • Please be more specific. You followed some instructions. Say what you saw at each step and what you expected to see instead. And please integrate the relevant parts of the instructions into your question. It's not right to just point to a website of instructions and then say that following them didn't work for you. The question lacks focus. – Drew Jun 18 at 2:04
  • Instructions are far from clear. I found out yesterday that you have to configure helm-bibtex or ivy-bibtex first. org-roam-bibtex overrides their edit note command. In ivy, you have to select a bib entry, press 'M-o', and select 'e' for edit. Many things work in unexpected ways. For example, the default orb-template was used although I had changed it. Like it says in the documentation, this package is in alpha. – Heikki Jun 18 at 6:28
  • Of course, roam capture templates are org capture templates. I have not found a way of updating org capture templates without restarting emacs. This is not failing of org-roam-bibtex. – Heikki Jun 18 at 7:53

I could succesfully config org-roam-bibtex after a lot of tries.

This is my config if someone finds useful. I copied all the config from https://rgoswami.me/posts/org-note-workflow/

The part that gave me an issue is the org-ref-default-bibliography which must be a list even if you have only one directory for your bibtex file (otherwise it will throw you an error).

(setq maikol/bibliography-path "~/Dropbox/org/roam/literature/library.bib")
(setq maikol/pdf-path  "~/Zotero/storage/")
(setq maikol/bibliography-notes "~/Dropbox/org/roam/literature/")

(use-package! org-ref
    ;; :init
    ; code to run before loading org-ref
         org-ref-completion-library 'org-ref-ivy-cite
         org-ref-get-pdf-filename-function 'org-ref-get-pdf-filename-helm-bibtex
         org-ref-default-bibliography (list "~/Dropbox/org/roam/literature/library.bib")
         org-ref-bibliography-notes "~/Dropbox/org/roam/literature/bibnotes.org"
         org-ref-note-title-format "* NOTES %y - %t\n :PROPERTIES:\n  :Custom_ID: %k\n  :NOTER_DOCUMENT: %F\n :ROAM_KEY: cite:%k\n  :AUTHOR: %9a\n  :JOURNAL: %j\n  :YEAR: %y\n  :VOLUME: %v\n  :PAGES: %p\n  :DOI: %D\n  :URL: %U\n :END:\n\n"
         org-ref-notes-directory maikol/bibliography-notes
         org-ref-notes-function 'orb-edit-notes

(after! org-ref
   bibtex-completion-notes-path maikol/bibliography-notes
   bibtex-completion-bibliography "~/Dropbox/org/roam/literature/library.bib"
   bibtex-completion-pdf-field "file"
    "#+TITLE: ${title}\n"
    "#+ROAM_KEY: cite:${=key=}"
    "#+ROAM_TAGS: ${keywords}"
    "Time-stamp: <>\n"
    "- tags :: \n"
    "* NOTES \n"
    ":Custom_ID: ${=key=}\n"
    ":NOTER_DOCUMENT: %(orb-process-file-field \"${=key=}\")\n"
    ":AUTHOR: ${author-abbrev}\n"
    ":JOURNAL: ${journaltitle}\n"
    ":DATE: ${date}\n"
    ":YEAR: ${year}\n"
    ":DOI: ${doi}\n"
    ":URL: ${url}\n"

(use-package! org-roam-bibtex
  :after (org-roam)
  :hook (org-roam-mode . org-roam-bibtex-mode)
  (setq orb-preformat-keywords
        '("=key=" "title" "url" "file" "author-or-editor" "keywords"))
  (setq orb-templates
        '(("r" "ref" plain (function org-roam-capture--get-point)
           :file-name "literature/%<%Y-%m-%d-%H-%M-%S>-${slug}"
           :head "#+TITLE: ${=key=}: ${title}
#+ROAM_KEY: ${ref}
Time-stamp: <>
- tags :: ${keywords}

* ${title}
  :Custom_ID: ${=key=}
  :URL: ${url}
  :AUTHOR: ${author-or-editor}
  :NOTER_DOCUMENT: %(orb-process-file-field \"${=key=}\")


           :unnarrowed t))))

(use-package! org-noter
  :after (:any org pdf-view)
   ;; The WM can handle splits
   ;;org-noter-notes-window-location 'other-frame
   ;; Please stop opening frames
   ;;org-noter-always-create-frame nil
   ;; I want to see the whole file
   org-noter-hide-other nil
   ;; Everything is relative to the rclone mega
   org-noter-notes-search-path maikol/bibliography-notes

| improve this answer | |

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.