summaryrefslogtreecommitdiff
path: root/format/fo
diff options
context:
space:
mode:
Diffstat (limited to 'format/fo')
-rwxr-xr-xformat/fo/awt23
-rwxr-xr-xformat/fo/dvi42
-rwxr-xr-xformat/fo/mif24
-rwxr-xr-xformat/fo/pcl24
-rwxr-xr-xformat/fo/pdf64
-rwxr-xr-xformat/fo/ps63
-rwxr-xr-xformat/fo/svg24
-rwxr-xr-xformat/fo/txt24
8 files changed, 288 insertions, 0 deletions
diff --git a/format/fo/awt b/format/fo/awt
new file mode 100755
index 0000000..4c7f1d3
--- /dev/null
+++ b/format/fo/awt
@@ -0,0 +1,23 @@
+case "$USE_BACKEND" in
+DEFAULT|DBLATEX)
+ echo "Sorry, no way to convert to awt, use --with-fop option for that."
+ echo "You need to install fop package for using that option."
+ exit 3
+ ;;
+FOP)
+ EXT=$(basename "$0")
+ case "$1" in
+ stylesheet)
+ ;;
+ post-process)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Rendering XSL-FO to screen"
+ fi
+ #we need to change dir to handle external data objects correctly
+ cd "${OUTPUT_DIR}"
+ "$FOP_PATH" ${POSTARGS} -fo "${XSLT_PROCESSED}" -"${EXT}"
+ cd -
+ esac
+ ;;
+esac
diff --git a/format/fo/dvi b/format/fo/dvi
new file mode 100755
index 0000000..6615048
--- /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_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
+ ${GCP_PATH:-cp} -R -P -p -- *.dvi "$OUTPUT_DIR/$(basename "${XSLT_PROCESSED%.*}").dvi"
+ ;;
+esac
diff --git a/format/fo/mif b/format/fo/mif
new file mode 100755
index 0000000..296a86b
--- /dev/null
+++ b/format/fo/mif
@@ -0,0 +1,24 @@
+case "$USE_BACKEND" in
+DEFAULT|DBLATEX)
+ echo "Sorry, no way to convert to mif, use --with-fop option for that"
+ echo "You need to install fop package for using that option."
+ exit 3
+ ;;
+FOP)
+ EXT=$(basename "$0")
+ case "$1" in
+ stylesheet)
+ ;;
+ post-process)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Post-process XSL-FO to MIF"
+ 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
diff --git a/format/fo/pcl b/format/fo/pcl
new file mode 100755
index 0000000..196413f
--- /dev/null
+++ b/format/fo/pcl
@@ -0,0 +1,24 @@
+case "$USE_BACKEND" in
+DEFAULT|DBLATEX)
+ echo "Sorry, no way to convert to pcl, use --with-fop option for that."
+ echo "You need to install fop package for using that option."
+ exit 3
+ ;;
+FOP)
+ EXT=$(basename "$0")
+ case "$1" in
+ stylesheet)
+ ;;
+ post-process)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Post-process XSL-FO to PCL"
+ 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
diff --git a/format/fo/pdf b/format/fo/pdf
new file mode 100755
index 0000000..9e586b3
--- /dev/null
+++ b/format/fo/pdf
@@ -0,0 +1,64 @@
+case "$USE_BACKEND" in
+DEFAULT|DBLATEX)
+ case "$1" in
+ stylesheet)
+ ;;
+ post-process)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Post-process XSL-FO to PDF"
+ fi
+ if [ -z "`type -t $PDFXMLTEX_PATH`" ]
+ then
+ echo >&2 "Can't process, pdfxmltex tool not found at $PDFXMLTEX_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_PATH} -e "s,/>,/>\n,g" \
+ -e "s,block>,&\n,g" "$XSLT_PROCESSED" >tmp.fo
+ OUT=output
+ TEXINPUTS="$(dirname "$INPUT_FILE")::$SEARCHPATH"
+ export TEXINPUTS
+ "$PDFXMLTEX_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 pdfxmltex.
+ 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
+ "$PDFXMLTEX_PATH" ${POSTARGS} tmp.fo >$OUT </dev/null
+ [ "$VERBOSE" -ge 2 ] && echo >&2 "Second pass complete"
+ "$PDFXMLTEX_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 -- *.pdf "$OUTPUT_DIR/$(basename "${XSLT_PROCESSED%.*}").pdf"
+ ;;
+ esac
+ ;;
+FOP)
+ EXT=$(basename "$0")
+ case "$1" in
+ stylesheet)
+ ;;
+ post-process)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Post-process XSL-FO to PDF"
+ 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
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
diff --git a/format/fo/svg b/format/fo/svg
new file mode 100755
index 0000000..ae21a0b
--- /dev/null
+++ b/format/fo/svg
@@ -0,0 +1,24 @@
+case "$USE_BACKEND" in
+DEFAULT|DBLATEX)
+ echo "Sorry, no way to convert to svg, use --with-fop option for that."
+ echo "You need to install fop package for using that option."
+ exit 3
+ ;;
+FOP)
+ EXT=$(basename "$0")
+ case "$1" in
+ stylesheet)
+ ;;
+ post-process)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Post-process XSL-FO to SVG"
+ 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
diff --git a/format/fo/txt b/format/fo/txt
new file mode 100755
index 0000000..2f98e42
--- /dev/null
+++ b/format/fo/txt
@@ -0,0 +1,24 @@
+case "$USE_BACKEND" in
+DEFAULT | DBLATEX)
+ echo "Sorry, no way to convert to txt , use --with-fop option for that."
+ echo "You need to install fop package for using that option."
+ exit 3
+ ;;
+FOP)
+ EXT=$(basename $0)
+ case "$1" in
+ stylesheet)
+ ;;
+ post-process)
+ if [ "$VERBOSE" -ge 1 ]
+ then
+ echo >&2 "Post-process XSL-FO to TXT"
+ 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