forked from acidanthera/OpenCorePkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildDocs.tool
executable file
·55 lines (42 loc) · 1.34 KB
/
BuildDocs.tool
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
55
#!/bin/bash
abort() {
echo "ERROR: $1!"
exit 1
}
latexbuild() {
# Perform file cleanup.
rm -f ./*.aux ./*.log ./*.out ./*.pdf ./*.toc
# Perform a first pass
pdflatex -draftmode "$1" "$2" || \
abort "Unable to create $1 draft"
# Perform a number of TOC passes.
while grep 'Rerun to get ' "${1}.log" ; do
pdflatex -draftmode "$1" "$2" || \
abort "Unable to create $1 draft with TOC"
done
# Create a real PDF.
pdflatex "$1" "$2" || \
abort "Unable to create $1 PDF"
# Perform a number of TOC passes for PDF (usually not needed).
while grep 'Rerun to get ' "${1}.log" ; do
pdflatex -draftmode "$1" "$2" || \
abort "Unable to create $1 PDF with TOC"
done
}
cd "$(dirname "$0")" || abort "Wrong directory"
if [ "$(which latexdiff)" = "" ]; then
abort "latexdiff is missing, check your TeX Live installation"
fi
if [ "$(which pdflatex)" = "" ]; then
abort "pdflatex is missing, check your TeX Live installation"
fi
latexbuild Configuration
cd Differences || abort "Unable to process annotations"
rm -f ./*.aux ./*.log ./*.out ./*.pdf ./*.toc
latexdiff -s ONLYCHANGEDPAGE PreviousConfiguration.tex ../Configuration.tex \
> Differences.tex || \
abort "Unable to differentiate"
latexbuild Differences -interaction=nonstopmode
cd ../Errata || abort "Unable to process annotations"
latexbuild Errata
exit 0