summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2024-03-14 04:05:41 +0100
committerJonas Smedegaard <dr@jones.dk>2024-03-14 04:05:41 +0100
commit864746328c2dc5a1bf66f99307365d0d0097e9cf (patch)
tree607cb4fdd4fcb7178c3e1eee263e6e502d9ce032 /Makefile
parentb522facf28a1c1a1a9e4e08470bb342e90017899 (diff)
add make targets diff-*
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 2a5dd64..73690df 100644
--- a/Makefile
+++ b/Makefile
@@ -87,3 +87,28 @@ $(ARTICLES:%=turtle-from-%): turtle-from-%: _site/%/index.pdf
$(ARTICLES:%=dotgraph-from-%): dotgraph-from-%: _site/%/index.pdf
@bin/xmp2rdfxml _site/$*/index.pdf \
| rapper -i rdfxml -o dot - $(BASE_IRI)$*/
+
+diff-all: $(ARTICLES:%=diff-of-%)
+
+$(ARTICLES:%=diff-of-%): diff-of-%: %/changes.tex
+
+$(ARTICLES:%=%/changes.tex): %/changes.tex: %/a.tex %/b.tex
+ latexdiff --type CULINECHBAR --subtype COLOR --replace-context2cmd '' $^ > $*/index_diff.tex
+ perl -i -pe 's/\[pdftex\]{changebar}/[luatex]{changebar}/g' $*/index_diff.tex
+ latexmk --gg --lualatex --cd --silent --Werror $*/index_diff.tex
+ find $*/ -name 'index_diff.*' -not -name index_diff.pdf -delete
+ rm -f $^
+
+$(ARTICLES:%=%/a.tex): %/a.tex:
+ git switch --detach $(shell git describe --tags --abbrev=0)
+ QUARTO_LOG_LEVEL=quiet \
+ quarto render $*/index.qmd --to pdf -M keep-tex:true --output a.pdf
+ mv --force $*/index.tex $@
+ rm --force _site/a.pdf
+
+$(ARTICLES:%=%/b.tex): %/b.tex:
+ git switch -
+ QUARTO_LOG_LEVEL=quiet \
+ quarto render $*/index.qmd --to pdf -M keep-tex:true --output b.pdf
+ mv --force $*/index.tex $@
+ rm --force _site/b.pdf