summaryrefslogtreecommitdiff
path: root/dviware/dtl/man2ps
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /dviware/dtl/man2ps
Initial commit
Diffstat (limited to 'dviware/dtl/man2ps')
-rw-r--r--dviware/dtl/man2ps41
1 files changed, 41 insertions, 0 deletions
diff --git a/dviware/dtl/man2ps b/dviware/dtl/man2ps
new file mode 100644
index 0000000000..47eeb6e390
--- /dev/null
+++ b/dviware/dtl/man2ps
@@ -0,0 +1,41 @@
+#!/bin/sh
+# This file is public domain.
+# Originally written 1995, Geoffrey Tobin.
+# The author has expressed the hope that any modification will retain enough content to remain useful. He would also appreciate being acknowledged as the original author in the documentation.
+# This declaration added 2008/11/14 by Clea F. Rees with the permission of Geoffrey Tobin.
+#
+# Filter for converting "troff -mxx" to PostScript. This script is
+# normally linked to the names man2ps, ms2ps, me2ps, and mm2ps.
+#
+# Usage:
+# man2ps [<] cc.1 >cc.ps
+# me2ps [<] foo.me >foo.ps
+# mm2ps [<] foo.mm >foo.ps
+# ms2ps [<] foo.ms >foo.ps
+#
+# [08-May-1993]
+
+# Choose a troff format according to the scrip name.
+case `basename $0` in
+ man*) FORMAT=-man ;;
+ me*) FORMAT=-me ;;
+ mm*) FORMAT=-mm ;;
+ ms*) FORMAT=-ms ;;
+ *) echo "Unknown troff format:" ; exit 1 ;;
+esac
+
+# We can use either GNU groff or Sun Solaris troff + dpost
+if [ -x /usr/local/bin/groff ]
+then # GNU groff
+ TROFF="groff $FORMAT"
+ TROFF2PS="cat"
+elif [ -x /usr/lib/lp/postscript/dpost ]
+then # Solaris 2.1
+ TROFF="troff $FORMAT"
+ TROFF2PS="/usr/lib/lp/postscript/dpost"
+else
+ echo "Cannot find troff-to-PostScript filter"
+ exit 1
+fi
+
+tbl $* | eqn | $TROFF | $TROFF2PS