2 #==============================================================================
5 # Purpose: Translate dvi-file into postscript with reduced output size.
6 # Two logical pages will be put on onto each physical sheet of
8 # System: Linux. UNIX(tm) systems may work as well :-)
9 # Requires: pstops (http://www.dcs.ed.ac.uk/home/ajcd/psutils/), dvips
11 # Last Change: 13.08.1999
13 # Author: Thomas Esser
14 # Address: te@dbs.uni-hannover.de
15 # Copyright: (c) 1994, 1999 by Thomas Esser
16 # Copying: GNU GENERAL PUBLIC LICENSE
17 #==============================================================================
19 test -f /bin
/sh5
&& test -z "$RUNNING_SH5" \
20 && { UNAMES
=`uname -s`; test "x$UNAMES" = xULTRIX
; } 2>/dev
/null \
21 && { RUNNING_SH5
=true
; export RUNNING_SH5
; exec /bin
/sh5
$0 ${1+"$@"}; }
24 test -f /bin
/bsh
&& test -z "$RUNNING_BSH" \
25 && { UNAMES
=`uname -s`; test "x$UNAMES" = xAIX
; } 2>/dev
/null \
26 && { RUNNING_BSH
=true
; export RUNNING_BSH
; exec /bin
/bsh
$0 ${1+"$@"}; }
33 Usage: dvired [options] file
35 This programm behaves like dvips, execpt fot the fact that two logical
36 pages will be put on onto each physical sheet of paper.
38 For options see dvips(1). This program only interprets the options
39 -o, -P and -f. All other options will directly be passed to dvips.
41 If your paper is not in A4 format, you need to adjust the dimensions
44 Examples: (it is assumed that the PRINTER-variable is set)
45 dvired -Plw foo send output to printer lw
46 dvired -o foo.ps foo send output to file foo.ps
47 dvired -pp4-7 foo send 4 output-pages to printer
48 dvired foo -f | ghostview - preview output with ghostview
56 # This will work for A4 paper.
57 paper
=a4
; pstopsopt
='2:0(7.44mm,7.44mm)+1(7.44mm,-141.06mm)'
59 # The following are *UNTESTED*. Please let me know whether they work
60 # or not, if you can test them.
61 #paper=a3 ; pstopsopt='2:0(7.44mm,7.44mm)+1(7.44mm,-202.56mm)'
62 #paper=letter ; pstopsopt='2:0(7.44mm,7.44mm)+1(7.44mm,-132.26mm)'
63 #paper=legal ; pstopsopt='2:0(7.44mm,7.44mm)+1(7.44mm,-170.36mm)'
64 #paper=ledger ; pstopsopt='2:0(7.44mm,7.44mm)+1(7.44mm,-132.26mm)'
65 #paper=tabloid ; pstopsopt='2:0(7.44mm,7.44mm)+1(7.44mm,-208.46mm)'
72 *) dvips_pre
="-P$PRINTER" ;;
75 dvips_pre
="$dvips_pre -t $paper -t landscape"
77 while [ ! -z "$1" ] ; do
79 -P) of
="" ; dvips_pre
="$dvips_pre -P$2" ; lpr_opt
="-P$2"
81 -P*) of
="" ; dvips_pre
="$dvips_pre $1" ; lpr_opt
="$1" ;;
84 -o*) of
="`echo $1| sed 's/..//'`" ;;
92 "") dvips
-x707 $dvips_pre $opt -f | pstops
-q $pstopsopt | lpr
$lpr_opt
94 "-") dvips
-x707 $dvips_pre $opt -f | pstops
-q $pstopsopt
96 *) dvips
-x707 $dvips_pre $opt -f | pstops
-q $pstopsopt > "$of"