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)) PRESENTATIONS := $(patsubst src/%/presentation.tex,build/presentation_%.pdf,$(wildcard src/*/presentation.tex))
HANDOUTS := $(patsubst build/presentation_%.pdf,build/presentation_%_handout.pdf,$(PRESENTATIONS)) 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 .PHONY: all
all: $(PRESENTATIONS) $(HANDOUTS) all: $(PRESENTATIONS) $(HANDOUTS)
build/presentation_%.pdf: src/%/presentation.tex build/prepared build/presentation_%.pdf: src/%/presentation.tex build/prepared
TEXINPUTS=./lib/cel-slides-template-2025:$(dir $<):$$TEXINPUTS latexmk $< TEXINPUTS=./lib/cel-slides-template-2025:$(dir $<):$$TEXINPUTS \
mv build/presentation.pdf $@ latexmk -outdir=build/$* $<
cp build/$*/presentation.pdf $@
build/presentation_%_handout.pdf: src/%/presentation.tex build/prepared 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}"' $< TEXINPUTS=./lib/cel-slides-template-2025:$(dir $<):$$TEXINPUTS \
mv build/presentation.pdf $@ latexmk -outdir=build/$*_handout \
-pdflatex='$(RC_PDFLATEX) %O "\def\ishandout{1}\input{%S}"' $<
cp build/$*_handout/presentation.pdf $@
build/prepared: build/prepared:
mkdir build mkdir build

View File

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