I am using Doom Emacs and have managed to set up org-roam-bibtex somewhat properly now. At least all parts seems to be working without flaws or errors. However, for the moment I keep both my org-roam notes (slip-box notes) and org-ref/noter notes (literature notes) in the same folder. But I would prefer to keep my literature notes in a subfolder of the slip-box folder. Would be very grateful if someone could help me out here. Here below is the relevant code in my config.el
:
;;------------------------------------------------------------------------------------
;; org
;;------------------------------------------------------------------------------------
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/org/zettelkasten")
;;------------------------------------------------------------------------------------
;; pdf-tools
;;------------------------------------------------------------------------------------
(use-package! pdf-tools
:load-path "site-lisp/pdf-tools/lisp"
:magic ("%PDF" . pdf-view-mode)
:config
(pdf-tools-install :no-query)
(setq-default pdf-view-display-size 'fit-page)
(setq pdf-annot-activate-created-annotations t)
(setq pdf-view-resize-factor 1.1)
(setq pdf-view-use-unicode-ligther nil))
;;-------------------------------------------------------------------------------------
;; deft
;;-------------------------------------------------------------------------------------
(setq deft-directory "/Users/joafr/org/zettelkasten/"
deft-use-filename-as-title nil)
;;-------------------------------------------------------------------------------------
;; ivy-bibtex
;;-------------------------------------------------------------------------------------
(after! ivy-bibtex
:config
(setq ivy-re-builders-alist
'((ivy-bibtex . ivy--regex-ignore-order)
(t . ivy--regex-plus)))
(setq bibtex-completion-bibliography "/Users/joafr/Documents/bibfiles/library.bib"
bibtex-completion-library-path "/Users/joafr/Documents/bibpdfs"
bibtex-completion-notes-path "/Users/joafr/org/zettelkasten/"
bibtex-completion-notes-template-multiple-files ""))
(use-package! ivy-hydra
:demand t)
;;;;;;;;;;UGLY CODE, SHOULD BE PLACED ELSEWHERE BUT DO NOT DARE TO EDIT NOW;;;;;;;;;;
(after! org
:config
(setq org-directory "/Users/joafr/org/zettelkasten/"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;------------------------------------------------------------------------------------
;; org-ref
;;------------------------------------------------------------------------------------
(use-package! org-ref
:after org
:commands
(org-ref-cite-hydra/body
org-ref-bibtex-hydra/body)
:init
(let ((cache-dir (concat doom-cache-dir "org-ref")))
(unless (file-exists-p cache-dir)
(make-directory cache-dir t))
(setq orhc-bibtex-cache-file (concat cache-dir "/orhc-bibtex-cache")))
:config
(setq
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 "/Users/joafr/Documents/bibfiles/library.bib")
org-ref-bibliography-notes "/Users/joafr/org/zettelkasten/"
org-ref-note-title-format "* TODO %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 "/Users/joafr/org/zettelkasten/"
org-ref-notes-function 'orb-edit-notes
))
;;--------------------------------------------------------------------------------------
;; org-roam
;;--------------------------------------------------------------------------------------
(after! org-roam
:config
(setq org-roam-directory "/Users/joafr/org/zettelkasten/"))
(use-package! org-roam-bibtex
:after org-roam
:hook (org-roam-mode . org-roam-bibtex-mode)
:config
(require 'org-ref)
(setq org-roam-bibtex-preformat-keywords
'("citekey" "title" "url" "file" "author-or-editor" "keywords"))
(setq orb-templates
'(("r" "ref" plain (function org-roam-capture--get-point)
""
:file-name "${citekey}"
:head "#+TITLE: ${citekey}: ${title}\n#+ROAM_KEY: ${ref}
- tags ::
- keywords ::
\n* ${citekey}: ${title}\n :PROPERTIES:\n :Custom_ID: ${citekey}\n :URL: \n :AUTHOR: ${author}\n :NOTER_DOCUMENT: ${file}\n :NOTER_PAGE: \n :END:\n\n"
:unnarrowed t))))
;;----------------------------------------------------------------------------------------
;; org-noter
;;-----------------------------------------------------------------------------------------
(use-package! org-noter
:after org
:config
(setq
;; The WM can handle splits - var tidigare "other-frame"
org-noter-notes-window-location 'horizontal-split
;; 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 main notes file
org-noter-notes-search-path (list "/Users/joafr/org/zettelkasten/")
)
)
;;-----------------------------------------------------------------------------------------
;; org-capture
;;------------------------------------------------------------------------------------------
;; Actually start using templates
(after! org-capture
;; Firefox and Chrome
(add-to-list 'org-capture-templates
'("P" "Protocol" entry ; key, name, type
(file+headline +org-capture-notes-file "Inbox") ; target
"* %^{Title}\nSource: %u, %c\n #+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?"
:prepend t ; properties
:kill-buffer t))
(add-to-list 'org-capture-templates
'("L" "Protocol Link" entry
(file+headline +org-capture-notes-file "Inbox")
"* %? [[%:link][%(transform-square-brackets-to-round-ones \"%:description\")]]\n"
:prepend t
:kill-buffer t))
)