# Org roam bibtex configuration

**URL:** <https://org-roam.discourse.group/t/org-roam-bibtex-configuration/2340>\
**Category:** How To\
**Created:** [January 6, 2022, 9:44am UTC](https://org-roam.discourse.group/t/org-roam-bibtex-configuration/2340 "2022-01-06T09:44:50Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![mshevchuk](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@mshevchuk](https://org-roam.discourse.group/u/mshevchuk)\
**Post date:** [January 7, 2022, 11:23am UTC](https://org-roam.discourse.group/t/org-roam-bibtex-configuration/2340/7 "2022-01-07T11:23:05Z")

</div>

The expression should be part of the string template:

```auto
("r" "bibliography reference" plain
            "%?
%(roi-get-last-author \"%^{author}\") published in %^{year}."
           :target
           (file+head "references/${citekey}.org" "#+title: ${title}\n\n#+CREATED: %U\n#+LAST_MODIFIED: %U\n#+OPTIONS: toc:nil, ':t\n#+SETUPFILE: ~/.doom.d/templates/org_latex_header.org\n#+filetags: :reference:\n\n")
           :unnarrowed t)))

```

Mind the escaped double quotes around %^{author}. They are needed because you write the expression itself as an Elisp string. Shall you use a template file as in [that keywords thread](https://org-roam.discourse.group/t/how-to-use-extracted-keywords-from-pdf-as-seperate-filetags-in-note/2240), those won’t be needed and you would write simply `%? %(roi-get-last-author "%^{author}") published in %^{year}.`

During `org-capture`, the Elisp template placeholder `%(...)` gets expanded after all other templates, so the intermediate string before reading your expression would internally look like  
`%? %(roi-get-last-author "First, J., Last J.") published in 2021.`

You can read more about Org-capture templates [in the Org manual](https://orgmode.org/manual/Capture-templates.html#Capture-templates) or in the `org-capture-templates` docstring. Although Org-roam and ORB somewhat extend the Org-capture functionality, they do not cut anything out, so everything that applies to Org-capture templates also applies to Org-roam capture templates.

---

_[View the full topic](https://org-roam.discourse.group/t/org-roam-bibtex-configuration/2340)._
