Writing a scientific manuscript in Markdown

PUBLISHED ON SEP 5, 2019 BY Yutaka Masuda

Goals

To generate a journal manuscript from a Markdown file using Pandoc, a format converter.

Directions

  • Write the original document as a text file in Markdown (with some extensions of Pandoc).
  • Convert it to various format (Word docx, LaTeX, HTML etc.) using Pandoc.
  • Never expect the complete results in conversion; accept small corrections by hand.

Demonstration

The content in the following example is equivalent to Masuda et al. (Interbull Bulletin, 2015. No.49). The converted file looks incomplete as a manuscript but the correction will be easily made.

Each file was obtained with the following command.

# To Word docx
pandoc -s -F pandoc-citeproc \
       --reference-doc=template.docx \
       --bibliography interbull_masuda_2015.bib \
       --csl journal-of-dairy-science.csl \
       --citation-abbreviations=abbrev_simple.json \
       interbull_masuda_2015.md -o interbull_masuda_2015.docx

# To PDF through LaTeX
pandoc -s -F pandoc-citeproc \
       --bibliography interbull_masuda_2015.bib \
       --csl journal-of-dairy-science.csl \
       --citation-abbreviations=abbrev_simple.json \
       interbull_masuda_2015.md -o interbull_masuda_2015.pdf

# To HTML with MathJax
pandoc -s --mathjax -F pandoc-citeproc \
       --bibliography interbull_masuda_2015.bib \
       --csl journal-of-dairy-science.csl \
       --citation-abbreviations=abbrev_simple.json \
       interbull_masuda_2015.md -o interbull_masuda_2015.html

Many options? Most of the options are needed to process the reference list. You can remove some options (--bibliography, --filter, --csl, --citation-abbreviations) if you directly write the citations and references in the body of the manuscript. See the Pandoc manual for details.