TransWikia.com

Add citations at _end_ of file in pandoc markdown

TeX - LaTeX Asked on July 25, 2021

I’m trying to write a scientific paper in mardown and would like to add a citation. Here’s my markdown:

---
title: Test test
author: Jake Sarjeant
documentclass: report
header-includes: |
    usepackage[a4paper]{geometry}
    usepackage{tipa}
    usepackage{graphicx}
    usepackage{hyperref}
    usepackage{amsfonts}
    usepackage[ruled,boxed]{algorithm2e}
    usepackage{algpseudocode}
    usepackage{listings}
    usepackage{amssymb}
    usepackage{tcolorbox}
    usepackage{amsmath}
---

tableofcontents

newpage

Bla bla bla [@citation]

My biblio.bib file:

@misc{citation,
    Author =       {someone},
    Title =        {title},
    Year =         2021,
    Month =        {Jan},
    URL =          {https://google.com}
}

My pandoc command:

pandoc --citeproc --bibliography=biblio.bib -s paper.md -o generated/paper.pdf

It works just fine, but my citation is expanded in-line:

picture

What I want is this:

Bla bla [1]

And a bibliography section at the end.

Can anyone help?

One Answer

I figured it out:

The reason the citation appeared to be in-line was because it was at the end of the file. By adding another heading "Citations" at the end, the problem disappeared:

---
title: Test test
author: Jake Sarjeant
documentclass: report
header-includes: |
    usepackage[a4paper]{geometry}
    usepackage{tipa}
    usepackage{graphicx}
    usepackage{hyperref}
    usepackage{amsfonts}
    usepackage[ruled,boxed]{algorithm2e}
    usepackage{algpseudocode}
    usepackage{listings}
    usepackage{amssymb}
    usepackage{tcolorbox}
    usepackage{amsmath}
---

tableofcontents

newpage

Bla bla bla [@citation]

# Works Cited

<!-- Pandoc automatically inserts citations here ->

Answered by Jake on July 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP