Search code examples
markdownpandoc-citeproc

pandoc citeproc from markdown to markdown but render citations


I want to do the following thing:

  • Take markdown files with citationkeys in them f.i. @AuthorYear
  • run pandoc citeproc on top of it to create markdown files but with the citation replaced by actual text.

Example of what I already tried:

  • citationsfile is file containing citations
  • infile.md and outfile are what goes in and goes out respectively

I can convert it from markdown to html

pandoc --bibliography citations.json --citeproc infile.md -o outfile.html

This doesn't seem to work

pandoc --bibliography citations.json --citeproc infile.md -o outfile.md

There is a output markdown file, but it still contains the key, not the replacement. Is there a more elegant solution than markdown-html-markdown?


Solution

  • This question has been answered elsewhere. The solution is to use -t markdown-citations, which means markdown MINUS citations.

    From the original Pandoc documentation:

    Extensions can be individually enabled or disabled by appending +EXTENSION or -EXTENSION to the format name. See Extensions below, for a list of extensions and their names. See --list-input-formats and --list-extensions, below.