Markdown to PDF with Pandoc


get the Pandoc and friends,

apt install pandoc lmodern texlive-latex-base texlive-fonts-recommended pandoc-citeproc apt-get install texlive-xetex

helper scripts

script for PDFs,

vi pandoc

[[ -z $1 ]] && echo argument missing && exit 1
echo -n ${1%\.md}.pdf...
pandoc --latex-engine=xelatex -V geometry:margin=1in -V papersize:a4paper -o ${1%\.md}.pdf $1 && echo done
#-f markdown+fancy_lists
#--toc --listings
#-t context

chmod +x pandoc

for beamer presentations,

vi preamble.tex

\setbeamercolor{normal text}{fg=white,bg=black!90}
\setbeamercolor{alerted text}{use=structure,fg=structure.fg}
\setbeamercolor*{palette primary}{use=structure,fg=structure.fg}
\setbeamercolor*{palette secondary}{use=structure,fg=structure.fg!95!black}
\setbeamercolor*{palette tertiary}{use=structure,fg=structure.fg!90!black}
\setbeamercolor*{palette quaternary}{use=structure,fg=structure.fg!95!black,bg=black!80}

vi pandocslides

[[ -z $1 ]] && echo argument missing && exit 1
echo -n ${1%\.md}.pdf...
pandoc --latex-engine=xelatex -t beamer -H ~/path/preamble.tex $1 -o ${1%\.md}.pdf && echo done
#--toc --listings --slide-level=3

chmod +x pandocslides


and eventually the enscript helper for printing text,

apt install enscript

note. not using those:

#good but redundant with Ext -- MarkdownHighlighting
#default styling is white: MarkdownEditing
#this breaks the shift+tab feature to unindent: SmartMarkdown