3

I currently render my thesis with Markdown files as source, and want to generate a PDF output. I use the following command for that:

pandoc --template template.latex --standalone --chapters \
       -V linestretch=1.5 --toc --number-sections --bibliography sources.bib \
          00_title.md 01_introduction.md \
          02_state-of-the-art.md 03_implementation.md 04_discussion.md \
          05_conclusion.md \
       -o thesis.pdf

I would like to also set the bibliography title, since it currently doesn't appear, and the sources are just attached right after the last sentence.

I have already tried to add -V biblio-title=Bibliography, because it seems like this is the variable used in the LaTeX template. It didn't fail, but it seems to just ignore this value.

So how can the title of the bibliography be correctly set?

10

A. Short answer

You are not using BibTeX but the built-in mechanism for the bibliography. In order to specify the title with -V biblio-title=Bibliography you have to use either --biblatex or --natbib.

B. Long answer

If you are producing LaTeX output with pandoc you have three options for the bibliograpy: Using the built-in mechanism, using natbib, and using biblatex.

1. Buit-in mechanism

The built-in mechanism (citeproc) writes the bibliographic information without heading at the end of the file.

test.bib:

@article{doe1905,
 author={Doe, John},
 title={Title},
 journal={Journal},
 year={1905},
}

test.md:

# Test

This is a test [@doe1905].

# Bibliography

command: $ pandoc -s -S --bibliography=test.bib -o test.pdf test.md

enter image description here

2. Natbib

Use natbib to produce a .tex file and compile it afterwards with latexmk, arara or whatever tool you like:

command: $ pandoc -s -S --natbib --bibliography=test.bib -o test.tex test.md ; latexmk test.tex

enter image description here

3. Biblatex

Use biblatex to produce a .tex file and compile it afterwards with latexmk, arara or whatever tool you like:

command: pandoc -s -S --biblatex --bibliography=test.bib -o test.tex test.md ; latexmk test.tex

enter image description here

Changing the header

Now the crucial part: If you want to change the name of the bibliography section, you can just change the last heading of your document. This has the advantage, that it will produce consistent output also for other formats like Microsoft Word (.docx) or Open/Libre Office (.odt).

Overriding the title for the bibliography with -V biblio-title:Whatever works only with natbib and biblatex.

$ pandoc -s -S --natbib --bibliography=test.bib -V biblio-title:Whatever -o test.tex test.md ; latexmk test.tex will give you:

enter image description here

And $ pandoc -s -S --biblatex --bibliography=test.bib -V biblio-title:Whatever -o test.tex test.md ; latexmk test.tex will similarly produce:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.