pandoc-templates

My custom Pandoc templates

I have created two Pandoc templates to create HTML (using Bootstrap 5 with dark-mode, and Font Awesome) and PDF files using LuaLaTeX.

Final Results

You can see the final results in this web and in the example.pdf.

If you want to see real books/html made with those templates here are more examples that I use as a teacher.

Dependencies

There are two templates, the first one to generate HTML and the other to create a custom PDF using LuaLaTeX.

Pandoc filter

Because I have created custom boxes/styles that doesn’t exists by default, I have created a filter to parse the initial markdown file to create the final HTML and LaTeX (to create the PDF).

HTML template

The template is template/yuki.html, and it uses some files and dependencies from internet:

LaTeX template

The template is template/yuki.tex, which is a modification from my custom old yukibook.cls class.


How to use the templates

Copy the template/yuki.html and template/yuki.tex files into your ~/.pandoc/templates/ directory. Or you can use those templates cloning this repository.

To use custom features (like mycode, infobox, configdir, columns and tables …) see the 1.md and 2.md markdown files in raw format, to see how to use each feature.

In this repository there are few files to create an example HTML and PDF file:

HTML

To create the HTML file:

./book.sh | pandoc -o "example.html" -d defaults.yaml --verbose

If you want to create an embeded HTML file use the extra parameter --embed-resources=true.

PDF

To create the PDF file:

./book.sh | pandoc -o "example.pdf" -d defaults.yaml --template=template/yuki.tex --verbose

The --template=template/yuki.tex is needed because in the defaults.yaml the default filter is HTML file. Change the path if you have moved to other path.