Add the EPUB edition: converter, class-based audit, shared front matter

tools/make_epub.py converts the same src/ the PDF is set from, running
polish.py first, with original page numbers as page-list metadata, endnotes
gathered in one linked Notes section, and the colophon and errata included.
It raises on any macro it does not declare. tools/epub_audit.py checks by
class of fault (LaTeX residue, escaping, empty blocks, links, images, XML,
content, typography drift from the PDF); make epub runs both.

\byedition{PDF}{EPUB} lets the colophon carry the sentences that are true of
only one edition; the errata introduction moves into src/errata.tex so both
editions print one copy. reprocheck.py now accepts an .epub and skips
environment parameters that are layout, not copy.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bdeshiandClaude Sonnet 5.5 committed 2026-09-29 14:36:18 +06:00
1 parent 2ec880d1c4
commit 4424cc9887
8 files changed
+1472 -10

No files matched your search

+5 -1
View File
@@ -11,7 +11,7 @@ SOURCES := build.sh tools/polish.py tools/gen_seal.py tools/gen_cover_mosaic.py
src/errata.tex $(wildcard src/pages/*.tex)
.DEFAULT_GOAL := pdf
.PHONY: pdf build image prep plate cover check reprocheck verify clean distclean shell help
.PHONY: pdf build image prep plate cover epub check reprocheck verify clean distclean shell help
# The PDF is a build product and is not in git. This remakes it from src/ and
# plates/, neither of which needs the ProQuest scan — only prep and plate do.
@@ -43,6 +43,10 @@ reprocheck: ## every token of src/pages must reach the built PDF
# so make would skip the rebuild and verify would pass against stale output.
verify: check build reprocheck ## the full gate: check, typeset unconditionally, then prove nothing was dropped
epub: ## build the reflowable EPUB (needs the PDF built, for its cover), then audit it
$(RUN) python3 tools/make_epub.py
$(RUN) python3 tools/epub_audit.py
cover: ## rebuild the cover mosaic from plates/ and fonts/
$(RUN) python3 tools/gen_cover_mosaic.py --force