build-thesis.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. # Copyright (C) 2014-2017 by Thomas Auzinger <thomas@auzinger.name>
  3. # Replace the 'x' in the next line with the name of the thesis' main LaTeX document without the '.tex' extension
  4. SOURCE=z1_ot
  5. function with_error_checking()
  6. {
  7. rm *.bbl
  8. # Build the thesis document
  9. pdflatex $SOURCE && \
  10. bibtex $SOURCE && \
  11. pdflatex $SOURCE && \
  12. pdflatex $SOURCE && \
  13. makeindex -t $SOURCE.glg -s $SOURCE.ist -o $SOURCE.gls $SOURCE.glo && \
  14. makeindex -t $SOURCE.alg -s $SOURCE.ist -o $SOURCE.acr $SOURCE.acn && \
  15. makeindex -t $SOURCE.ilg -o $SOURCE.ind $SOURCE.idx && \
  16. pdflatex $SOURCE && \
  17. pdflatex $SOURCE && \
  18. echo Thesis document compiled. ||
  19. echo Something failed.
  20. }
  21. function force()
  22. {
  23. # Build the thesis document
  24. pdflatex $SOURCE
  25. bibtex $SOURCE
  26. pdflatex $SOURCE
  27. pdflatex $SOURCE
  28. makeindex -t $SOURCE.glg -s $SOURCE.ist -o $SOURCE.gls $SOURCE.glo
  29. makeindex -t $SOURCE.alg -s $SOURCE.ist -o $SOURCE.acr $SOURCE.acn
  30. makeindex -t $SOURCE.ilg -o $SOURCE.ind $SOURCE.idx
  31. pdflatex $SOURCE
  32. pdflatex $SOURCE
  33. echo Thesis document compiled.
  34. }
  35. if [ $1 = 'f' ]; then
  36. force
  37. else
  38. with_error_checking
  39. fi