build: the book compiles on this Ubuntu — tectonic + dual-engine preamble

No root available here, so the toolchain is tectonic (single user-space
binary, packages fetched on demand). The preamble unicode block is now
dual-engine: pdfTeX keeps its DeclareUnicodeCharacter list, XeTeX gets a
newunicodechar twin generated from the same 37 mappings — both branches
must stay green (Mac pdflatex, Ubuntu tectonic). build.sh is the one
command. The committed PDF is current for the first time since July 6:
116 pages, ch13 + the live-log section finally in print.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
mrwulf 2026-08-08 00:03:34 +02:00
parent 62d12dc3fa
commit f0088a317e
3 changed files with 99 additions and 37 deletions

16
build.sh Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Build the book. No root, no TeX Live install: tectonic is a single
# user-space binary that fetches packages on demand (first run is slow,
# after that it's seconds). pdflatex also works (the preamble carries a
# dual-engine unicode block); tectonic is what the repo's button uses.
set -euo pipefail
cd "$(dirname "$0")"
TECTONIC="${TECTONIC:-$HOME/.local/bin/tectonic}"
if [ ! -x "$TECTONIC" ] && command -v tectonic >/dev/null; then TECTONIC=tectonic; fi
[ -x "$TECTONIC" ] || command -v "$TECTONIC" >/dev/null || {
echo "no tectonic. Install (no root):"
echo " curl -sL https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.15.0/tectonic-0.15.0-x86_64-unknown-linux-musl.tar.gz | tar xz -C ~/.local/bin"
exit 1
}
"$TECTONIC" -X compile main.tex
pdfinfo main.pdf 2>/dev/null | grep Pages || true

BIN
main.pdf

Binary file not shown.

View file

@ -109,6 +109,51 @@
\newcommand{\lean}[1]{\inlinecode{#1}}
\newcommand{\rust}[1]{\inlinecode{#1}}
\newcommand{\code}[1]{\inlinecode{#1}}
% Unicode in Lean listings, both engines. pdfTeX maps code points via
% inputenc; XeTeX/Tectonic is natively Unicode but the tt font lacks the
% glyphs, so newunicodechar substitutes the same math forms. BOTH branches
% derive from one list — edit both or the engines diverge (the build button
% compiles under tectonic, the Mac under pdflatex; both must stay green).
\ifdefined\XeTeXversion
\usepackage{newunicodechar}
\newunicodechar{}{\ensuremath{\to}} %
\newunicodechar{}{\ensuremath{\leftarrow}} %
\newunicodechar{}{\ensuremath{\leftrightarrow}} %
\newunicodechar{}{\ensuremath{\forall}} %
\newunicodechar{}{\ensuremath{\exists}} %
\newunicodechar{}{\ensuremath{\wedge}} %
\newunicodechar{}{\ensuremath{\vee}} %
\newunicodechar{¬}{\ensuremath{\neg}} % ¬
\newunicodechar{}{\ensuremath{\neq}} %
\newunicodechar{}{\ensuremath{\leq}} %
\newunicodechar{}{\ensuremath{\geq}} %
\newunicodechar{}{\ensuremath{\vdash}} %
\newunicodechar{·}{\ensuremath{\cdot}} % ·
\newunicodechar{}{\ensuremath{\mathbb{N}}} %
\newunicodechar{}{\ensuremath{\mathbb{Z}}} %
\newunicodechar{}{\ensuremath{\ell}} %
\newunicodechar{×}{\ensuremath{\times}} % ×
\newunicodechar{}{\ensuremath{\in}} %
\newunicodechar{}{\ensuremath{\Sigma}} %
\newunicodechar{}{\ensuremath{\equiv}} %
\newunicodechar{}{\ensuremath{\mid}} %
\newunicodechar{}{\ensuremath{\langle}} %
\newunicodechar{}{\ensuremath{\rangle}} %
\newunicodechar{𝔽}{\ensuremath{\mathbb{F}}} % 𝔽
\newunicodechar{}{\ensuremath{{}_0}} %
\newunicodechar{}{\ensuremath{{}_1}} %
\newunicodechar{}{\ensuremath{{}_2}} %
\newunicodechar{²}{\ensuremath{{}^2}} % ²
\newunicodechar{}{\ensuremath{{}^5}} %
\newunicodechar{}{\ensuremath{\checkmark}} %
\newunicodechar{}{\ensuremath{\times}} %
\newunicodechar{}{\ensuremath{{}^{-}}} %
\newunicodechar{¹}{\ensuremath{{}^{1}}} % ¹
\newunicodechar{³}{\ensuremath{{}^{3}}} % ³
\newunicodechar{}{\ensuremath{{}^{0}}} %
\newunicodechar{}{\ensuremath{{}^{4}}} %
\newunicodechar{}{\ensuremath{{}^{6}}} %
\else
\DeclareUnicodeCharacter{2192}{\ensuremath{\to}} %
\DeclareUnicodeCharacter{2190}{\ensuremath{\leftarrow}} %
\DeclareUnicodeCharacter{2194}{\ensuremath{\leftrightarrow}} %
@ -146,6 +191,7 @@
\DeclareUnicodeCharacter{2070}{\ensuremath{{}^{0}}} %
\DeclareUnicodeCharacter{2074}{\ensuremath{{}^{4}}} %
\DeclareUnicodeCharacter{2076}{\ensuremath{{}^{6}}} %
\fi
% ---- pedagogical boxes: each means ONE thing ----------------------------
% BIG IDEA — the load-bearing concept of a section.