I was trying to get org-noter
to work within org-roam
using the capture template below:
(setq org-roam-capture-templates
'(;; store literature notes under `~/org/roam/reading_notes` directory.
("r" "reference" entry
"* ${title}\n:PROPERTIES:\n:NOTER_DOCUMENT:\n:END:\n%?" ;; custom variables like ${file} DO NOT work over here.
:if-new (file+head "reading_notes/${citekey}.org"
"#+type: ${entry-type}\n#+author: ${author}\n#+title: ${title}\n#+file:${file}\n#+filetags: ")
:unnarrowed t)))
This resulted in a very peculiar “peculiar error”. It seems that expansion variables like ${file}
DO NOT work in the 4th (i.e. template
) section of the capture-template argument list.
After some trial-and-error, I came up with the hack below:
(setq org-roam-capture-templates
'(;; store literature notes under `~/org/roam/reading_notes` directory.
("r" "reference" plain
"%?"
:if-new (file+head "reading_notes/${citekey}.org"
"#+type: ${entry-type}\n#+author: ${author}\n#+title: ${title}\n#+filetags:\n\n* ${title}\n:PROPERTIES:\n:NOTER_DOCUMENT: ${file}\n:END:\n")
:unnarrowed t)))
This works as expected when I invoke the reference template via orb-insert-link
, which would launch ivy-bibtex
and let me choose a citekey.
Just wondering if there is a better way of getting org-roam, org-noter and org-ref work together so that reference notes are always created with org-noter in mind.
Thanks in advance!