TIVI-153: add as dependency for iputils
[profile/ivi/docbook-utils.git] / backends / dvi
1 # Backend to convert something into DVI
2 # Send any comments to Eric Bischoff <eric@caldera.de>
3 # This program is under GPL license. See LICENSE file for details.
4
5 TEXINPUTS="$(dirname "${SGML_FILE}"):${TEXINPUTS}"
6 export TEXINPUTS
7
8 # Convert to TeX
9 $SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS
10 if [ $? -ne 0 ]
11 then exit 1
12 fi
13
14 # Convert from TeX to DVI
15 jadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp
16 if [ $? -ne 0 ]
17 then
18   cat ${SGML_FILE_NAME}.tmp
19   rm ${SGML_FILE_NAME}.tmp
20   rm ${SGML_FILE_NAME}.tex
21   exit 2
22 fi
23 rm ${SGML_FILE_NAME}.tmp
24
25 # If there are unresolved references, re-run jadetex, twice 
26 if egrep '^LaTeX Warning: There were undefined references.$' ${SGML_FILE_NAME}.log >/dev/null 2>&1
27 then
28     jadetex ${SGML_FILE_NAME}.tex >/dev/null
29     jadetex ${SGML_FILE_NAME}.tex >/dev/null
30 fi
31 rm ${SGML_FILE_NAME}.log
32 rm ${SGML_FILE_NAME}.aux
33 rm ${SGML_FILE_NAME}.tex
34 rm ${SGML_FILE_NAME}.out
35
36 exit 0