1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#!/bin/sh
htmlfile="$1"quickref.html
pdffile=quickref.pdf
echo Generating the Mathomatic Quick Reference Sheet PDF file...
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 TRANSITIONAL//EN\">" >"$htmlfile"
echo '<html>' >>"$htmlfile"
echo '<head>' >>"$htmlfile"
echo '<title>Mathomatic Quick Reference Sheet</title>' >>"$htmlfile"
echo '</head>' >>"$htmlfile"
echo '<body>' >>"$htmlfile"
echo '<pre>' >>"$htmlfile"
./mathomatic -e "set html all" "help all main equations constants >>$htmlfile" || (rm "$htmlfile"; exit 1)
echo >>"$htmlfile"
echo '<strong>For more information, visit <a href="http://www.mathomatic.org">www.mathomatic.org</a></strong>' >>"$htmlfile"
echo '</pre>' >>"$htmlfile"
echo '</body>' >>"$htmlfile"
echo '</html>' >>"$htmlfile"
if htmldoc --webpage --format pdf --linkstyle plain --no-links -f "$pdffile" "$htmlfile"
then
echo "$pdffile" successfully created.
rm "$htmlfile"
exit 0
else
rm "$htmlfile"
exit 1
fi
|