5 if [ "$VERBOSE" -ge 1 ]
7 echo >&2 "Post-process XSL-FO to DVI"
9 if [ -z "`type -t $XMLTEX_PATH`" ]
11 echo >&2 "Can't process, xmltex tool not found at $XMLTEX_PATH."
14 # Work around stupid tetex bug with '_' in filenames
15 # Also work around stupid tetex limitation with long lines (rhbz #101055)
16 # and workaround passivetex limitation for chapter titles starting with L
18 ${SED_PATH} -e "s,/>,/>\n,g" \
19 -e "s,block>,&\n,g" "$XSLT_PROCESSED" >tmp.fo
21 TEXINPUTS="$(dirname "$INPUT_FILE")::$SEARCHPATH"
23 "$XMLTEX_PATH" ${POSTARGS} tmp.fo >$OUT </dev/null || { cat $OUT; exit 1; }
24 [ "$VERBOSE" -ge 2 ] && echo >&2 "First pass complete"
25 # If there were undefined references we need to re-run xmltex.
26 if egrep '^LaTeX Warning: There were undefined references.$' $OUT \
28 || egrep '^LaTeX Warning: Label.s. may have changed\.' $OUT \
31 "$XMLTEX_PATH" ${POSTARGS} tmp.fo >$OUT </dev/null
32 [ "$VERBOSE" -ge 2 ] && echo >&2 "Second pass complete"
33 "$XMLTEX_PATH" ${POSTARGS} tmp.fo >$OUT </dev/null
34 if [ "$VERBOSE" -ge 2 ]
36 echo >&2 "Third pass complete"
37 [ "$VERBOSE" -ge 3 ] && cat $OUT
40 ${GCP_PATH:-cp} -R -P -p -- *.dvi "$OUTPUT_DIR/$(basename "${XSLT_PROCESSED%.*}").dvi"