blob: 1ccf8f0ca98b3bbd19a5f405f95aa7c368d6f6bb (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
BUILD_DIR = build
FILES = $(wildcard *.tex *.py)
BUILD_FILES = $(patsubst %,${BUILD_DIR}/%,${FILES})
LATEX=xelatex
LATEX_FLAGS=-shell-escape -interaction=nonstopmode
.PHONY: all
all: tutorial.pdf
${BUILD_DIR}:
mkdir -p ${BUILD_DIR}
${BUILD_DIR}/%.tex: %.tex
./jinja2 --latex < $< > $@
${BUILD_DIR}/%.py: %.py
ln -sf ../$< $@
tutorial.pdf: ${BUILD_DIR}/tutorial.tex ${BUILD_FILES}
cd "${BUILD_DIR}" && \
${LATEX} ${LATEX_FLAGS} tutorial && \
${LATEX} ${LATEX_FLAGS} tutorial && \
${LATEX} ${LATEX_FLAGS} tutorial
mv -f "${BUILD_DIR}/tutorial.pdf" tutorial.pdf
|