Skip to content

Instantly share code, notes, and snippets.

@jchassoul
Forked from max-mapper/bibtex.png
Created May 16, 2018 02:04
Show Gist options
  • Save jchassoul/ff5ec957b7f8844a6016b4271ab81901 to your computer and use it in GitHub Desktop.
Save jchassoul/ff5ec957b7f8844a6016b4271ab81901 to your computer and use it in GitHub Desktop.
How to make a scientific looking PDF from markdown (with bibliography)

How to make a scientific looking PDF from markdown (with bibliography)

Markdown is the most common format for writing on GitHub, and is what I use for all of my own documentation. It also exports to HTML and other convenient formats for reading on mobile devices. However, sometimes you want to export it as a PDF so that you can author scientific papers and export the formats that pre-print servers like arxiv.org will accept.

markdown example

1. Install Pandoc

Pandoc is a great tool for converting between different print formats. In this case pandoc will handle these conversions for us, all in one command:

Markdown -> Latex -> Latex Citeproc Bibliography Filter -> PDF

To install it on Mac OS using homebrew:

brew install pandoc pandoc-citeproc

2. Author your paper

See paper.md for an example. You can use YAML frontmatter to specify variables that Pandoc will use as the variables in it's Latex template. To see the Latex template you can run pandoc -D latex.

3. Create a bibliography

The pandoc-citeproc filter will automatically generate a references section for you at the end of your document, and also replace all Markdown references an academic citation style.

First you can grab some Bibtex references from Google Scholar and throw them in a paper.bib file:

Then when you render the paper references will get converted like this:

@article{pizza2000identification,
title={Identification of vaccine candidates against serogroup B meningococcus by whole-genome sequencing},
author={Pizza, Mariagrazia and Scarlato, Vincenzo and Masignani, Vega and Giuliani, Marzia Monica and Arico, Beatrice and Comanducci, Maurizio and Jennings, Gary T and Baldi, Lucia and Bartolini, Erika and Capecchi, Barbara and others},
journal={Science},
volume={287},
number={5459},
pages={1816--1820},
year={2000},
publisher={American Association for the Advancement of Science}
}
title date author
Pizza - A Carbohydrate Based Substrate For Tomato Emulsion Delivery
May 2017
Maxwell Ogden

Abstract

Pizza (@pizza2000identification) is an understudied yet widely utilized implement for delivering in-vivo Solanum lycopersicum based liquid mediums in a variety of next-generation mastications studies. Here we describe a de novo approach for large scale T. aestivum assemblies based on protein folding that drastically reduces the generation time of the mutation rate.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment