diff --git a/Makefile.lecture b/Makefile.lecture new file mode 100644 index 0000000000000000000000000000000000000000..93a981f4172264f04a216ac268bde4ea82d9f010 --- /dev/null +++ b/Makefile.lecture @@ -0,0 +1,94 @@ +# Author: Carsten Gips <carsten.gips@fh-bielefeld.de> +# Copyright: (c) 2016-2018 Carsten Gips +# License: MIT + + + +## Path to this repository (to be used as git sub-module) + +DATADIR = .. +FILTERDIR = $(DATADIR)/filters +RESOURCEDIR = $(DATADIR)/resources +RESOURCEPATH = .:./figs:$(DATADIR) + +PANDOC = pandoc + + + +## Source file and lecture prefix +## either defined here (all files) or given at cmd line like `make SRC=vl02.md` + +SRC ?= $(wildcard vl*.md) +ID ?= pm + +SLIDES = $(SRC:%.md=${ID}_%.pdf) +HTML = $(SRC:%.md=${ID}_%.html) + +TARGETDIR = ../distr/ + + + +## Lecture options + +OPTIONS = -f markdown +OPTIONS += --data-dir=${DATADIR} +OPTIONS += --resource-path=${RESOURCEPATH} + +BEAMEROPTIONS = -t beamer +BEAMEROPTIONS += --pdf-engine=pdflatex +BEAMEROPTIONS += --default-image-extension=pdf +BEAMEROPTIONS += -V theme:metropolis +BEAMEROPTIONS += -V themeoptions:numbering=none -V themeoptions:progressbar=foot +BEAMEROPTIONS += -V fontsize=smaller +BEAMEROPTIONS += --slide-level=2 +BEAMEROPTIONS += --lua-filter=${FILTERDIR}/tex.lua +BEAMEROPTIONS += --include-in-header=${RESOURCEDIR}/definitions.tex +BEAMEROPTIONS += --include-in-header=${RESOURCEDIR}/beamer.tex +BEAMEROPTIONS += $(OPTIONS) + +HTMLOPTIONS = -t html +HTMLOPTIONS += --default-image-extension=png +HTMLOPTIONS += --standalone --self-contained +HTMLOPTIONS += --toc --toc-depth=1 +HTMLOPTIONS += --strip-comments +HTMLOPTIONS += --lua-filter=${FILTERDIR}/html.lua +HTMLOPTIONS += --css=${RESOURCEDIR}/html.css +# insert `<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-AMS_CHTML-full" type="text/javascript" data-external="1"></script>` +# with data-external="1" to prevent incorporating MathJax into the generated HTML document when using --self-contained +HTMLOPTIONS += --include-in-header=${RESOURCEDIR}/mathjaxurl.html +# use MathJax; URL points to blank dummy document to prevent incorporating MathJax into the generated HTML document when using --self-contained +HTMLOPTIONS += --mathjax=${RESOURCEDIR}/dummy.js +HTMLOPTIONS += $(OPTIONS) + + + +## Targets + +all: $(SLIDES) $(HTML) + +$(SRC:.md=): %: ${ID}_%.pdf ${ID}_%.html + +${ID}_%.pdf: %.md metadata.yaml + $(PANDOC) ${BEAMEROPTIONS} -o $@ $^ + +${ID}_%.html: %.md metadata.yaml + $(PANDOC) ${HTMLOPTIONS} -o $@ $^ + + +install: $(TARGETDIR) $(SLIDES) $(HTML) + mv ${SLIDES} $(TARGETDIR) + mv ${HTML} $(TARGETDIR) + +$(TARGETDIR): + mkdir $@ + + +clean: + rm -f $(SLIDES) $(HTML) + + +.PHONY: all install clean + + + +