Produce Markdown-file with linked citations using pandoc, without divs

231 Views Asked by At

Moin,

currently i create a Website for our institution using Hugo. In some of the pages and posts i want to cite literature and link the short-reference with the full bibliography entry. The references are taken from a BibTex file. But i'm not satisfied with the results due to not-working link-citations and ugly fenced_divs of consecutive colons.

Because Hugo uses Markdown i took pandoc to create the posts/pages, and I use it regularly to convert Latex documents without significant problems. My workflow is the following: I write the post in a Markdown file with Markdown-citations (@bibkey) and afterwards parse this to Markdown again with the particular pandoc-options.

For example, I use a file like that:

---
reference-section-title: Bib
---

# Heading

TextTextText. [@trouillot_silencing_the_past_2015] 

TextTextText. [@ashton_queens_egypt]

If I convert it with pandoc -C -t markdown-citations --metadata link-citations test.md -o test2.md --bibliography=somebib.bib, I receive the following:

# Heading

TextTextText. ([Trouillot \[1995\]
2015](#ref-trouillot_silencing_the_past_2015))

TextTextText. ([Ashton 2003](#ref-ashton_queens_egypt))

# Bib {#bibliography .unnumbered}

::: {#refs .references .csl-bib-body .hanging-indent}
::: {#ref-ashton_queens_egypt .csl-entry}
Ashton, Sally-Ann. 2003. *The Last Queens of Egypt*. Harlow: Pearson.
:::

::: {#ref-trouillot_silencing_the_past_2015 .csl-entry}
Trouillot, Michel-Rolph. (1995) 2015. *Silencing the Past: Power and the
Production of History*. Beacon Press.
:::
:::

Unfortunately, the citiations-links are not working, wether if I upload it to my website, nor in my VS Code Editor. And the colons with their attributes look pretty ugly on the webpage.

So i tried pandoc -C -t markdown_strict --metadata link-citations test.md -o test2.md --bibliography=somebib.bib:

# Heading

TextTextText. ([Trouillot \[1995\]
2015](#ref-trouillot_silencing_the_past_2015))

TextTextText. ([Ashton 2003](#ref-ashton_queens_egypt))

# Bib

Ashton, Sally-Ann. 2003. *The Last Queens of Egypt*. Harlow: Pearson.

Trouillot, Michel-Rolph. (1995) 2015. *Silencing the Past: Power and the
Production of History*. Beacon Press.

Now, the post itself looks fine, but the citiation-links still don't work.

I looked in the pandoc documentation multiple times and also tried some things, like turning of native_divs: -t markdown-citations-native_divs. But couldn't find a solution so far.

Does someone who is much more familiar with pandoc and markdown have an idea?

Thanks

0

There are 0 best solutions below