Search code examples
markdownpandoc

Markdown Footnotes


I've recently starting writing academic work in markdown format for a number of reasons and I am so far very happy with everything except I am confused about footnotes.

I use OSCOLA referencing - footnotes at the bottom of each page with a bibliography at the end of the work.

How can I best implement this in MD? I am using the Atom for editing and preview.


Solution

  • pandoc has a built-in reference manager, pandoc-citeproc. See the manual. You'll need a bibliography file in a supported format, for instance bibtex. You can then use the @refkey syntax to cite a reference in your markdown. Finally, you'll need to compile your document using a relevant csl style. In your case, it seems like there is a csl file implementing OSCOLA.

    So, first create a reference file; here would be example.bib with one reference:

    @book{kelsen1945general,
      title={General theory of law and state},
      author={Kelsen, Hans},
      year={1945},
      publisher={The Lawbook Exchange, Ltd.}
    }
    

    Then, in your markdown file example.md, use @refkey:

    Hans Kelsen states in an influential book[@kelsen1945general] that...
    

    Download the OSCOLA style and put it in your path (for instance ~/.csl/ on unix.

    wget https://www.zotero.org/styles/oscola -O ~/.csl/oscola.csl
    

    Finally, compile with pandoc and relevant options:

    pandoc example.md -o example.pdf --bibliography=example.bib --csl=oscola.csl --citeproc