diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-04-05 13:08:42 +0000 |
---|---|---|
committer | <> | 2015-07-09 11:42:39 +0000 |
commit | 6a590aba95cbcce0f184381fb19d16558e56832d (patch) | |
tree | 1f7fce515366bf9d029da66a0c76cd1ae4239270 /format/fo/ps | |
download | xmlto-tarball-master.tar.gz |
Imported from /home/lorry/working-area/delta_xmlto-tarball/xmlto-0.0.26.tar.bz2.HEADxmlto-0.0.26master
Diffstat (limited to 'format/fo/ps')
-rwxr-xr-x | format/fo/ps | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/format/fo/ps b/format/fo/ps new file mode 100755 index 0000000..27673cf --- /dev/null +++ b/format/fo/ps @@ -0,0 +1,63 @@ +case "$USE_BACKEND" in +DEFAULT|DBLATEX) + case "$1" in + stylesheet) + ;; + post-process) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Post-process XSL-FO to DVI" + 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_PATH} -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 + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Post-process DVI to PS" + fi + dvips -R -q ${POSTPOSTARGS} -o "$OUTPUT_DIR/$(basename "${XSLT_PROCESSED%.*}").ps" *.dvi + ;; + esac + ;; +FOP) + EXT=$(basename "$0") + case "$1" in + stylesheet) + ;; + post-process) + if [ "$VERBOSE" -ge 1 ] + then + echo >&2 "Post-process XSL-FO to PS" + fi + #we need to change dir to handle external data objects correctly + cd "${OUTPUT_DIR}" + "$FOP_PATH" ${POSTARGS} -fo "${XSLT_PROCESSED}" -"${EXT}" "$OUTPUT_DIR/$(basename ${XSLT_PROCESSED%.*}).${EXT}" + cd - + ;; + esac + ;; +esac |