-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (23 loc) · 817 Bytes
/
Makefile
File metadata and controls
29 lines (23 loc) · 817 Bytes
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
28
29
.PHONY: html pdf pdflatex slides clean avif2png
html:
jupyter-book build book/
pdf:
jupyter-book build book/ --builder pdfhtml
# Generate LaTeX, convert AVIF→PNG for XeLaTeX, then compile
pdflatex: avif2png
jupyter-book build book/ --builder latex
@find book/_build/latex/ -name '*.avif' -exec sh -c \
'magick "$$1" "$${1%.avif}.png"' _ {} \;
@sed -i '' 's/\.avif/.png/g' book/_build/latex/*.tex
cd book/_build/latex && make
# Convert AVIF→PNG beside originals for LaTeX builds
avif2png:
@echo "Converting AVIF → PNG for LaTeX..."
@find book/ -name '*.avif' ! -path '*/_build/*' -exec sh -c \
'magick "$$1" "$${1%.avif}.png"' _ {} \;
slides:
$(MAKE) -C slides
clean:
jupyter-book clean book/
@find book/ -name '*.avif' ! -path '*/_build/*' \
-exec sh -c 'rm -f "$${1%.avif}.png"' _ {} \;