-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile_thesis.sh
executable file
·76 lines (65 loc) · 1.91 KB
/
compile_thesis.sh
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
####################################################
# Script setup and documentation
####################################################
set -e
m_verbose="no"
m_fig_compile="no"
m_man_compile="no"
function Help()
{
# Display Help
echo "Compiles the thesis' manuscript."
echo "Recommended use is ./compile_thesis.sh -f -m"
echo
echo "Syntax: scriptTemplate [-f|h|m|v]"
echo "options:"
echo "f Compiles TikZ figures only"
echo "h Prints this Help."
echo "m Compiles the manuscript only (figures MUST have been compiled beforehand)"
echo "v Verbose mode."
echo
}
while getopts ":fhmv" option; do
case $option in
f) # compile figures
m_fig_compile="yes";;
h) # display Help
Help
exit;;
m) # compile full manuscript
m_man_compile="yes";;
v) # verbose
m_verbose="yes";;
\?) # Invalid
echo "Error: Invalid option"
exit;;
esac
done
if [ -z "$*" ]; then Help; exit; fi
####################################################
# Compile figures for each part separately
####################################################
if [ $m_fig_compile = "yes" ]; then
source ./compilation_chain/0_front_matter.sh
source ./compilation_chain/1_main_matter.sh
source ./compilation_chain/2_appendices.sh
source ./compilation_chain/3_back_matter.sh
fi
####################################################
# Main compilation
####################################################
if [ $m_man_compile = "yes" ]; then
# Creating main output dirs
mkdir -p out
mkdir -p out/0_front_matter
mkdir -p out/1_main_matter
mkdir -p out/2_appendices
mkdir -p out/3_back_matter
# Main compilation
lualatex -synctex=1 -output-directory out -interaction=errorstopmode thesis.tex
(cd out && makeglossaries thesis)
biber --output-directory out thesis
lualatex -synctex=1 -output-directory out -interaction=errorstopmode thesis.tex
lualatex -synctex=1 -output-directory out -interaction=errorstopmode thesis.tex
fi