50 lines
1022 B
Bash
Executable File
50 lines
1022 B
Bash
Executable File
#!/bin/bash
|
|
|
|
BASENAME=referentiel-competences
|
|
NBPASS=3 # il faut 3 passes de compilation
|
|
|
|
usage () {
|
|
echo "Usage: $0 [-f|--fast] help|draft|pub|clean"
|
|
echo " draft: generates draft version, including toc and comments"
|
|
echo " pub: generates publication ready version"
|
|
echo " clean: cleanup all (non versioned) tex files"
|
|
echo "--fast (or -f) option just make one compilation pass instead of $NBPASS"
|
|
|
|
exit 1
|
|
}
|
|
|
|
if [ "$1" == "-f" ] || [ "$1" == "--fast" ]; then
|
|
NBPASS1=1
|
|
shift
|
|
else
|
|
NBPASS1=$NBPASS
|
|
fi
|
|
|
|
if [ $# != 1 ] || [ "$1" == "help" ]; then
|
|
usage
|
|
fi
|
|
|
|
if [ "$1" = "clean" ]; then
|
|
/bin/rm -f "$BASENAME"*.aux "$BASENAME"*.pdf "$BASENAME"*.toc "$BASENAME"*.snm "$BASENAME"*.nav "$BASENAME"*.log
|
|
exit 0
|
|
fi
|
|
|
|
if [ "$1" != "pub" ] && [ "$1" != "draft" ]
|
|
then
|
|
usage
|
|
fi
|
|
|
|
build () {
|
|
for (( i=1; i<=$NBPASS1; i++ ))
|
|
do
|
|
echo "----------------- pass $i"
|
|
pdflatex -jobname "$1"-"$2" '\def\'$2'{}\input{comp}'
|
|
done
|
|
}
|
|
|
|
|
|
build "$BASENAME" "$1"
|
|
|
|
|
|
|