Phase 5e: the LaTeX emitter — the guide compiles into a real book - #16
Merged
Conversation
scripts/emit-latex.ts walks the same chapterBlocks the app renders and prints book/gradient-lab.tex; tectonic compiles it to a 61-page PDF. npm run book does both. One source of truth, screen and print — the whole point of the block migration, now closed end to end. - rich.ts gains richToTex/escapeTex: math passes through untouched, prose escapes in a single character pass (no rule can mangle another rule's output), theme spans take the light branch, the app's Unicode symbols map to robust TeX commands (5 new serializer tests) - every block kind maps to a print environment: displays become numbered equations labelled eq:<registry-key>, honesty notes take the outer margin under an ∞ small-caps tag, concept/recipe/proof/frontier share one quiet box style, proofs close with a QED rule, the bestiary and further-reading lists come from their content modules, and every chapter ends with its live gradientlab.ai deep link - figures emit labelled placeholders until the compute/render split; interactive widgets point at the app (print fallbacks later) - memoir + unicode-math + tcolorbox under tectonic (kaobook isn't in tectonic's bundle; memoir was the plan's designated fallback); chapter titles carry math via texorpdfstring - CI: .github/workflows/book.yml compiles the PDF artifact on every push to main that touches content or the emitter Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploying gradient-lab with
|
| Latest commit: |
d20d5f0
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://51ee6fb9.gradient-lab.pages.dev |
| Branch Preview URL: | https://phase5e-figures.gradient-lab.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The milestone
npm run booknow walks the samechapterBlocksthe app renders and produces a compiling, 61-page PDF of the entire guide — one source of truth, screen and print. This is the payoff the whole block migration was building toward, closed end to end.What's in it
richToTexbesiderichToHtml— the token AST grew its second serializer: math passes through untouched (it was always LaTeX), prose escapes in a single character-level pass so no rule can mangle another's output, theme spans take the light branch, and the app's Unicode symbols (✓ ✗ ∞ ½ κ γ …) map to robust TeX commands. Five new tests.eq:<registry-key>(the registry key is the label, as planned); the honesty notes take the outer margin under an ∞ small-caps tag — the margin channel the plan called the book's intellectual integrity; concept/recipe/proof/frontier share one quiet box; proofs close with a QED rule; the optimizer cards print with year/author/idea/equation/✓✗ lines; the bestiary and further-reading lists come straight from their content modules; and every chapter ends with its livegradientlab.aideep link.\texorpdfstring.bookworkflow compiles the PDF artifact on every push to main touching content or the emitter — the printed book can never drift from the live guide.Verified
Compiles locally with zero errors (two overfull-hbox warnings from long URLs — cosmetic); eyeballed the output: numbered chapters and equations, boxes, margin notes, working links. App untouched: 199 tests,
svelte-checkclean, build green.What comes next
The figure compute/render split (pure geometry + themed SVG render,
printpalette, injectable canvas) replaces the placeholders one figure at a time; then the typographic pass (fonts, kaobook vendoring if wanted, QR shortlinks).🤖 Generated with Claude Code