52 lines
1.3 KiB
Plaintext
52 lines
1.3 KiB
Plaintext
# This file is part of the PD system
|
|
# Copyright (C) 1998 Ralf Hartmut Gueting, Fachbereich Informatik, FernUniversitaet Hagen
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License
|
|
# as published by the Free Software Foundation; either version 2
|
|
# of the License, or (at your option) any later version.
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#!/bin/sh
|
|
#
|
|
# pd2dvi <file> - Converts a PD file to a TEX file
|
|
#
|
|
# May 2004, M. Spiekermann
|
|
|
|
function showError()
|
|
{
|
|
local errFile=".pd.err"
|
|
if [ -e $errFile ]; then
|
|
echo -e "Error in PD-File detected! \n"
|
|
cat $errFile
|
|
fi
|
|
}
|
|
|
|
|
|
pdFile="$1"
|
|
texFile="$1.tex"
|
|
dviFile="$1.dvi"
|
|
logFile="$1.log"
|
|
auxFile="$1.aux"
|
|
|
|
pd2tex $1;
|
|
|
|
showError
|
|
|
|
for dummy in 1 2 3
|
|
do
|
|
if { ! latex --interaction="nonstopmode" $texFile; }; then
|
|
|
|
printf "\n LaTeX-Error: Could not create $dviFile! "
|
|
printf "\n Study LaTeX's messages above and correct"
|
|
printf "\n the error in the PD-file $pdFile. \n\n"
|
|
rm -f $texFile $auxFile $dviFile
|
|
exit 2
|
|
fi
|
|
done
|
|
|
|
showError
|