#!/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