summaryrefslogtreecommitdiff
path: root/format/fo/dvi
diff options
context:
space:
mode:
Diffstat (limited to 'format/fo/dvi')
-rwxr-xr-xformat/fo/dvi42
1 files changed, 42 insertions, 0 deletions
diff --git a/format/fo/dvi b/format/fo/dvi
new file mode 100755
index 0000000..f294153
--- /dev/null
+++ b/format/fo/dvi
@@ -0,0 +1,42 @@
+case "$1" in
+stylesheet)
+ ;;
+post-process)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Post-process XSL-FO to DVI"
+ fi
+ if [ -z "`type -t $XMLTEX_PATH`" ]
+ then
+ echo >&2 "Can't process, xmltex tool not found at $XMLTEX_PATH."
+ exit 3
+ fi
+ # Work around stupid tetex bug with '_' in filenames
+ # Also work around stupid tetex limitation with long lines (rhbz #101055)
+ # and workaround passivetex limitation for chapter titles starting with L
+ # (rhbz #526273)
+ sed -e "s,/>,/>\n,g" \
+ -e "s,block>,&\n,g" "$XSLT_PROCESSED" >tmp.fo
+ OUT=output
+ TEXINPUTS="$(dirname "$INPUT_FILE")::$SEARCHPATH"
+ export TEXINPUTS
+ "$XMLTEX_PATH" ${POSTARGS} tmp.fo >$OUT </dev/null || { cat $OUT; exit 1; }
+ [ "$VERBOSE" -ge 2 ] && echo >&2 "First pass complete"
+ # If there were undefined references we need to re-run xmltex.
+ if egrep '^LaTeX Warning: There were undefined references.$' $OUT \
+ >/dev/null 2>&1 \
+ || egrep '^LaTeX Warning: Label.s. may have changed\.' $OUT \
+ >/dev/null 2>&1
+ then
+ "$XMLTEX_PATH" ${POSTARGS} tmp.fo >$OUT </dev/null
+ [ "$VERBOSE" -ge 2 ] && echo >&2 "Second pass complete"
+ "$XMLTEX_PATH" ${POSTARGS} tmp.fo >$OUT </dev/null
+ if [ "$VERBOSE" -ge 2 ]
+ then
+ echo >&2 "Third pass complete"
+ [ "$VERBOSE" -ge 3 ] && cat $OUT
+ fi
+ fi
+ ${GCP_PATH:-cp} -R -P -p -- *.dvi "$OUTPUT_DIR/$(basename "${XSLT_PROCESSED%.*}").dvi"
+ ;;
+esac