summaryrefslogtreecommitdiff
path: root/manual/presentation.sh
blob: a3557a47701c7b2e02c6796a1e132570d6311912 (plain)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash

fast_mode=false

set -- $(getopt fu "$@")
while [ $# -gt 0 ]; do
	case "$1" in
		-f)
			fast_mode=true
			;;
		--)
			shift
			break
			;;
		-*)
			echo "$0: error - unrecognized option $1" 1>&2
			exit 1
			;;
		*)
			break
	esac
	shift
done

PDFTEX_OPT="-shell-escape -halt-on-error"

set -ex

if ! $fast_mode; then
	md5sum *.aux *.snm *.nav *.toc > autoloop.old
	make -C PRESENTATION_Intro
	make -C PRESENTATION_ExSyn
	make -C PRESENTATION_ExAdv
	make -C PRESENTATION_ExOth
	make -C PRESENTATION_Prog
fi

set -ex

pdflatex $PDFTEX_OPT presentation.tex

if ! $fast_mode; then
	while
		md5sum *.aux *.snm *.nav *.toc > autoloop.new
		! cmp autoloop.old autoloop.new
	do
		cp autoloop.new autoloop.old
		pdflatex $PDFTEX_OPT presentation.tex
	done

	rm -f autoloop.old
	rm -f autoloop.new
fi