X-Git-Url: https://git.distorted.org.uk/~mdw/doc/wrestlers/blobdiff_plain/8b8b883978ff98f5d9edc60f1bf6771b3d66b617..32609df3198ff2b57dc418199e863c3e16ffa8f0:/build-latex.sh diff --git a/build-latex.sh b/build-latex.sh new file mode 100755 index 0000000..869cb28 --- /dev/null +++ b/build-latex.sh @@ -0,0 +1,27 @@ +#! /bin/sh + +set -e +jobname=$1 opts=$2 file=$3 preamble=$4 + +case ",$opts," in + *,pdf,*) tex=pdflatex ext=pdf;; + *) tex=latex ext=dvi;; +esac + +for i in toc lot lof aux ind idx ilg bbl blg log; do + rm -f "$jobname".$i +done + +$tex -jobname "$jobname" "\\relax $preamble \\input $file" +case ",$opts," in *,bibtex,*) bibtex "$jobname".aux;; esac +$tex -jobname "$jobname" "\\relax $preamble \\input $file" +$tex -jobname "$jobname" "\\relax $preamble \\input $file" +case ",$opts," in + *,index=*,*) + ist=$(echo "$opts" | sed 's:.*,index=\([^,]*\),.*$:\1:') + makeindex -s"$ist" "$jobname".idx + ;; +esac +$tex -jobname "$jobname" "\\relax $preamble \\input $file" + +echo timestamp >"$jobname".$ext-stamp