#!/bin/bash for FILE in $(find img/ -iname '*.xml') ; do if [ ! -f "${FILE%.xml}.pdf" -o "$FILE" -nt "${FILE%.xml}.pdf" ] ; then ipetoipe -pdf -runlatex $FILE ${FILE%.xml}.pdf fi done if [ ! -f "Algorithmen.toc" ] ; then # Run it twice to generate TOC pdflatex Algorithmen.tex fi pdflatex Algorithmen.tex