My Pandoc Markdown-PDF Workflow for Routine, Not Especially Technical Writing

Pandoc Basics

$ pandoc --read=odt --write=markdown oldarchive.odt -o mydocument.md
$ pandoc --read=markdown --write=docx oldarchive.md -o mydocument.docx

Underlying Attributes

Markdown to PDF via LaTeX

fileName: Pandoc-2020.08.md
# Last-edited: Sun 2020.08.09.1841 -- Danny Quah (me@DannyQuah.com)
Type: Notes
Tags: Software
# Created: Sun 2020.08.09.1517 -- Danny Quah (me@DannyQuah.com)
## Front Matter
title: Readable Title for My Article
author:
- name: Danny Quah
affiliation: Lee Kuan Yew School of Public Policy, NUS
email: D.Quah@nus.edu.sg
number: 1
- name: My Coauthor
affiliation: Economics Department, NUS
email: ecsdqlsh@nus.edu.sg
number: 2
date: June 2020
# abstract:
# keywords:
# thanks:
## Formatting
fontsize: 12pt
# mainfont: "gentium" # See https://fonts.google.com/ for fonts
# sansfont: "Raleway"
# monofont: "IBM Plex Mono"
mathfont: ccmath
# fontfamily: concrete | gentium | libertine
# documentclass: article | scrartcl
fontfamily: concrete
documentclass: article
classoption:
- notitlepage
- onecolumn
fontenc: T1
geometry:
- a4paper
- top=35mm
- left=30mm
- heightrounded
header-includes:
- |
```{=latex}
\usepackage{amsmath,amsfonts,euscript,tikz,fancyhdr,float}
\floatplacement{figure}{H}
```
pagestyle: headings
author:
- Danny Quah `\\\\`{=latex} Lee Kuan Yew School of Public Policy, NUS `\\\\`{=latex} D.Quah@nus.edu.sg
author:
- Danny Quah `\\\\`{=latex} Lee Kuan Yew School of Public Policy, NUS `\\\\`{=latex} D.Quah@nus.edu.sg
- My Coauthor `\\\\`{=latex} Economics Department, NUS `\\\\`{=latex} ecsdqlsh@nus.edu.sg
$ pandoc -D latex > mytemplate.tex
--template=mytemplate.tex
\author{$for(author)$$author$$sep$ \and $endfor$}
$if(author)$
\usepackage{authblk}
$for(author)$
$if(author.name)$
$if(author.number)$
\author[$author.number$]{$author.name$}
$else$
\author[]{$author.name$}
$endif$
$if(author.affiliation)$
$if(author.email)$
\affil{$author.affiliation$ \thanks{$author.email$}}
$else$
\affil{$author.affiliation$}
$endif$
$endif$
$else$
\author{$author$}
$endif$
$endfor$
$endif$
$ pandoc --standalone --read=markdown --write=pdf --pdfengine=pdflatex myinput.md -o myinput.pdf
$ pandoc --standalone --read=markdown --write=pdf --template=mytemplate.tex --pdfengine=pdflatex myinput.md -o myinput.pdf
$ pandoc --standalone --read=markdown --write=latex+raw_tex myinput.md -o myinput.tex
$ pdflatex myinput.tex &>/dev/null

References

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store