-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·39 lines (33 loc) · 871 Bytes
/
build.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
#!/usr/bin/env bash
# this script is a replacement for the Makefile script for those who don't have
# it already installed.
#
# Usage:
# buid.sh [command]
# Commands:
# clean Removes any generated files
# docs Generates a PDF file along with auxiliary files
DOC_DIR="latex"
LATEX="latexmk"
LATEX_FLAGS="-pdf -no-shell-escape -auxdir=$DOC_DIR -outdir=$DOC_DIR -quiet"
IN_FILE="$DOC_DIR/main.tex"
OUT_FILE="solution.pdf"
if [[ $# == 0 || $1 == "docs" ]]; then
$LATEX $LATEX_FLAGS $IN_FILE
exit
fi
if [[ "$1" == "clean" ]]; then
rm -rf $DOC_DIR/*.aux \
$DOC_DIR/*.cpt \
$DOC_DIR/*.log \
$DOC_DIR/*.lol \
$DOC_DIR/*.out \
$DOC_DIR/*.toc \
$DOC_DIR/*.fls \
$DOC_DIR/*.pdf \
$DOC_DIR/*.fdb_latexmk
else
echo "Unexpected argument"
exit 1
fi
exit