#!/bin/bash
if [ "$#" = 1 ]
then
  PARA=$1
else
  PARA=""
fi
datei="hvfloat.tex"
RUNS=1
echo "LuaLaTeX-Lauf Nr. $RUNS von $datei ======================================="
lualatex $datei
MAIN=$(basename -a -s .tex $datei)
xindex $MAIN
TEST=`grep -c "Label(s) may have changed." $MAIN.log`
while [ $TEST -gt 0 ]; 
   do
     let RUNS=RUNS+1
     echo " "
     echo "LuaLaTeX-Lauf Nr. $RUNS von $datei ======================================="
     lualatex $datei
     xindex $MAIN
     TEST=`grep -c "Label(s) may have changed." $MAIN.log `
     if [ $RUNS -gt 3 ]
       then TEST=0
     fi
   done
if [ "$PARA" = "clean" ]
then
  rm $MAIN.aux $MAIN.log $MAIN.out $MAIN.toc $MAIN.lot $MAIN.lof $MAIN.idx $MAIN.ind $MAIN.ilg
fi
#ps2pdf hvfloat.pdf hvfloat-ps2pdf.pdf
#cp hvfloat-ps2pdf.pdf hvfloat.pdf
echo "Fertig!"
echo " "
# $Id: runDOC.sh 771 2023-10-13 12:55:13Z herbert $
