#!/bin/sh # make_book - create a PDF book of the prover9 manual. # by David A. Wheeler. # Must place in, and run, in the directory with the prover9 HTML files. # Depends on having htmldoc # and perl installed, and the associated file "setup_book.pl" must # also be installed in the same directory. # Generates "finalbook.pdf". # Create subdirectory, so we can change the HTML we generate, and go there. rm -fr tempdir mkdir tempdir cp -p *.html *.gif setup_book.pl tempdir cd tempdir # First, clean up HTML errors in the HTML manual. # General - character quoting errors. perl -p -i -e 's/&([^#A-Za-z0-9&])/&\1/g;' *.html perl -p -i -e 's/&&/&&/g;' *.html perl -p -i -e 's/<->/<->/g;' *.html perl -p -i -e 's/<-/<-/g;' *.html perl -p -i -e 's/([^-])->/\1->/g;' *.html perl -p -i -e 's/([^-])->/\1->/g;' *.html perl -p -i -e 's/"<"/"<"/g;' *.html perl -p -i -e 's/"<="/"<="/g;' *.html perl -p -i -e 's/">"/">"/g;' *.html perl -p -i -e 's/">="/">="/g;' *.html perl -p -i -e 's/ < / < /g;' *.html perl -p -i -e 's/ > / > /g;' *.html perl -p -i -e 's/<=/<=/g;' *.html # Don't do: perl -p -i -e 's/>=/>=/g;' *.html # In others.html, fix

...

into

...

: perl -p -i -e 's!

TPTP_to_LADR

!

TPTP_to_LADR

!' others.html perl -p -i -e 's!

LADR_to_TPTP

!

LADR_to_TPTP

!' others.html # We could try running tidy (htmltidy), but that is unhappy with the HTML: # tidy -m *.html # Create list of filenames, and invoke htmldoc to complete the work. htmldoc --book -f finalbook.pdf --size letter -t pdf14 --no-strict \ --numbered --duplex --title --titleimage prover9-5a-256t.gif \ `./setup_book.pl < nav.html` # Move the results back up, since we're in a temporary subdirectory. mv finalbook.pdf .. # We'll leave the temporary subdirectory results behind, in case they're # needed for debugging the document.