w8s / pandoc-pdf-template

A basic template to make Pandoc-generated PDFs look better.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pandoc-pdf-template

This repo contains a Latex template file for Pandoc to generate a decent looking PDF right off the bat. If you have any recommendations, or tweaks to make it better, please let me know. I would love to hear from you.

A sample PDF can be seen at sample/The Name of the Document.pdf.

Dependencies

  • pandoc
  • A TexLive package.

Note: On a Mac, I used BasicTex with the packages below installed using tlmgr.

Tex Packages:

  • tocloft
  • textpos
  • changepage
  • titling
  • placeins
  • lastpage
  • sectsty

Command

pandoc --latex-engine=xelatex --template={/path/to/w8sPDF.template} -V subject="{subject}" -V keywords="{keywords}" -V today="{today}" -V subtitle="{subtitle}" -V draft="{draft}" -V color="{color}" -V iconpath="path/to/icon.png" -V brandingpath="path/to/brandingfile.eps" -f markdown+auto_identifiers --toc -o "{subtitle}.pdf" {mdfile}"

Helper Script

I included a Python script that will run the above command using keywords you define in the script. I find it's a bit easier to use that.

To run it cd into sample and run python generation_script.py.

About

A basic template to make Pandoc-generated PDFs look better.


Languages

Language:Python 100.0%