Org Cite Citations

Org 9.5 is needed for this as that version introduced the new oc.el Org Cite library .

Specify Bibligraphy files #

Org Cite (oc.el) requires the bibliography files to be specified using one or more #+bibliography: <file.bib> keywords or using the org-cite-global-bibliography variable.

Example: #+bibliography: orgcite.bib

:EXPORT_BIBLIOGRAPHY: in subtree property drawers will not work with Org Cite!

Citation Syntax #

Below Org snippet:

[cite:@OrgCitations]

exports to:

(org, mode and Syntax, Citation and List, Mailing and Effort, Time, 2021)

See the TMIO July 2021 blog post for more information on the cite: syntax.

Printing Bibliography #

Below Org snippet:

#+print_bibliography:

exports to:

References #

org, mode and Syntax, Citation and List, Mailing and Effort, Time (2021). Elegant Citations with Org-Mode, Journal of Plain Text Formats.

The Ox-Hugo Pandoc Citation feature needs to be disabled for Org Cite based citation processing to work.

So make sure that you don’t have :EXPORT_HUGO_PANDOC_CITATIONS: t in your post tree or #+hugo_pandoc_citations: t in your Org file!

Citation Processor: CSL #

The Citations Style Language (CSL) defines how the citations and bibliographies should be exported.

Using CSL is optional, and dependent on an external package citeproc.el. By default CSL is not enabled and the citations and bibliographies will be exported to Markdown in plain text i.e. without any emphasis, hyperlinking, etc.

To enable CSL-formatted exports:

  1. Install citeproc from Melpa.
  2. Add this to the top of your Org file: #+cite_export: csl

That’s it! The Org built-in library oc-csl.el will autoload citeproc when it sees that #+cite_export keyword. With CSL processing enabled, the citations and bibliographies will now be exported in HTML embedded in the exported Markdown files.

Check out the This Month in Org – July 2021 post for more information.

Auto-inserting Bibliography heading #

If CSL-formatted exports are enabled , a Markdown heading named “References” will be auto-inserted above the bibliography section. This section is exported if the Org file has #print_bibliography: keyword .

This feature is controlled by the org-hugo-citations-plist property list variable.

org-hugo-citations-plist #

This property list recognizes this property:

:bibliography-section-heading
(string) Heading to insert before the bibliography section. The default value is “References”.

Some users might choose to customize this value to “Bibliography”. Here’s an example of how that can be done in the Emacs config:

(with-eval-after-load 'ox-hugo
  (plist-put org-hugo-citations-plist :bibliography-section-heading "Bibliography"))
Code Snippet 1: Customizing bibliography heading

If this property is set to an empty string, this heading will not be auto-inserted.

(with-eval-after-load 'ox-hugo
  (plist-put org-hugo-citations-plist :bibliography-section-heading ""))
Code Snippet 2: Disabling bibliography heading insertion

Example #

Minimal example with org-cite citations:

#+title: Citation using ~org-cite~

#+hugo_base_dir: ../

#+bibliography: /path/to/file.bib
#+cite_export: csl

[cite:@SomeCitation]

Below, the "References" heading will be auto-inserted.

#+print_bibliography:
Code Snippet 3: Example of org-cite citation
Fork me on GitHub