Make Org-Roam work with Org-Noter and Org-Ref

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!

Hi, the 4th element of the list is the vanilla Org-capture template section, so Org-roam-style placeholders do not work there. This may change in the future. You can still use Org-capture prompt wildcards %^{title}. To keep your template clean you may want to use a file template specification instead of a template string. More details on how to use file templates can be found in the org-capture-templates docstring and an example of such a file in the ORB manual.