Skip to content

Instantly share code, notes, and snippets.

@ljrk0
Created August 16, 2020 15:35
Show Gist options
  • Save ljrk0/b343a75728d90c68c28f1bd09ad110ef to your computer and use it in GitHub Desktop.
Save ljrk0/b343a75728d90c68c28f1bd09ad110ef to your computer and use it in GitHub Desktop.
Compile Donald Knuths TeXBook to test TeX distribution
#! /bin/sh
# run as ./textbook.sh texbook.tex > texbook_nodrm.tex
if [ $# -ne 1 ]; then
printf "Usage: ./texbook.sh texbook.tex > texbook_nodrm.tex\n" >&2
exit 1
fi
texbook="$1"
sed '9{b1 :1 s/ \\/\n\\/g}; 7,9{b2 :2 s/^/%/}; 9{b3 :3 s/$/\n\\proofmodefalse/}' "$texbook"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment