A book about the Kaappi Scheme implementation, targeting beginners with some programming experience.
Requires XeLaTeX (TeX Live 2024+).
make # Full build (latexmk resolves TOC/index/refs)
make once # Single pass (fast iteration)
make view # Open PDF in default viewer
make clean # Remove build artifactsThe output is build/kaappi-book.pdf.
A print-ready wrap cover for the KDP 6"×9" paperback (back cover, spine, and front cover on one full-bleed sheet):
make cover # Print-ready PDF → build/cover.pdf
make cover-proof # Same, with KDP trim/bleed/spine/safe-area guides
make cover-proof PAGES=400 # Proof a hypothetical interior page count
make view-cover # Build and openAll horizontal geometry derives from \PageCount in cover.tex: the spine
width is pages × 0.002252" (KDP's black-&-white-on-white factor), and the
sheet width, fold positions, and proofing guides follow. After an interior
reflow, update \PageCount, rebuild, and eyeball make cover-proof. A build
warning fires if the spine gets too thin for the spine text (below ~0.32",
about 142 pages).
The front-cover cup illustration (images/cover-cup.png) was generated with
the Gemini API and post-processed with an alpha edge-fade so it blends into
the espresso background. To regenerate it:
GEMINI_API_KEY=... python3 scripts/generate-cover-cup.pyGeneration is nondeterministic — check that the steam still reads as a clean λ, then rebuild the cover.
main.tex Entry point
cover.tex KDP paperback wrap cover (see Cover above)
preamble/ LaTeX configuration (fonts, layout, styles, listings)
chapters/ Chapter source files
images/ Cover artwork (Gemini-generated cup illustration)
scripts/ Verification and asset-generation scripts
fonts/ Bundled TTF fonts (EB Garamond, Source Sans 3, Fira Code)
build/ Output directory (gitignored)
- EB Garamond — body text (serif)
- Source Sans 3 — headings (sans-serif)
- Fira Code — code listings (monospace)
| Part | Chapters |
|---|---|
| I: Getting Started | Introduction, Installation, First Steps |
| II: The Language | Data Types, Lists, Control Flow, Functions, Bindings, Higher-Order Functions, I/O |
| III: Going Further | Macros, Libraries, Records, Error Handling, Continuations |
| IV: Beyond R7RS | Standard Library (SRFIs), FFI, Concurrency |
| Appendices | R7RS Reference, CLI Reference, SRFI Catalog, Error Messages, Ecosystem, Glossary, Further Reading |
- Kaappi source — the Scheme implementation in Zig
- kaappi-lang.org — end-user documentation and interactive tour