v4.2.0 — TikZ standalone → SVG via build-figures (#17)
[4.2.0] — 2026-05-23
Minor release. Closes #17 — book-scaffold build-figures now auto-compiles TikZ standalone .tex sources to .pdf via pdflatex before the existing PDF→SVG conversion runs. Additive only; consumers with .pdf-only figures are unaffected; consumers without TeX Live continue to work (clear ERROR + skip for .tex files; pre-built .pdf files still convert normally).
Added
- TikZ standalone → PDF → SVG pipeline (#17).
package/scripts/build-figures.mjsnow scansfigures/for both.pdfAND.texfiles. For each.texsource: if no sibling.pdfexists OR the.texis newer than the.pdf, runspdflatex -halt-on-error -interaction=nonstopmode -output-directory=. <name>.texin the source directory. The generated.pdfthen flows into the existing pdf2svg conversion stage unchanged. Missing-pdflatex case: emits clear ERROR with TeX Live install link (https://www.tug.org/texlive/) and skips.texfiles; continues processing any.pdf-only topics. Doesn't crash the build. package/recipes/16-tikz-figures.md— end-to-end recipe covering the\documentclass[tikz,border=2mm]{standalone}convention, discovery rule (when pdflatex runs vs skips), working-directory semantics (compiles infigures/<topic>/so\input{}relative paths work),.gitignoresnippet for intermediate.aux/.log/.fls/.fdb_latexmk/.synctex.gzfiles, TeX Live install instructions per OS, CI workflow snippet for runners that need to regenerate from source, and common debugging tips.tests/build-figures-tikz.test.mjs— 2 tests. (1) End-to-end: copy a minimaltikz-basic.texfixture to a temp project, runbuild-figures, assert thatpdfexists alongside.texAND that.svgexists underpublic/figures/sample/AND that the SVG contains valid<svg>markup. (2) Missing-pdflatex error message format. Both testsskipcleanly whenpdflatex/pdftocairoaren't on PATH (uses{ skip: undefined }semantics — Node 22's test runner treatsnullas a skip-with-reason, soundefinedis required for "run the test").tests/fixtures/figures/tikz-basic.tex— minimal TikZ standalone source for the pipeline test.- PACKAGE_DESIGN.md §7 — new "Optional system dependencies" subsection documenting
pdflatex+pdftocairoinstall paths. - PACKAGE_DESIGN.md §8 —
build-figuresrow updated to note the v4.2.0 TikZ stage.
Changed
build-figuresoutput line — now includestikz→pdfcount when stage 1 ran on at least one source (e.g.,build-figures: 3 total, 3 converted (0 png fallback), 0 cached, 1 tikz→pdf).
Migration
None. Pure additive minor release. Upgrade by bumping @brandon_m_behring/book-scaffold-astro and @brandon_m_behring/create-book to ^4.2.0 (lock-step). Consumers without .tex figures see zero behavior change. Consumers WITH .tex figures now get automatic compilation IF they have TeX Live installed; otherwise see a clear ERROR + continued processing of .pdf figures.
Release policy
- D12 lock-step preserved:
@brandon_m_behring/create-book@4.2.0ships alongside. - Pre-publish smoke gate (v3.6.5) ran end-to-end against academic + research-portfolio before publish.
- 171 unit tests pass (169 existing + 2 new TikZ tests; latter skip cleanly when TeX Live unavailable).
- Feedback loop: file friction at https://github.com/brandon-behring/book-scaffold-astro/issues with the
consumer:<workspace>label.