Exporting with citations

If the citekeys remain as citekeys, then you haven’t implemented my suggestions. So, although you switched plugin, you’re still facing the same issue of a missing bibliography. --citeproc can’t do anything without a bibliography.

These plugins are both just scaffolding for Pandoc. What you need to do doesn’t change (much) because of the scaffolding, because it’s still Pandoc behind the scenes. Of course, it might vary how you specify the arguments.

The “Extra arguments” field is just a convenient field the that both Pandoc plugins provide where you can add additional arguments into the main command used to run Pandoc. You could in fact also place these arguments there in the field above Extra arguments.

Exactly, it doesn’t do anything on its own. How could it know what @Jones_2024 is referring to without the associated metadata?

This is indeed the sticking point. The type of file you need is explained here: Pandoc User Guide → Citations → Specifying Bibliographic Data.

Basically, you specify it like so:
--bibliography="C:/path/to/your/bibliography.bib"

Where bibliography.bib can a bibtex (.bib), biblatex (.bib), CSL JSON (.json), CSL YAML (.yml), or a RIS (.ris) bibliography file exported from a reference manager like Zotero.

After this, you’ll have requirements 1. (citeproc) and 2. (bibliography) down. Then you just need to specify the citation style using --csl. Here, you provide a file path or URL to a .csl file, the same way you do for --bibliography.


Live citations in Word

Since you seem focused on Word exports, you should be aware that using --citeproc might not be the best option in this case, because it will give you static citations that you can’t dynamically edit in Word (change citation style, update bibliography list). For other exports like PDF, stick with --citeproc and its associated arguments.

But if you want editable citations in Word, like the ones you get when using the Zotero addon for Word, there is another option.

This option is to use a filter made be retorquere (the Better Bibtex creator). Find the relevant guide here:

  1. Download the zotero.lua filter from the link above.
  2. Find your Pandoc user data folder using the pandoc --version command in your OS’s terminal / command prompt.
    • In this Pandoc folder, create a “filters” subfolder, and put the downloaded zotero.lua file into this folder.
    • If no such user data folder exists at path you found in the terminal, create it and then also the aformentioned “filters” folder.
  3. Put the following argument in the extra arguments of your command template for Word (docx) exports in Enhancing Export’s settings:
    --lua-filter zotero.lua
    
    • Double-check that you selected the right command template: Edit command template → Choose template → Word (.docx) template, before making any changes!
    • Make sure to remove the --citeproc, --bibliography, --csl arguments, if you had added these. The zotero.lua filter will handle all this instead.
  4. If necessary, specify additional arguments for zotero.lua.
    • For example, if you are citing items in a group library, you should specify that with the library property (see below).
    • This can be done in the note’s properties, like so:
---
# all the regular stuff you have here
zotero:
  library: <group name> # omitted to use your personal library
  scannable-cite: false # only relevant when you're compiling to scannable-cite .odt
  client: <zotero or jurism> # defaults to zotero
  author-in-text: false # when true, enabled fake author-name-only cites by replacing it with the text of the last names of the authors
  csl-style: apa # pre-fill the style
  sorted: true # sort clustered citations by author.
---

or using additional arguments placed in Extra arguments field like so:
--metadata=zotero_csl-style:apa

  1. Export using the “Enhancing Export: Export to Word” command in the command palette.
  2. In Word, open the Zotero tab and then open Document Preferences → then press OK. Now your citations are live Word citations, and you can update the citations and bibliography! :tada:
7 Likes