slides = $(shell find sections/ -name "*.md" | sort -V)

pandoc = \
  @ pandoc $1          \
  --pdf-engine xelatex \
	-F pandoc-citeproc   \
  -t beamer            \
  -o $2

all: slides.pdf handout.pdf

clean:
	rm *.pdf

slides.pdf: $(slides) | images
	$(call pandoc, $^, $@)

handout.pdf: $(slides) | images
	$(call pandoc, $^ -V handout, $@)
