aboutsummaryrefslogtreecommitdiff
path: root/build.sh
blob: 649b52294e4dee75501b8b0de685c07d92bb3f16 (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
55
56
57
set -e  # force exit upon error

function printColor {
  YELLOW='\033[0;33m'
  NC='\033[0m' # No Color
  printf "${YELLOW}$*${NC}\n"
}

function printLine {
  printColor "%`tput cols`s"|tr ' ' '#'
}

function printThenPython {
  printColor "python $*"
  python3 "$*"
}

if [[ $# -eq 0 ]] ; then
    echo 'please provide an argument in [data, simulations, figures, documents, all]'
    exit 1
fi

# process data
if [[ "$1" = "all" ]] || [[ "$1" = "data" ]] ; then
  printLine
  printColor data
  #printThenPython "data/TA A.py"
  #printThenPython "data/TA B.py"
  #printThenPython "data/TG A.py"
  #printThenPython "data/TG B.py"
fi

# make figures
if [[ "$1" = "all" ]] || [[ "$1" = "figures" ]] ; then
  printLine
  printColor figures
  #printThenPython "figures/absorbance.py"
  #printThenPython "figures/m_factors.py"
  #printThenPython "figures/movies_fitted.py"
  #printThenPython "figures/movies_combined.py"
  #printThenPython "figures/power_factors.py"
  #printThenPython "figures/driven_initial.py"
  #printThenPython "figures/TA_artifacts.py"
  #printThenPython "figures/TG_artifacts.py"
fi

# render documents
if [[ "$1" = "all" ]] || [[ "$1" = "dissertation" ]] ; then
  printLine
  printColor documents
  pdflatex --interaction=nonstopmode --shell-escape dissertation
  biber dissertation
  pdflatex --interaction=nonstopmode --shell-escape dissertation
  pdflatex --interaction=nonstopmode --shell-escape dissertation
fi

printColor finished