diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..a881a3a064fc00178981fd88087a806dfd7d29ef --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +*.acn +*.acr +*.alg +*.aux +*.bbl +*.blg +*.cls +*.glg +*.glo +*.gls +*.glsdefs +*.hd +*.idx +*.ilg +*.ind +*.ist +*.loa +*.lof +*.log +*.lot +*.out +*.toc +example.pdf +vutinfth.pdf \ No newline at end of file diff --git a/build-all.sh b/build-all.sh old mode 100644 new mode 100755 diff --git a/build-thesis.sh b/build-thesis.sh old mode 100644 new mode 100755 index 2787aa7a8e86ee35070b3c2a850bd722d07b27a1..0004e2a4b5e899e61cc70419df932ca79fe991b1 --- a/build-thesis.sh +++ b/build-thesis.sh @@ -1,20 +1,53 @@ #!/bin/sh # Copyright (C) 2014-2020 by Thomas Auzinger -# Replace the 'x' in the next line with the name of the thesis' main LaTeX document without the '.tex' extension -SOURCE=x +usage() { + echo "Usage: $0 path/to/THESIS.tex" >&2 +} + +# parse command line argument for the "SOURCE" variable value +SOURCE= +WORKDIR= +while [ $# -ge 1 ]; +do + arg="$1" + case "$arg" in + -h|--help) + usage + exit 1 + ;; + *) + # the value of SOURCE is the given file name without the '.tex' + # extension. + # the value of WORKDIR is the directory where the filename + # resides. + SOURCE="$(basename "$arg" .tex)" + WORKDIR="$(dirname "$arg")" + ;; + esac + shift +done + +[ -n "$SOURCE" ] || { + usage + exit 1 +} + +cd "$WORKDIR" + +echo "building thesis '$SOURCE' in directory '$WORKDIR'" >&2 # Build the thesis document -pdflatex $SOURCE -bibtex $SOURCE -pdflatex $SOURCE -pdflatex $SOURCE -makeindex -t $SOURCE.glg -s $SOURCE.ist -o $SOURCE.gls $SOURCE.glo -makeindex -t $SOURCE.alg -s $SOURCE.ist -o $SOURCE.acr $SOURCE.acn -makeindex -t $SOURCE.ilg -o $SOURCE.ind $SOURCE.idx -pdflatex $SOURCE -pdflatex $SOURCE +pdflatex "$SOURCE" +bibtex "$SOURCE" +pdflatex "$SOURCE" +pdflatex "$SOURCE" +makeindex -t "$SOURCE.glg" -s "$SOURCE.ist" -o "$SOURCE.gls" "$SOURCE.glo" +makeindex -t "$SOURCE.alg" -s "$SOURCE.ist" -o "$SOURCE.acr" "$SOURCE.acn" +makeindex -t "$SOURCE.ilg" -o "$SOURCE.ind" "$SOURCE.idx" +pdflatex "$SOURCE" +pdflatex "$SOURCE" -echo -echo -echo Thesis document compiled. +echo >&2 +echo >&2 +echo Thesis document compiled. >&2