Fix handout compilation

This commit is contained in:
Andreas Tsouchlos 2026-01-17 17:55:37 +01:00
parent c23ac95b90
commit 9f422f859e
2 changed files with 13 additions and 4 deletions

View File

@ -1,16 +1,22 @@
PRESENTATIONS := $(patsubst src/%/presentation.tex,build/presentation_%.pdf,$(wildcard src/*/presentation.tex))
HANDOUTS := $(patsubst build/presentation_%.pdf,build/presentation_%_handout.pdf,$(PRESENTATIONS))
RC_PDFLATEX := $(shell grep '$$pdflatex' .latexmkrc \
| sed -e 's/.*"\(.*\)".*/\1/' -e 's/%S//' -e 's/%O//')
.PHONY: all
all: $(PRESENTATIONS) $(HANDOUTS)
build/presentation_%.pdf: src/%/presentation.tex build/prepared
TEXINPUTS=./lib/cel-slides-template-2025:$(dir $<):$$TEXINPUTS latexmk $<
mv build/presentation.pdf $@
TEXINPUTS=./lib/cel-slides-template-2025:$(dir $<):$$TEXINPUTS \
latexmk -outdir=build/$* $<
cp build/$*/presentation.pdf $@
build/presentation_%_handout.pdf: src/%/presentation.tex build/prepared
TEXINPUTS=./lib/cel-slides-template-2025:$(dir $<):$$TEXINPUTS latexmk -pdflatex='pdflatex %O "\def\ishandout{1}\input{%S}"' $<
mv build/presentation.pdf $@
TEXINPUTS=./lib/cel-slides-template-2025:$(dir $<):$$TEXINPUTS \
latexmk -outdir=build/$*_handout \
-pdflatex='$(RC_PDFLATEX) %O "\def\ishandout{1}\input{%S}"' $<
cp build/$*_handout/presentation.pdf $@
build/prepared:
mkdir build

View File

@ -30,7 +30,10 @@
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{spy, external, intersections, positioning}
\ifdefined\ishandout\else
\tikzexternalize
\fi
\usepackage{pgfplots}
\pgfplotsset{compat=newest}