File: makepdfsheet.sh

package info (click to toggle)
mathomatic 16.0.5-5.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,192 kB
  • sloc: ansic: 22,029; makefile: 340; sh: 319; python: 96; awk: 39
file content (33 lines) | stat: -rwxr-xr-x 951 bytes parent folder | download | duplicates (4)
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