#!/bin/bash

cd "$(dirname "$0")"

#git pull origin master

pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=All4 All4.tex
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=All4 All4.tex
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=All4 All4.tex
pdflatex -file-line-error -interaction nonstopmode -jobname=All4 All4.tex
rm All4.aux All4.out All4.toc
mv All4.pdf /home/david/fileshare/Anders/

cd book-1
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book1 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book1 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book1 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -jobname=Book1 "Main.tex"
rm Book1.aux Book1.out Book1.toc
mv Book1.pdf /home/david/fileshare/Anders/
cd ..

cd book-2
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book2 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book2 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book2 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -jobname=Book2 "Main.tex"
rm Book2.aux Book2.out Book2.toc
mv Book2.pdf /home/david/fileshare/Anders/
cd ..

cd book-3
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book3 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book3 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book3 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -jobname=Book3 "Main.tex"
rm Book3.aux Book3.out Book3.toc
mv Book3.pdf /home/david/fileshare/Anders/
cd ..

cd book-4
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book4 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book4 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -draftmode -jobname=Book4 "Main.tex"
pdflatex -file-line-error -interaction nonstopmode -jobname=Book4 "Main.tex"
rm Book4.aux Book4.out Book4.toc
mv Book4.pdf /home/david/fileshare/Anders/
