Create a YAML file. In my case, title.txt:

---
title: "Math, Music, and Coding Camp"
author: Dimitri Papadopoulos
date: "July 2023"
toc: true
rights: null
language: en-US
fontfamily: "Cormorant Garamond"
urlcolor: cyan
documentclass: report
header-includes: |
    \usepackage{fancyhdr, bookmark, pdfpages}
    \pagestyle{fancy}
---
 
\newpage

To start the table of contents on a new page:

include-before: \newpage

Use a Python Script MarkdownBook to compile from a given contents file to a given pdf

Run the following in the terminal to compile the book.

pandoc --toc -o MMC23.pdf title.txt\
 SoundChapter.md\
 PythagorusChapter.md\
 MusicTheoryChapter.md\
 SymmetryChapter.md\
 SamplingandSynthesisChapter.md\
 Appendix.md

I created an alias for a built-in python script for combining PDFs as an alternative option.

alias pdfjoin="/System/Library/Automator/Combine\ PDF\ Pages.action/Contents    /MacOS/join"

To add a PDF cover page (made in LaTeX), specify the name of the output file followed by the cover and the document itself.

pdfjoin -o MMC23Slides.pdf cover.pdf MMC23.pdf

To read the contents from a file:

pandoc -o RegularTest.pdf `tr '\n' ' ' < contents.md`

Wrote this into a script that takes as its input a file/book name.

#!/bin/zsh
 
pandoc -o $1.pdf `tr '\n' ' ' < contents.md`

Setting the document class to report is a good look, too. This is like book but one-sided.

documentclass: report

Resources + Tools