File: makepdfsheet.sh

package info (click to toggle)
mathomatic 15.8.2-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 1,864 kB
  • ctags: 936
  • sloc: ansic: 20,646; makefile: 342; sh: 285; python: 94; awk: 39
file content (33 lines) | stat: -rwxr-xr-x 936 bytes parent folder | download
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 "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