Skip to content

Instantly share code, notes, and snippets.

@derlin
Last active February 22, 2018 17:33
Show Gist options
  • Save derlin/0274c4f670e17dbd686f75b71eeacab7 to your computer and use it in GitHub Desktop.
Save derlin/0274c4f670e17dbd686f75b71eeacab7 to your computer and use it in GitHub Desktop.
Header to use for generating PDF from a markdown file (pandoc file.md -o file.pdf).
---
title: <TITLE>
author: Lucy Linder
date: <DATE>
toc: false
mainfont: palatino
geometry: left=3.5cm, right=3.5cm, top=4cm, bottom=4cm
colorlinks: true
smart: true
header-includes:
- \usepackage{fancyvrb}
- \fvset{fontsize=\footnotesize}
- \RecustomVerbatimEnvironment{verbatim}{Verbatim}{}
- \RequirePackage{array}
- \renewcommand{\arraystretch}{1.5}
---
# Notes
- to have syntax highlight, vs verbatim, use the three backticks with the name of the language !
- to get the list of available fonts, ls /usr/share/fonts/truetype
- possible to put latex directly in the markdown (tables with tabularx for example)
- to comment part of the markdown, use the html syntax
pandoc filters: https://github.com/jgm/pandocfilters and https://github.com/jgm/pandoc/wiki/Pandoc-Filters
tables filters: http://stackoverflow.com/questions/34073615/how-to-control-tables-in-pandoc-generated-latex, https://github.com/baig/pandoc-csv2table

Notes:

  • pandoc adds a \tightlist directive into lists, to make them compact:
    \providecommand{\tightlist}{%
    \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
    to override this, either use a custom template, or simply add empty lines between bullet points in markdown
    * first item
    
    * second item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment