-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake-paper.sh
35 lines (26 loc) · 881 Bytes
/
make-paper.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
#!/usr/bin/env bash
# Configuration
OUTPUT_DIR=build
MAIN="main-paper.tex"
OTDK=otdk
PDFLATEX_OPTIONS_OTDK="pdflatex %O \"\def\printName{1}\def\otdk{1}\input{%S}\""
TDK_WITH_NAME=tdk-nevvel
PDFLATEX_OPTIONS_TDK_WITH_NAME="pdflatex %O \"\def\printName{1}\input{%S}\""
TDK_WITHOUT_NAME=tdk-nev-nelkul
PDFLATEX_OPTIONS_TDK_WITHOUT_NAME="pdflatex %O \"\input{%S}\""
# Actual build script
REQUESTED_VERSION=$1
rm -rf $OUTPUT_DIR
mkdir $OUTPUT_DIR
if [ "$REQUESTED_VERSION" == "$OTDK" ]; then
NAME="$OTDK"
OPTIONS="$PDFLATEX_OPTIONS_OTDK"
elif [ "$REQUESTED_VERSION" == "$TDK_WITH_NAME" ]; then
NAME="$TDK_WITH_NAME"
OPTIONS="$PDFLATEX_OPTIONS_TDK_WITH_NAME"
else
NAME="$TDK_WITHOUT_NAME"
OPTIONS="$PDFLATEX_OPTIONS_TDK_WITHOUT_NAME"
fi
latexmk -f -pdf -pdflatex="$OPTIONS" -jobname="$OUTPUT_DIR/$NAME" "$MAIN"
latexmk -c -f -jobname="$OUTPUT_DIR/$NAME" "$MAIN"