summaryrefslogtreecommitdiff
path: root/dviware/dvipsconfig
diff options
context:
space:
mode:
Diffstat (limited to 'dviware/dvipsconfig')
-rw-r--r--dviware/dvipsconfig/README307
-rw-r--r--dviware/dvipsconfig/addpsctrl256
-rw-r--r--dviware/dvipsconfig/config.a352
-rw-r--r--dviware/dvipsconfig/config.a451
-rw-r--r--dviware/dvipsconfig/config.a4grid197
-rw-r--r--dviware/dvipsconfig/config.duplong44
-rw-r--r--dviware/dvipsconfig/config.dupshort43
-rw-r--r--dviware/dvipsconfig/config.envelope64
-rw-r--r--dviware/dvipsconfig/config.inv30
-rw-r--r--dviware/dvipsconfig/config.manualfeed37
-rw-r--r--dviware/dvipsconfig/config.mmgrid192
-rw-r--r--dviware/dvipsconfig/config.psgrid175
-rw-r--r--dviware/dvipsconfig/config.screen10034
-rw-r--r--dviware/dvipsconfig/config.screen100_034
-rw-r--r--dviware/dvipsconfig/config.screen11034
-rw-r--r--dviware/dvipsconfig/config.screen12034
-rw-r--r--dviware/dvipsconfig/config.screen13034
-rw-r--r--dviware/dvipsconfig/config.screen14034
-rw-r--r--dviware/dvipsconfig/config.screen15034
-rw-r--r--dviware/dvipsconfig/config.screen3534
-rw-r--r--dviware/dvipsconfig/config.screen5034
-rw-r--r--dviware/dvipsconfig/config.screen7034
-rw-r--r--dviware/dvipsconfig/config.screen8034
-rw-r--r--dviware/dvipsconfig/config.screen8534
-rw-r--r--dviware/dvipsconfig/config.screen9034
-rw-r--r--dviware/dvipsconfig/config.simplex45
-rw-r--r--dviware/dvipsconfig/config.tek550paper45
-rw-r--r--dviware/dvipsconfig/config.tek550transparency45
-rw-r--r--dviware/dvipsconfig/config.tray165
-rw-r--r--dviware/dvipsconfig/config.tray265
-rw-r--r--dviware/dvipsconfig/config.tray365
-rw-r--r--dviware/dvipsconfig/config.usledger52
-rw-r--r--dviware/dvipsconfig/config.usletter51
33 files changed, 2323 insertions, 0 deletions
diff --git a/dviware/dvipsconfig/README b/dviware/dvipsconfig/README
new file mode 100644
index 0000000000..9c8f76d18b
--- /dev/null
+++ b/dviware/dvipsconfig/README
@@ -0,0 +1,307 @@
+Release 1.6 11 May 2006 Added mmgrid and a4grid, millimetre grids.
+Release 1.5 02 Aug 2000 Added addpsctrl, a filter program which can add
+ these control instructions to already existing
+ PostScript files.
+ Added US ledger paper.
+Release 1.4 22 Mar 2000 Added tray selection.
+ Thanks to Steffen Klupsch for suggesting it.
+Release 1.3.2 09 Mar 2000 License change only. Modified README.
+Release 1.3, 19 Feb 1999
+Release 1.2, 25 Jan 1998
+Release 1.13, 21 Aug 1995
+Release 1.12, 02 Mar 1995
+Release 1.0, 20 Feb 1995
+
+
+OVERVIEW
+========
+
+This is a set of PostScript header files which can be used to control the
+printer, like simplex/duplex printing, or the printing, like screen frequencies
+of images, or the addition of a grid underlay. These header files work with
+dvips, and can also be inserted with the addpsctrl script into existing
+PostScript files.
+
+Put together by Volker Kuhlmann <VolkerKuhlmann@gmx.de>.
+This collection of files is available under the name of "dvipsconfig" from
+
+ ftp://dante.ctan.org/tex-archive/dviware/dvipsconfig/
+
+or from any other CTAN host under the same path.
+Alternatively, from:
+
+ http://volker.dnsalias.net/soft/texmf/
+
+This software is copyright (C) Volker Kuhlmann, and is freely distributable
+under the terms of the GNU General Public License version 2.
+Parts of the code in config.psgrid are derived from previous material and are
+distributed with permission. See the file for details.
+
+
+LIST OF FILES
+=============
+
+README This file.
+addpsctrl Shell script which inserts these printer control files into
+ into already existing PostScript files (can also be used by
+ print filters)
+config.* Configuration files *and* header files for dvips.
+ Special format where each file serves both purposes.
+
+
+INSTALLATION
+============
+
+Copy addpsctrl into a directory which is searched for executable programs.
+
+Copy README and all config.* into a directory which is searched by dvips both
+for configuration files AND for header files. Each of these files have a dual
+function (easier maintenance) and hence must be found under each category
+(dvips config and dvips header).
+
+For current installations of web2c respectively teTeX 1.x, consult the file
+texmf.cnf for search paths. Currently configured search paths can be displayed
+with
+ kpsewhich --show-path "dvips config"
+ kpsewhich --show-path "PostScript header"
+
+To check up whether the place was any good, run (both!)
+ kpsewhich --format "dvips config" config.duplong
+ kpsewhich --format "PostScript header" config.duplong
+and don't forget to run mktexlsr...
+In case of problems, also check for any .dvipsrc files.
+
+dvips(k) 5.78 kpathsea version 3.2, web2c 7.2, looks in $TEXCONFIG and
+$TEXPSHEADERS.
+
+dvips (dvipsk 5.58f, web2c 6.2) looks in $TEXCONFIG for configuration files,
+and in $DVIPSHEADERS for header files. For details please see the dvips
+documentation (environment variable use seems to change with dvips versions).
+
+
+USAGE
+=====
+
+dvips reads the instructions in a configuration file <configfilename>
+with the -P option:
+
+ dvips -P <configfilename> ...
+
+All these configuration files contain the PostScript code for the
+respective operation as well, and can be used as header file as they are.
+
+Now to the material provided:
+
+Duplex printing:
+---------------
+
+-P simplex On a duplex printer, force printing in simplex mode.
+ On a simplex printer, this will be ignored.
+
+-P duplong On a duplex printer, force duplex printing with binding
+ on the long edge.
+ This is what you want for e.g. an A4 upright book.
+ On a simplex printer, this will be ignored.
+
+-P dupshort On a duplex printer, force duplex printing with binding
+ on the short edge.
+ Useful for e.g. printouts in landscape.
+ On a simplex printer, this will be ignored.
+
+Paper size selection:
+--------------------
+
+-P a3 Switch the printer to use A3 paper.
+ Note: "-t a3" must still be used as well!
+ Only works with PS level 2 devices, ignored otherwise.
+
+-P a4 Switch the printer to use A4 paper.
+ Note: "-t a4" must still be used as well, unless it is
+ the default.
+ Only works with PS level 2 devices, ignored otherwise.
+
+-P usletter Switch the printer to use US letter paper.
+ Note: "-t letter" must still be used as well, unless it
+ is the default.
+ Only works with PS level 2 devices, ignored otherwise.
+
+-P usledger Switch the printer to use US usledger paper.
+ Note: "-t ledger" must still be used as well, unless it
+ is the default.
+ Only works with PS level 2 devices, ignored otherwise.
+
+Screen frequencies and dot functions:
+------------------------------------
+
+-P screenN Print images with a screen frequency of N lpi at
+ 45 degrees with the "dot" spot function.
+ N = {35, 50, 70, 80, 85, 90, 100, 110, 120, 130, 140, 150}
+
+-P screen100_0 Print images with a screen frequency of 100lpi
+ at 0 degrees with the "dot" spot function.
+ A 0 degree screen angle is only useful as illustration!
+
+Note: When working with screen frequencies, it is possible that
+ turning the printer off and back on solves the problem of the
+ screen commands not having any effect. Previous print jobs may
+ leave the printer in a different state.
+
+Colour printer media selection:
+------------------------------
+
+-P tek550paper Switch Tektronix 550 and 560 colour printers to print on paper.
+
+-P tek550transparency Switch Tektronix 550 and 560 colour printers to print
+ on transparency.
+
+Paper tray selection:
+--------------------
+
+-P manualfeed Print on paper from the manual feeder.
+ The printer waits for the paper to be loaded after receiving
+ the job.
+ This should work with almost any printer.
+
+-P envelope Print on paper from the envelope feeder.
+ This should at least work with most HP laser printers.
+
+-P tray1 Print on paper from "tray 1".
+ This often is the manual feeder / upper tray / multipurpose
+ tray (at least for HP laser printers).
+
+-P tray2 Print on paper from "tray 2".
+ This often is the lower tray (at least for HP laser printers).
+
+-P tray3 Print on paper from "tray 1".
+ This often is the large capacity / lower cassette (at least for
+ HP laser printers).
+
+Note: Tray selection is very printer-dependent. tray1..3 will not work for all
+printers. Possible effects of them if the tray doesn't exist, or if the command
+is simply wrong for the printer, include the print job being cancelled, or at
+best the command being ignored. Email me with any problems and I might be able
+to fix it - I don't have that many printers for testing :-)
+
+Reported behaviour:
+ HP Laserjet 5M, -P envelope: print job cancelled if tray doesn't exist.
+ HP Laserjet 4000N, -P envelope and -P tray3 don't exist: job is printed on
+ paper from the standard tray instead.
+
+Thanks to Steffen Klupsch <steffen@vlsi.informatik.tu-darmstadt.de> for initial
+suggestions about the tray selection material, and some beta testing.
+
+Misc:
+----
+
+-P psgrid Print a PostScript coordinate grid onto the page. This can be
+ very useful for checking by how much the printer shifts the
+ image on the paper, or to check whether things end up in the
+ correct place.
+
+-P mmgrid Print a millimetre grid onto the page. Much more userfriendly.
+ Otherwise the same as -P psgrid.
+
+-P a4grid Print a millimetre grid onto the page, starting in the top-left
+ corner. Much more useful for checking page layout.
+
+-P inv Print all pages inverted, i.e. white letters on black
+ background.
+ Note: this currently does not work properly. Any
+ hints/fixes greatly appreciated!
+
+
+CONTROLLING SCREEN FREQUENCIES
+==============================
+
+Various PostScript commands for controlling the screen frequencies of
+images exist, but not all work on all printers. See fragments of
+PostScript code and comments below. The form working on most printers is
+
+ LPI DEGREES {FUNCTION} setscreen
+
+Insert numbers for LPI and DEGREES, and a function for FUNCTION about
+which I only know (right or wrong?):
+
+ "Should read 2 values from the stack (x, y coordinates in a
+ halftone cell), and return one in the range -1 to 1. The return
+ values determine the order in which pixels within a halftone
+ cell are whitened to produce any desired shade of gray."
+
+The simplest function is {pop}, creating a "linescreen" pattern. There
+is also a function "Dot" (currently used) and "Ellipse". For any other
+frequencies/angles/functions put the instructions in a file, and load
+the file with
+
+ dvips -h <filename>
+
+Thanks to osakari@unda.fi (Olavi Sakari) for some help, and the "Dot"
+and "Ellipse" code.
+
+Notes follow:
+
+
+%currentscreen 3 1 roll pop pop 70 45 3 -1 roll setscreen
+% Works on HP LJ3Si, HP LJ4m. Ignored on HP LJ4mv (VK).
+
+
+%currentscreen 3 1 roll pop pop 70 45 3 -1 roll sethalftone
+% Ignored on HP LJ4mv (VK).
+
+
+%70 45 {pop} setscreen
+% Produces a funny, 1-diagonal pattern ("linescreen") on HP LJ4mv (VK).
+
+
+% "Dot":
+%70 45 {abs exch abs 2 copy add 1 gt {1 sub dup mul exch 1 sub dup mul add 1
+% sub }{dup mul exch dup mul add 1 exch sub }ifelse} setscreen
+% Works on HP LJ3Si, HP LJ4m, HP LJ4mv (VK).
+
+
+% "Ellipse":
+%70 45 {dup 5 mul 8 div mul exch dup mul exch add sqrt 1 exch sub} setscreen
+% Works on HP LJ4mv (VK).
+
+
+%70 45
+%<<
+% /HalftoneType 1
+ % 0 gives range check error, 2 gives undefined error (VK).
+% /Frequency 150
+% /Angle 20
+ % the values for /Frequency, /Angle are irrelevant
+% /SpotFunction {pop}
+%>>
+%setscreen
+% 70 45 seem to replace /Frequency and /Angle in dict
+% - Note: NO curly braces around the dict!
+% Works on HP LJ4m, produces errors with HP LJ3Si,
+% Produces "linescreen" on HP LJ4mv caused by {pop} (VK).
+
+
+%<<
+% /HalftoneType 1
+% % 0 gives range check error, 2 gives undefined error (VK).
+% /Frequency 70
+% /Angle 45
+% /SpotFunction {pop}
+%>>
+%sethalftone % Level 2 only
+% Produces "linescreen" on HP LJ4mv caused by {pop} (VK).
+
+
+ADDPSCTRL
+=========
+
+The addpsctrl program works as a filter. The given controls are inserted into
+the PostScript data. The config.* files are located by running kpsewhich, or
+by specifying the directory they're in. This allows to use addpsctrl without
+having to have a TeXMF installation. For further info run addpsctrl --help.
+
+
+TODO
+====
+
+Control the screen frequency without altering the dot function.
+
+Supply separate controls for setting the dot function.
diff --git a/dviware/dvipsconfig/addpsctrl b/dviware/dvipsconfig/addpsctrl
new file mode 100644
index 0000000000..ddc04cc054
--- /dev/null
+++ b/dviware/dvipsconfig/addpsctrl
@@ -0,0 +1,256 @@
+#!/bin/bash
+#
+# addpsctrl
+#
+# Adds printer control commands to the given PostScript data.
+# Currently requires bash - sorry but I have no time to support too many
+# dumb shells (like Solaris /bin/sh). The korn shell (ksh) would be suitable,
+# but the syntax is not the same as that of bash. bash is free - ksh loses out.
+# Works with bash 1.x and 2.x.
+#
+# Copyright (C) by Volker Kuhlmann <v.kuhlmann@elec.canterbury.ac.nz>
+# Copyright (C) by Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+# Released under the terms of the GNU General Public License (GPL) Version 2.
+# See http://www.gnu.org/ for details.
+#
+# Volker Kuhlmann
+# 5, 6, 12 Apr; 2 Aug 2000
+# 26 Jan 2006
+#
+
+VERSION="VK 1.3, 26 Jan 2006"
+
+
+####
+#### Constants and initial variables
+#
+# Use kpsewhich:
+ADDPSCTRL_DFLTOPT="${ADDPSCTRL_DFLTOPT:=--kpsewhich}"
+# If you don't have kpsewhich, or would like to load the config files from a
+# different directory, give the directory with the config files by setting
+# the environment variable ADDPSCTRL_DFLTOPT:
+#ADDPSCTRL_DFLTOPT="${ADDPSCTRL_DFLTOPT:=--nokpsewhich --dir YOURPATH}"
+
+
+####
+#### Usage
+#
+show_usage() {
+ echo "
+Usage: ${0##*/} [OPTION]... [FILE] [CTRL]...
+Version $VERSION
+"
+}
+usage() {
+ show_usage
+ echo "Call with -h for help.
+"
+ exitwith ErrUsage
+}
+
+####
+#### Help
+#
+Help() { show_help; exitwith ErrHelp; }
+show_help() {
+ show_usage
+ echo "\
+Inserts printer control instructions (e.g. duplex) into a PostScript file.
+OPTIONS:
+ -h, --help show help
+ -k, --kpsewhich use kpsewhich to locate config files if necessary
+ -K, --nokpsewhich never use kpsewhich
+ -f, --file FILE insert control commands into file FILE ('-' for stdin)
+ -d, --dir DIR control files are in directory DIR
+ -c, --ctrl CTRL locate + insert control file 'config.CTRL'
+ -i, --insert INSRT insert file INSRT before any other control files
+ (give full path and filename)
+ -o, --output OUT write to file OUT instead of stdout
+ -V, --version display version and exit
+
+ -s, -1 same as -c simplex
+ -2L same as -c duplong
+ -2S same as -c dupshort
+ -a4, -a3 same as -c a4 / -c a3
+ -man same as -c manualfeed
+
+If -f is not used, the first non-option argument is taken as FILE.
+Remaining arguments are names of control files to be inserted (after those
+given with -i and -c).
+Control file searching:
+ 1) In directory DIR (if given)
+ 2) By running kpsewhich, unless disabled with -K
+Default (can be changed by setting environment variable ADDPSCTRL_DFLTOPT):
+ $ADDPSCTRL_DFLTOPT
+"
+}
+
+####
+#### Error/Exit codes
+#
+exitwith() {
+ exec 1>&2 # write stdout on stderr instead
+ case "$1" in
+ ErrUsage|ErrHelp)
+ # usage already displayed
+ exit 1;;
+ ErrNoread)
+ echo "Config/header file not readable: '$2'."
+ exit 2;;
+ ErrNoconf)
+ echo "Can not locate config/header file '$2'."
+ exit 3;;
+ ErrNodatafile)
+ echo "No file specified to insert control commands into."
+ echo "Call with -h for help on command argument syntax."
+ exit 9;;
+ ErrNoinsfile)
+ echo "No control commands specified to insert."
+ echo "Call with -h for help on command argument syntax."
+ exit 9;;
+ ErrMissingParameter)
+ echo "A required parameter for option $2 is missing."
+ echo "Call with -h for help."
+ exit 9;;
+ *)
+ echo "Error: exitwith() was called with illegal error code '$1'."
+ exit 19;;
+ esac
+}
+
+####
+#### Parse command line parameters
+#
+checkargmm() {
+ test "$1" != "--" -a "$2" != "--"
+ #true # uncomment this to allow "--" as argument to an option
+}
+checkarg2() {
+ test $# -ge 2 && checkargmm "$2" && return
+ exitwith ErrMissingParameter "$1"
+}
+checkarg3() {
+ test $# -ge 3 && checkargmm "$2" "$3" && return
+ exitwith ErrMissingParameter "$1"
+}
+parse_cmd_line() {
+ local cmdline arg
+ unset -v debug usekpsewhich configdir insfile datafile outfile ctrl
+ set -- $ADDPSCTRL_OPT "$@" # pre-init options
+ while [ "$1" ]; do
+ #test $debug && echo "Current arg: $1"
+ arg="${1#-}"
+ test "$arg" = "$1" && break # does word start with "-"?
+ test "$arg" = "-" && { shift; break; }
+ # allow both "-long" and "--long" for long options:
+ arg="${arg#-}"
+ case "$arg" in
+ #debug) debug=1;;
+ usage) usage;;
+ V|version) usage;;
+ h|help) Help;;
+
+ k|kpsewhich) usekpsewhich=1;;
+ K|nokpsewhich) usekpsewhich="";;
+
+ d|dir) checkarg2 "$@"; configdir="$2"; shift;;
+ i|insert) checkarg2 "$@"; insfile="$2"; shift;;
+ f|file) checkarg2 "$@"; datafile="$2"; shift;;
+ o|output) checkarg2 "$@"; outfile="$2"; shift;;
+
+ c|ctrl) checkarg2 "$@"; ctrl="$2"; shift;;
+ s|1) ctrl=simplex;;
+ 2L) ctrl=duplong;;
+ 2S) ctrl=dupshort;;
+ a4|a3) ctrl="$arg";;
+ man) ctrl="manualfeed";;
+
+ "") break;; # allow "-" as file arg
+ *) exitwith ErrBadoption "$1";;
+ esac
+ shift
+ done
+ numfileargs=$#
+}
+
+locate_config_file() {
+ insfile=""
+ test -n "$configdir" && insfile="$configdir/config.$1"
+ if [ -n "$usekpsewhich" -a \( -z "$insfile" -o ! -r "$insfile" \) ]; then
+ insfile="`kpsewhich --format 'dvips config' config.$1`"
+ fi
+ test -z "$insfile" && exitwith ErrNoconf "config.$1"
+ test -r "$insfile" || exitwith ErrNoread "$insfile"
+}
+
+insert_into_ps() {
+ # 0: start
+ # 1: !% found
+ # 2: %% found
+ # 3: insertion done
+ in="$1"; shift
+ #echo \
+ AWK '\
+ BEGIN {n = 0; ins="'"$*"'"} \
+ n == 3 {print $0; next} \
+ /^%%EndSetup/ || /^%%Page:/ || ((n == 1) && (! /^[% ]/) && (! /^$/)) { \
+ if ((n == 1) || (n == 2)) { \
+ n = 3; \
+ while ((getline line <ins) > 0) { print line } \
+ }} \
+ /^%\!/ {if (n == 0) {n = 1}} \
+ /^%%/ {if (n == 1) {n = 2}} \
+ {print $0} \
+ END {if (n < 3) { \
+ while ((getline line <ins) > 0) { print line } } } \
+ ' \
+ "$in"
+ # gawk 3.1.4 doesn't understand while ("cat " ins | getline
+ # and tries to run ins as a command. -VK26Jan06
+}
+
+####
+#### Main
+
+if [ $# -eq 0 ]; then usage; fi
+
+ADDPSCTRL_OPT="${ADDPSCTRL_OPT:-$ADDPSCTRL_DFLTOPT}"
+
+# find a useful awk (solaris awk is not)
+p="`type -p gnuawk gawk nawk | head -1`" && eval 'AWK() { '"${p:-awk}"' "$@"; }'
+
+parse_cmd_line "$@"
+#echo $#, $numfileargs, `expr $# - $numfileargs`
+shift `expr $# - $numfileargs`
+
+#echo fileargs: "$@"
+#echo "opts=$ADDPSCTRL_OPT;; use=$usekpsewhich"
+#echo "ctrl=$ctrl, insfile=$insfile, dir=$configdir, out=$outfile"
+
+if [ -z "$datafile" ]; then
+ test -z "$1" && exitwith ErrNodatafile
+ datafile="$1"; shift
+fi
+#echo "datafile=$datafile"
+
+insfiles=""
+if [ -n "$insfile" ]; then
+ test -r "$insfile" || exitwith ErrNoread "$insfile"
+ insfiles="$insfile"
+fi
+for c in "$ctrl" "$@"; do
+ test -z "$c" && continue
+ #echo locate_config_file "$c"
+ locate_config_file "$c"
+ #echo "insfile=$insfile"
+ insfiles="$insfiles $insfile"
+done
+#echo "insfiles=$insfiles"
+test -z "$insfiles" && exitwith ErrNoinsfile
+
+if [ -z "$outfile" ]; then
+ #echo insert_into_ps "$datafile" $insfiles
+ insert_into_ps "$datafile" $insfiles
+else
+ insert_into_ps "$datafile" $insfiles >"$outfile"
+fi
diff --git a/dviware/dvipsconfig/config.a3 b/dviware/dvipsconfig/config.a3
new file mode 100644
index 0000000000..ab2b046266
--- /dev/null
+++ b/dviware/dvipsconfig/config.a3
@@ -0,0 +1,52 @@
+%!
+% config.a3
+% Configuration and header file for dvips. Load with: dvips -P a3
+%
+% Forces printing on A3 paper, if available.
+% Works with HP LJ 4mv. Probably also works with other printers.
+% Will be silently ignored by a PS level 1 PostScript interpreter.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 21 Feb 1995; 14, 16, 17, 26 Oct 1997; 25 Jan 1998; 9 Mar 2000
+%
+ /setpagedevice where
+ {
+ %dup { pstack flush pop pop } forall pstack flush
+ pop % remove dict name
+ % check whether pagedevice dict has /DeferredMediaSelection
+ % (gs 3.33 has setpagedevice, but error on /DeferredMediaSelection)
+ /hasDMS false def
+ currentpagedevice
+ {
+ /DeferredMediaSelection eq { /hasDMS true def } if
+ pop % throw value of key
+ } forall
+ hasDMS {
+ <<
+ /DeferredMediaSelection true % what exactly is this?
+ >>
+ setpagedevice
+ } if
+ <<
+ % /DeferredMediaSelection true % what exactly is this?
+ /PageSize [842 1191] % size A3 portrait
+ /ImagingBBox null % set null after /PageSize
+ >>
+ setpagedevice
+ }
+ { }
+ ifelse
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.a3
+ } pop % PostScript cleanup
+%
+% EOF config.a3
diff --git a/dviware/dvipsconfig/config.a4 b/dviware/dvipsconfig/config.a4
new file mode 100644
index 0000000000..c77b2a555c
--- /dev/null
+++ b/dviware/dvipsconfig/config.a4
@@ -0,0 +1,51 @@
+%!
+% config.a4
+% Configuration and header file for dvips. Load with: dvips -P a4
+%
+% Forces printing on A4 paper, if available.
+% Will be silently ignored by a PS level 1 PostScript interpreter.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 21 Feb 1995; 14, 16, 17, 26 Oct 1997; 25 Jan 1998; 9 Mar 2000
+%
+ /setpagedevice where
+ {
+ %dup { pstack flush pop pop } forall pstack flush
+ pop % remove dict name
+ % check whether pagedevice dict has /DeferredMediaSelection
+ % (gs 3.33 has setpagedevice, but error on /DeferredMediaSelection)
+ /hasDMS false def
+ currentpagedevice
+ {
+ /DeferredMediaSelection eq { /hasDMS true def } if
+ pop % throw value of key
+ } forall
+ hasDMS {
+ <<
+ /DeferredMediaSelection true % what exactly is this?
+ >>
+ setpagedevice
+ } if
+ <<
+ % /DeferredMediaSelection true % what exactly is this?
+ /PageSize [595 842] % size A4 portrait
+ /ImagingBBox null % set null after /PageSize
+ >>
+ setpagedevice
+ }
+ { }
+ ifelse
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.a4
+ } pop % PostScript cleanup
+%
+% EOF config.a4
diff --git a/dviware/dvipsconfig/config.a4grid b/dviware/dvipsconfig/config.a4grid
new file mode 100644
index 0000000000..6527c45488
--- /dev/null
+++ b/dviware/dvipsconfig/config.a4grid
@@ -0,0 +1,197 @@
+%!
+% config.a4grid
+% Configuration and header file for dvips. Load with: dvips -P a4grid
+%
+% Draw a line grid in millimetres, starting from the top-left of the page.
+% The resulting grid can be used for measuring page layout.
+%
+% This code is based on code from the book
+%
+% @Book{Merz:PostscriptAcrobatBibel,
+% author = "Thomas Merz",
+% title = "Die PostScript- und Acrobat-Bibel. Was Sie schon
+% immer {\"u}ber PostScript und Acrobat/{PDF} wissen
+% wollten",
+% publisher = "Thomas Merz Verlag",
+% year = "1996",
+% address = "M{\"u}nchen",
+% edition = "1",
+% ISBN = "3-9804943-0-6",
+% }
+% @Book{Merz:PostscriptAcrobatBible,
+% author = "Thomas Merz",
+% title = "PostScript & acrobat/{PDF}: applications,
+% troubleshooting, and cross-platform publishing",
+% publisher = "Springer",
+% year = "1997",
+% address = "Berlin",
+% ISBN = "3-540-60854-0",
+% }
+%
+% The original code can be found in file ps/eps/gitter.ps on the CD which
+% accompanies the German edition.
+% The original code is copyright (C) Thomas Merz 1994-96.
+% Incorporation of the original code into this file is with permission of
+% Thomas Merz.
+% For further information about the book see http://www.pdflib.com/
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 25, 26 Oct 1997; 25 Jan 1998; 9 Mar 2000; 11 May 2006
+%
+ /dr@wgrid {
+
+ save
+ 25 dict begin
+
+ % usable units:
+ /mm {25.4 div 72 mul} bind def
+
+ % Paper height
+ /grid@paperheight 297 mm def % A4
+
+ % Start Y scale from the top, down.
+ 0 grid@paperheight translate
+
+ /gridunit 1 mm def % the grid unit, in PostScript points
+ /step 5 def % grid line increment, in grid units
+ /medstep 10 def % solid grid lines every this many grid units
+ /numstep 20 def % numbered grid lines every this many grid units
+
+ /FontSize 10 def % font size of numbers
+
+ /numstepunit numstep gridunit mul def
+
+ %initgraphics % don't use - can stuff things up and is not necessary
+ newpath 0 setlinecap 0 setlinejoin 10 setmiterlimit
+
+ clippath pathbbox newpath
+ cvi /ury exch def
+ cvi /urx exch def
+ % This seems to be designed to ensure llx,lly are a little too big.
+ % Unfortunately, a lly of -0.19 becomes -10, doing bad things to the grid
+ % position (i.e. it's totally wrong), with grid units other than 1.
+ % -> Use the nearest integer, as for urx, ury.
+ %10 div floor 10 mul cvi /lly exch def
+ %10 div floor 10 mul cvi /llx exch def
+ cvi /lly exch def
+ cvi /llx exch def
+ urx llx sub /lenx exch def
+ ury lly sub /leny exch def
+
+ /snaptopixel {
+ transform
+ .25 sub round .25 add exch
+ .25 sub round .25 add exch
+ itransform
+ } bind def
+
+ 0.01 setlinewidth
+ [1 2] 0 setdash % dashed line
+ 0 setgray
+ /set-line-style {
+ dup gridunit div round cvi medstep mod 0 eq { [ ] 0 setdash } if
+ dup gridunit div round cvi numstep mod 0 eq { 0.4 setlinewidth } if
+ dup gridunit div round cvi 0 eq { 0.6 setlinewidth } if
+ } bind def
+
+ llx step gridunit mul urx { % draw vertical lines
+ gsave
+ set-line-style
+ lly snaptopixel moveto 0 leny snaptopixel rlineto stroke
+ grestore
+ } for
+
+ ury step gridunit mul neg lly { % draw horizontal lines
+ gsave
+ set-line-style
+ llx exch snaptopixel moveto lenx 0 snaptopixel rlineto stroke
+ grestore
+ } for
+
+ % circle at (0,0)
+ [ ] 0 setdash 1 setlinewidth newpath 15 0 moveto 0 0 15 0 360 arc stroke
+
+ /kreis { % clip light circle from existing lines
+ gsave 1 setgray
+ %/d (500) stringwidth pop def
+ dup stringwidth pop /d exch def % adjust circle size to string width
+ currentpoint FontSize 3 div add exch d 2 div add exch
+ d 0.6 mul 0 360 arc
+ fill grestore
+ } def
+
+ % axes labelling font
+ /Helvetica-Bold findfont FontSize scalefont setfont
+ 0.5 setgray
+
+ % print axis labelling, X
+ llx numstepunit div floor numstepunit mul cvi
+ numstepunit
+ urx
+ { % for
+ dup 0 eq
+ {
+ pop
+ }{
+ %dup 20 grid@paperheight sub moveto % labelling at bottom
+ dup -27 moveto % labelling at top
+ gridunit div round cvi
+ ( ) cvs dup stringwidth pop 2 div neg 0 rmoveto
+ kreis show
+ } ifelse
+ } bind for
+
+ % print axis labelling, Y
+ lly numstepunit div floor numstepunit mul cvi
+ numstepunit
+ ury
+ { % for
+ dup 0 eq
+ {
+ pop
+ }{
+ 40 1 index moveto
+ gridunit div round cvi neg
+ ( ) cvs dup stringwidth pop
+ neg 3 sub FontSize 3 div neg rmoveto
+ kreis show
+ } ifelse
+ } bind for
+
+ end restore
+
+ } bind def % dr@wgrid
+
+ % %% Hook into dvips-generated PS
+ % at start of page:
+ %/bop-hook where
+ % {
+ % pop
+ % /@ldbophookgrid /bop-hook load def
+ % /bop-hook { @ldbophookgrid dr@wgrid } def
+ % }{
+ % /bop-hook { dr@wgrid } def
+ % } ifelse
+ % at end of page:
+ /eop-hook where
+ {
+ pop
+ /@ldeophookgrid /eop-hook load def
+ /eop-hook { @ldeophookgrid dr@wgrid } def
+ }{
+ /eop-hook { dr@wgrid } def
+ } ifelse
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.a4grid
+ } pop % PostScript cleanup
+%
+% EOF config.a4grid
diff --git a/dviware/dvipsconfig/config.duplong b/dviware/dvipsconfig/config.duplong
new file mode 100644
index 0000000000..51ace8d412
--- /dev/null
+++ b/dviware/dvipsconfig/config.duplong
@@ -0,0 +1,44 @@
+%!
+% config.duplong
+% Configuration and header file for dvips. Load with: dvips -P duplong
+%
+% Prints in duplex mode with binding on the long edge if the printer
+% has a duplex unit, otherwise it will be ignored.
+% Works on: HP LaserJet IIISi, HP LJ 4m, 4m+, 4mv, 5, gs 3.33, 5.10, 6.0.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995, 16, 18 Jan 1998, 5 Feb 1998; 9, 22 Mar 2000
+%
+ %statusdict begin true setduplexmode false settumble end
+ /setpagedevice where {
+ pop % throw dict name
+ % gs 3.33 does not have /Duplex, /Tumble in pagedevice dict
+ currentpagedevice /Duplex known {
+ %<< /Duplex true >> % << >> are level 2 only
+ /tmpdict 1 dict def tmpdict /Duplex true put tmpdict
+ setpagedevice
+ } if
+ currentpagedevice /Tumble known {
+ /tmpdict 1 dict def tmpdict /Tumble false put tmpdict
+ setpagedevice
+ } if
+ }{
+ statusdict begin
+ true setduplexmode false settumble
+ % this does not work with gs 3.33 (undefined error)
+ end
+ } ifelse
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.duplong
+ } pop % PostScript cleanup
+%
+% EOF config.duplong
diff --git a/dviware/dvipsconfig/config.dupshort b/dviware/dvipsconfig/config.dupshort
new file mode 100644
index 0000000000..1924341dfc
--- /dev/null
+++ b/dviware/dvipsconfig/config.dupshort
@@ -0,0 +1,43 @@
+%!
+% config.dupshort
+% Configuration and header file for dvips. Load with: dvips -P dupshort
+%
+% Prints in duplex mode with binding on the short edge if the printer
+% has a duplex unit, otherwise it will be ignored.
+% Works on: HP LaserJet IIISi, HP LJ 4m, 4m+, 4mv, 5, gs 3.33, 5.10, 6.0.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995, 18 Jan 1998, 5 Feb 1998; 9, 22 Mar 2000
+%
+ %statusdict begin true setduplexmode true settumble end
+ /setpagedevice where {
+ pop % throw dict name
+ % gs 3.33 does not have /Duplex, /Tumble in pagedevice dict
+ currentpagedevice /Duplex known {
+ %<< /Duplex true >> % << >> are level 2 only
+ /tmpdict 1 dict def tmpdict /Duplex true put tmpdict
+ setpagedevice
+ } if
+ currentpagedevice /Tumble known {
+ /tmpdict 1 dict def tmpdict /Tumble true put tmpdict
+ setpagedevice
+ } if
+ }{
+ statusdict begin
+ true setduplexmode true settumble
+ end
+ } ifelse
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.dupshort
+ } pop % PostScript cleanup
+%
+% EOF config.dupshort
diff --git a/dviware/dvipsconfig/config.envelope b/dviware/dvipsconfig/config.envelope
new file mode 100644
index 0000000000..b2ea4ed294
--- /dev/null
+++ b/dviware/dvipsconfig/config.envelope
@@ -0,0 +1,64 @@
+%!
+% config.envelope
+% Configuration and header file for dvips. Load with: dvips -P envelope
+%
+% Selects paper from what often is the envelope feeder.
+% This should work with these HP LaserJet printers:
+% 4/4M Plus PS 300 + 600
+% 4V/4MV PostScript
+% 5/5M PostScript, 5P/5MP PostScript
+% 5Si/5Si MX PS, 5Si Mopier PS
+% This is very unlikely to work with these HP LaserJet printers because they
+% select trays via media type and not media position:
+% 4Si/4SiMX PS 300dpi + 600dpi
+% 4/4M PS 600 dpi
+% Tested with:
+% gs 5.10, ...
+% Will be silently ignored by a PS level 1 PostScript interpreter,
+% or any other which doesn't know /MediaPosition.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Steffen Klupsch <steffen@klupsch.de>
+% 15 Mar 2000
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 21 Mar 2000
+%
+ /setpagedevice where
+ {
+ %dup { pstack flush pop pop } forall pstack flush
+ pop % remove dict name
+ % check whether pagedevice dict has /DeferredMediaSelection
+ % (gs 3.33 has setpagedevice, but error on /DeferredMediaSelection)
+ /hasDMS false def
+ currentpagedevice
+ {
+ /DeferredMediaSelection eq { /hasDMS true def } if
+ pop % throw value of key
+ } forall
+ hasDMS {
+ <<
+ /DeferredMediaSelection true % what exactly is this?
+ >>
+ setpagedevice
+ } if
+ % gs 5.10, 6.0: error on /MediaPosition
+ currentpagedevice /MediaPosition known {
+ <<
+ /MediaPosition 2 % select tray
+ >>
+ setpagedevice
+ } if
+ } if
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.envelope
+ } pop % PostScript cleanup
+%
+% EOF config.envelope
diff --git a/dviware/dvipsconfig/config.inv b/dviware/dvipsconfig/config.inv
new file mode 100644
index 0000000000..edea5bd58b
--- /dev/null
+++ b/dviware/dvipsconfig/config.inv
@@ -0,0 +1,30 @@
+%!
+% config.inv
+% Configuration and header file for dvips. Load with: dvips -P inv
+%
+% Invert the printing.
+% This currently mucks up the first of the pages printed.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995; 9, 22 Mar 2000
+%
+ [
+ %{}
+ {1 exch sub}
+ % in gs 5.10, 6.0 this transfer function inverts the text colour, but not
+ % the background/paper colour...
+ /exec load currenttransfer /exec load] cvx settransfer
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.inv
+ } pop % PostScript cleanup
+%
+% EOF config.inv
diff --git a/dviware/dvipsconfig/config.manualfeed b/dviware/dvipsconfig/config.manualfeed
new file mode 100644
index 0000000000..0b93350704
--- /dev/null
+++ b/dviware/dvipsconfig/config.manualfeed
@@ -0,0 +1,37 @@
+%!
+% config.manualfeed
+% Configuration and header file for dvips. Load with: dvips -P manualfeed
+%
+% Selects printing from the manual feeder.
+% This makes the print job wait for the paper to be inserted into the feeder.
+% This should work on all HP3 and HP4 printers, probably on all printers.
+% If it doesn't work, it should at least be ignored.
+% Tested on: gs 5.10, ...
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Following an initiative by Steffen Klupsch <steffen@klupsch.de> 15 Mar 2000
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Mar 2000
+%
+ /setpagedevice where {
+ pop % throw dict name
+ currentpagedevice /ManualFeed known {
+ 1 dict dup /ManualFeed true put
+ setpagedevice
+ } if
+ }{
+ statusdict /manualfeed true put
+ } ifelse
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.manualfeed
+ } pop % PostScript cleanup
+%
+% EOF config.manualfeed
diff --git a/dviware/dvipsconfig/config.mmgrid b/dviware/dvipsconfig/config.mmgrid
new file mode 100644
index 0000000000..7e655325a1
--- /dev/null
+++ b/dviware/dvipsconfig/config.mmgrid
@@ -0,0 +1,192 @@
+%!
+% config.mmgrid
+% Configuration and header file for dvips. Load with: dvips -P mmgrid
+%
+% Draw a line grid in millimetres.
+%
+% This code is based on code from the book
+%
+% @Book{Merz:PostscriptAcrobatBibel,
+% author = "Thomas Merz",
+% title = "Die PostScript- und Acrobat-Bibel. Was Sie schon
+% immer {\"u}ber PostScript und Acrobat/{PDF} wissen
+% wollten",
+% publisher = "Thomas Merz Verlag",
+% year = "1996",
+% address = "M{\"u}nchen",
+% edition = "1",
+% ISBN = "3-9804943-0-6",
+% }
+% @Book{Merz:PostscriptAcrobatBible,
+% author = "Thomas Merz",
+% title = "PostScript & acrobat/{PDF}: applications,
+% troubleshooting, and cross-platform publishing",
+% publisher = "Springer",
+% year = "1997",
+% address = "Berlin",
+% ISBN = "3-540-60854-0",
+% }
+%
+% The original code can be found in file ps/eps/gitter.ps on the CD which
+% accompanies the German edition.
+% The original code is copyright (C) Thomas Merz 1994-96.
+% Incorporation of the original code into this file is with permission of
+% Thomas Merz.
+% For further information about the book see http://www.pdflib.com/
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 25, 26 Oct 1997; 25 Jan 1998; 9 Mar 2000; 11 May 2006
+%
+ /dr@wgrid {
+
+ save
+ 25 dict begin
+
+ % Dirty way of getting a mm grid:
+ %1 72 mul 25.4 div dup scale
+
+ % usable units:
+ /mm {25.4 div 72 mul} bind def
+
+ /gridunit 1 mm def % the grid unit, in PostScript points
+ /step 5 def % grid line increment, in grid units
+ /medstep 10 def % solid grid lines every this many grid units
+ /numstep 20 def % numbered grid lines every this many grid units
+
+ /FontSize 10 def % font size of numbers
+
+ /numstepunit numstep gridunit mul def
+
+ %initgraphics % don't use - can stuff things up and is not necessary
+ newpath 0 setlinecap 0 setlinejoin 10 setmiterlimit
+
+ clippath pathbbox newpath
+ cvi /ury exch def
+ cvi /urx exch def
+ % This seems to be designed to ensure llx,lly are a little too big.
+ % Unfortunately, a lly of -0.19 becomes -10, doing bad things to the grid
+ % position (i.e. it's totally wrong), with grid units other than 1.
+ % -> Use the nearest integer, as for urx, ury.
+ %10 div floor 10 mul cvi /lly exch def
+ %10 div floor 10 mul cvi /llx exch def
+ cvi /lly exch def
+ cvi /llx exch def
+ urx llx sub /lenx exch def
+ ury lly sub /leny exch def
+
+ /snaptopixel {
+ transform
+ .25 sub round .25 add exch
+ .25 sub round .25 add exch
+ itransform
+ } bind def
+
+ 0.01 setlinewidth
+ [1 2] 0 setdash % dashed line
+ 0 setgray
+ /set-line-style {
+ dup gridunit div round cvi medstep mod 0 eq { [ ] 0 setdash } if
+ dup gridunit div round cvi numstep mod 0 eq { 0.4 setlinewidth } if
+ dup gridunit div round cvi 0 eq { 0.6 setlinewidth } if
+ } bind def
+
+ llx step gridunit mul urx { % draw vertical lines
+ gsave
+ set-line-style
+ lly snaptopixel moveto 0 leny snaptopixel rlineto stroke
+ grestore
+ } for
+
+ lly step gridunit mul ury { % draw horizontal lines
+ gsave
+ set-line-style
+ llx exch snaptopixel moveto lenx 0 snaptopixel rlineto stroke
+ grestore
+ } for
+
+ % circle at (0,0)
+ [ ] 0 setdash 1 setlinewidth newpath 15 0 moveto 0 0 15 0 360 arc stroke
+
+ /kreis { % clip light circle from existing lines
+ gsave 1 setgray
+ %/d (500) stringwidth pop def
+ dup stringwidth pop /d exch def % adjust circle size to string width
+ currentpoint FontSize 3 div add exch d 2 div add exch
+ d 0.6 mul 0 360 arc
+ fill grestore
+ } def
+
+ % axes labelling font
+ /Helvetica-Bold findfont FontSize scalefont setfont
+ 0.5 setgray
+
+ % print axis labelling, X
+ llx numstepunit div floor numstepunit mul cvi
+ numstepunit
+ urx
+ { % for
+ dup 0 eq
+ {
+ pop
+ }{
+ dup 20 moveto
+ gridunit div round cvi
+ ( ) cvs dup stringwidth pop 2 div neg 0 rmoveto
+ kreis show
+ } ifelse
+ } bind for
+
+ % print axis labelling, Y
+ lly numstepunit div floor numstepunit mul cvi
+ numstepunit
+ ury
+ { % for
+ dup 0 eq
+ {
+ pop
+ }{
+ 40 1 index moveto
+ gridunit div round cvi
+ ( ) cvs dup stringwidth pop
+ neg 3 sub FontSize 3 div neg rmoveto
+ kreis show
+ } ifelse
+ } bind for
+
+ end restore
+
+ } bind def % dr@wgrid
+
+ % %% Hook into dvips-generated PS
+ % at start of page:
+ %/bop-hook where
+ % {
+ % pop
+ % /@ldbophookgrid /bop-hook load def
+ % /bop-hook { @ldbophookgrid dr@wgrid } def
+ % }{
+ % /bop-hook { dr@wgrid } def
+ % } ifelse
+ % at end of page:
+ /eop-hook where
+ {
+ pop
+ /@ldeophookgrid /eop-hook load def
+ /eop-hook { @ldeophookgrid dr@wgrid } def
+ }{
+ /eop-hook { dr@wgrid } def
+ } ifelse
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.mmgrid
+ } pop % PostScript cleanup
+%
+% EOF config.mmgrid
diff --git a/dviware/dvipsconfig/config.psgrid b/dviware/dvipsconfig/config.psgrid
new file mode 100644
index 0000000000..86910c49ff
--- /dev/null
+++ b/dviware/dvipsconfig/config.psgrid
@@ -0,0 +1,175 @@
+%!
+% config.psgrid
+% Configuration and header file for dvips. Load with: dvips -P psgrid
+%
+% Draw a line grid in PostScript's standard coordinate grid.
+% The resulting grid can be used for measuring BoundingBoxes.
+%
+% This code is based on code from the book
+%
+% @Book{Merz:PostscriptAcrobatBibel,
+% author = "Thomas Merz",
+% title = "Die PostScript- und Acrobat-Bibel. Was Sie schon
+% immer {\"u}ber PostScript und Acrobat/{PDF} wissen
+% wollten",
+% publisher = "Thomas Merz Verlag",
+% year = "1996",
+% address = "M{\"u}nchen",
+% edition = "1",
+% ISBN = "3-9804943-0-6",
+% }
+% @Book{Merz:PostscriptAcrobatBible,
+% author = "Thomas Merz",
+% title = "PostScript & acrobat/{PDF}: applications,
+% troubleshooting, and cross-platform publishing",
+% publisher = "Springer",
+% year = "1997",
+% address = "Berlin",
+% ISBN = "3-540-60854-0",
+% }
+%
+% The original code can be found in file ps/eps/gitter.ps on the CD which
+% accompanies the German edition.
+% The original code is copyright (C) Thomas Merz 1994-96.
+% Incorporation of the original code into this file is with permission of
+% Thomas Merz.
+% For further information about the book see http://www.pdflib.com/
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 25, 26 Oct 1997; 25 Jan 1998; 9 Mar 2000; 11 May 2006
+%
+ /dr@wgrid {
+
+ save
+ 25 dict begin
+
+ /step 10 def % grid line increment, in PostScript point
+ /medstep 50 def % solid grid lines every this often
+ /numstep 100 def % numbered grid lines every this often
+
+ /FontSize 10 def % font size of numbers
+
+ %initgraphics % don't use - can stuff things up and is not necessary
+ newpath 0 setlinecap 0 setlinejoin 10 setmiterlimit
+
+ clippath pathbbox newpath
+ cvi /ury exch def
+ cvi /urx exch def
+ 10 div floor 10 mul cvi /lly exch def
+ 10 div floor 10 mul cvi /llx exch def
+ urx llx sub /lenx exch def
+ ury lly sub /leny exch def
+
+ /snaptopixel {
+ transform
+ .25 sub round .25 add exch
+ .25 sub round .25 add exch
+ itransform
+ } bind def
+
+ 0.01 setlinewidth
+ [1 2] 0 setdash % dashed line
+ 0 setgray
+ /set-line-style {
+ dup medstep mod 0 eq { [ ] 0 setdash } if
+ %dup 100 mod 0 eq { 0.75 setlinewidth 0.35 setgray } if
+ %dup 0 eq { 1.25 setlinewidth } if
+ %dup 0 eq { 0.8 setlinewidth } if
+ dup numstep mod 0 eq { 0.4 setlinewidth } if
+ dup 0 eq { 0.6 setlinewidth } if
+ } bind def
+
+ llx step urx { % draw vertical lines
+ gsave
+ set-line-style
+ lly snaptopixel moveto 0 leny snaptopixel rlineto stroke
+ grestore
+ } for
+
+ lly step ury { % draw horizontal lines
+ gsave
+ set-line-style
+ llx exch snaptopixel moveto lenx 0 snaptopixel rlineto stroke
+ grestore
+ } for
+
+ % circle at (0,0)
+ [ ] 0 setdash 1 setlinewidth newpath 15 0 moveto 0 0 15 0 360 arc stroke
+
+ /kreis { % clip light circle from existing lines
+ gsave 1 setgray
+ %/d (500) stringwidth pop def
+ dup stringwidth pop /d exch def % adjust circle size to string width
+ currentpoint FontSize 3 div add exch d 2 div add exch
+ d 0.6 mul 0 360 arc
+ fill grestore
+ } def
+
+ % axes labelling font
+ /Helvetica-Bold findfont FontSize scalefont setfont
+ 0.5 setgray
+
+ % print axis labelling, X
+ llx numstep div floor numstep mul cvi
+ numstep urx { % for
+ dup 0 eq
+ {
+ pop
+ }{
+ dup 20 moveto
+ ( ) cvs dup stringwidth pop 2 div neg 0 rmoveto
+ kreis show
+ } ifelse
+ } bind for
+
+ % print axis labelling, Y
+ lly numstep div floor numstep mul cvi
+ numstep ury { % for
+ dup 0 eq
+ {
+ pop
+ }{
+ 40 1 index moveto
+ ( ) cvs dup stringwidth pop
+ neg 3 sub FontSize 3 div neg rmoveto
+ kreis show
+ } ifelse
+ } bind for
+
+ end restore
+
+ } bind def % dr@wgrid
+
+ % %% Hook into dvips-generated PS
+ % at start of page:
+ %/bop-hook where
+ % {
+ % pop
+ % /@ldbophookgrid /bop-hook load def
+ % /bop-hook { @ldbophookgrid dr@wgrid } def
+ % }{
+ % /bop-hook { dr@wgrid } def
+ % } ifelse
+ % at end of page:
+ /eop-hook where
+ {
+ pop
+ /@ldeophookgrid /eop-hook load def
+ /eop-hook { @ldeophookgrid dr@wgrid } def
+ }{
+ /eop-hook { dr@wgrid } def
+ } ifelse
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.psgrid
+ } pop % PostScript cleanup
+%
+% EOF config.psgrid
diff --git a/dviware/dvipsconfig/config.screen100 b/dviware/dvipsconfig/config.screen100
new file mode 100644
index 0000000000..1b2d1dbfb8
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen100
@@ -0,0 +1,34 @@
+%!
+% config.screen100
+% Configuration and header file for dvips. Load with: dvips -P screen100
+%
+% Sets screen parameters to:
+% frequency: 100 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995; 9, 22 Mar 2000
+%
+ 100 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen100
+ } pop % PostScript cleanup
+%
+% EOF config.screen100
diff --git a/dviware/dvipsconfig/config.screen100_0 b/dviware/dvipsconfig/config.screen100_0
new file mode 100644
index 0000000000..0bd08f6940
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen100_0
@@ -0,0 +1,34 @@
+%!
+% config.screen100_0
+% Configuration and header file for dvips. Load with: dvips -P screen100_0
+%
+% Sets screen parameters to:
+% frequency: 100 lpi, angle: 0 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995; 9, 22 Mar 2000
+%
+ 100 0
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen100_0
+ } pop % PostScript cleanup
+%
+% EOF config.screen100_0
diff --git a/dviware/dvipsconfig/config.screen110 b/dviware/dvipsconfig/config.screen110
new file mode 100644
index 0000000000..6ebbb86c0b
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen110
@@ -0,0 +1,34 @@
+%!
+% config.screen110
+% Configuration and header file for dvips. Load with: dvips -P screen110
+%
+% Sets screen parameters to:
+% frequency: 110 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995; 9, 22 Mar 2000
+%
+ 110 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen110
+ } pop % PostScript cleanup
+%
+% EOF config.screen110
diff --git a/dviware/dvipsconfig/config.screen120 b/dviware/dvipsconfig/config.screen120
new file mode 100644
index 0000000000..ea626aff4b
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen120
@@ -0,0 +1,34 @@
+%!
+% config.screen120
+% Configuration and header file for dvips. Load with: dvips -P screen120
+%
+% Sets screen parameters to:
+% frequency: 120 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995; 9, 22 Mar 2000
+%
+ 120 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen120
+ } pop % PostScript cleanup
+%
+% EOF config.screen120
diff --git a/dviware/dvipsconfig/config.screen130 b/dviware/dvipsconfig/config.screen130
new file mode 100644
index 0000000000..ffa268b77c
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen130
@@ -0,0 +1,34 @@
+%!
+% config.screen130
+% Configuration and header file for dvips. Load with: dvips -P screen130
+%
+% Sets screen parameters to:
+% frequency: 130 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995; 9, 22 Mar 2000
+%
+ 130 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen130
+ } pop % PostScript cleanup
+%
+% EOF config.screen130
diff --git a/dviware/dvipsconfig/config.screen140 b/dviware/dvipsconfig/config.screen140
new file mode 100644
index 0000000000..9e6614fc94
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen140
@@ -0,0 +1,34 @@
+%!
+% config.screen140
+% Configuration and header file for dvips. Load with: dvips -P screen140
+%
+% Sets screen parameters to:
+% frequency: 140 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995; 9, 22 Mar 2000
+%
+ 140 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen140
+ } pop % PostScript cleanup
+%
+% EOF config.screen140
diff --git a/dviware/dvipsconfig/config.screen150 b/dviware/dvipsconfig/config.screen150
new file mode 100644
index 0000000000..4bcc8a8353
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen150
@@ -0,0 +1,34 @@
+%!
+% config.screen150
+% Configuration and header file for dvips. Load with: dvips -P screen150
+%
+% Sets screen parameters to:
+% frequency: 150 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995; 9, 22 Mar 2000
+%
+ 150 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen150
+ } pop % PostScript cleanup
+%
+% EOF config.screen150
diff --git a/dviware/dvipsconfig/config.screen35 b/dviware/dvipsconfig/config.screen35
new file mode 100644
index 0000000000..2857af0043
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen35
@@ -0,0 +1,34 @@
+%!
+% config.screen35
+% Configuration and header file for dvips. Load with: dvips -P screen35
+%
+% Sets screen parameters to:
+% frequency: 35 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 26 Jun 1996, 25 Jan 1998; 9 Mar 2000
+%
+ 35 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen35
+ } pop % PostScript cleanup
+%
+% EOF config.screen35
diff --git a/dviware/dvipsconfig/config.screen50 b/dviware/dvipsconfig/config.screen50
new file mode 100644
index 0000000000..a327c6deca
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen50
@@ -0,0 +1,34 @@
+%!
+% config.screen50
+% Configuration and header file for dvips. Load with: dvips -P screen50
+%
+% Sets screen parameters to:
+% frequency: 50 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 26 Jun 1996, 25 Jan 1998; 9 Mar 2000
+%
+ 50 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen50
+ } pop % PostScript cleanup
+%
+% EOF config.screen50
diff --git a/dviware/dvipsconfig/config.screen70 b/dviware/dvipsconfig/config.screen70
new file mode 100644
index 0000000000..af4b8002ac
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen70
@@ -0,0 +1,34 @@
+%!
+% config.screen70
+% Configuration and header file for dvips. Load with: dvips -P screen70
+%
+% Sets screen parameters to:
+% frequency: 70 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995; 9, 22 Mar 2000
+%
+ 70 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen70
+ } pop % PostScript cleanup
+%
+% EOF config.screen70
diff --git a/dviware/dvipsconfig/config.screen80 b/dviware/dvipsconfig/config.screen80
new file mode 100644
index 0000000000..e7635ff668
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen80
@@ -0,0 +1,34 @@
+%!
+% config.screen80
+% Configuration and header file for dvips. Load with: dvips -P screen80
+%
+% Sets screen parameters to:
+% frequency: 80 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995; 9, 22 Mar 2000
+%
+ 80 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen80
+ } pop % PostScript cleanup
+%
+% EOF config.screen80
diff --git a/dviware/dvipsconfig/config.screen85 b/dviware/dvipsconfig/config.screen85
new file mode 100644
index 0000000000..e069a6e4c5
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen85
@@ -0,0 +1,34 @@
+%!
+% config.screen85
+% Configuration and header file for dvips. Load with: dvips -P screen85
+%
+% Sets screen parameters to:
+% frequency: 85 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 02 Mar 1995; 9, 22 Mar 2000
+%
+ 85 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen85
+ } pop % PostScript cleanup
+%
+% EOF config.screen85
diff --git a/dviware/dvipsconfig/config.screen90 b/dviware/dvipsconfig/config.screen90
new file mode 100644
index 0000000000..ae37d274bb
--- /dev/null
+++ b/dviware/dvipsconfig/config.screen90
@@ -0,0 +1,34 @@
+%!
+% config.screen90
+% Configuration and header file for dvips. Load with: dvips -P screen90
+%
+% Sets screen parameters to:
+% frequency: 90 lpi, angle: 45 degree, spot function: dot
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995; 9, 22 Mar 2000
+%
+ 90 45
+ { % "Dot" function:
+ abs exch abs 2 copy add 1 gt
+ {
+ 1 sub dup mul exch 1 sub dup mul add 1 sub
+ }{
+ dup mul exch dup mul add 1 exch sub
+ } ifelse
+ }
+ setscreen
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.screen90
+ } pop % PostScript cleanup
+%
+% EOF config.screen90
diff --git a/dviware/dvipsconfig/config.simplex b/dviware/dvipsconfig/config.simplex
new file mode 100644
index 0000000000..aecbb64067
--- /dev/null
+++ b/dviware/dvipsconfig/config.simplex
@@ -0,0 +1,45 @@
+%!
+% config.simplex
+% Configuration and header file for dvips. Load with: dvips -P simplex
+%
+% Forces printing in simplex mode on a duplex printer.
+% Ignored on a simplex printer.
+% Works on: HP LaserJet IIISi, HP LJ 4m, 4m+, 4mv, 5, gs 3.33, 5.10, 6.0.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 20 Feb 1995, 5 Feb 1998; 9, 22 Mar 2000
+%
+ %statusdict begin false setduplexmode end
+ /setpagedevice where {
+ pop % throw dict name
+ % gs 3.33 does not have /Duplex, /Tumble in pagedevice dict
+ currentpagedevice /Duplex known {
+ %<< /Duplex true >> % << >> are level 2 only
+ /tmpdict 1 dict def tmpdict /Duplex false put tmpdict
+ setpagedevice
+ } if
+ currentpagedevice /Tumble known {
+ % HP seems to always do this
+ /tmpdict 1 dict def tmpdict /Tumble false put tmpdict
+ setpagedevice
+ } if
+ }{
+ statusdict begin
+ false setduplexmode
+ false settumble % HP seems to always do this
+ end
+ } ifelse
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.simplex
+ } pop % PostScript cleanup
+%
+% EOF config.simplex
diff --git a/dviware/dvipsconfig/config.tek550paper b/dviware/dvipsconfig/config.tek550paper
new file mode 100644
index 0000000000..bc33defc67
--- /dev/null
+++ b/dviware/dvipsconfig/config.tek550paper
@@ -0,0 +1,45 @@
+%!
+% config.tek550paper
+% Configuration and header file for dvips. Load with: dvips -P tek550paper
+%
+% Selects printing on paper for Tektronix colour printers.
+% It should work for the following printers (because they all use the same
+% PostScript code):
+% "Tektronix Phaser 550",
+% "Tektronix Phaser 550 1200 dpi",
+% "Tektronix Phaser 550J"
+% "Tektronix Phaser 550J 1200 dpi",
+% all using: PSVersion: "(2015.105) 9"
+% "Tektronix Phaser 560",
+% "Tektronix Phaser 560 Extended"
+% "Tektronix Phaser 560J Extended",
+% all using: PSVersion: "(2015.105) 14"
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 19 Feb 1999; 9 Mar 2000
+%
+ mark
+ {
+ 4 dict begin
+ /MediaPosition null def
+ /MediaType (Paper) def
+ /TraySwitch true def
+ /ManualFeed false def
+ currentdict end
+ setpagedevice
+ } stopped % execute procedure, ignoring errors
+ cleartomark % tidy up stack
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.tek550paper
+ } pop % PostScript cleanup
+%
+% EOF config.tek550paper
diff --git a/dviware/dvipsconfig/config.tek550transparency b/dviware/dvipsconfig/config.tek550transparency
new file mode 100644
index 0000000000..ab3731c20c
--- /dev/null
+++ b/dviware/dvipsconfig/config.tek550transparency
@@ -0,0 +1,45 @@
+%!
+% config.tek550transparency
+% Configuration and header file for dvips. Load with: dvips -P tek550transparency
+%
+% Selects printing on transparency for Tektronix colour printers.
+% It should work for the following printers (because they all use the same
+% PostScript code):
+% "Tektronix Phaser 550",
+% "Tektronix Phaser 550 1200 dpi",
+% "Tektronix Phaser 550J"
+% "Tektronix Phaser 550J 1200 dpi",
+% all using: PSVersion: "(2015.105) 9"
+% "Tektronix Phaser 560",
+% "Tektronix Phaser 560 Extended"
+% "Tektronix Phaser 560J Extended",
+% all using: PSVersion: "(2015.105) 14"
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 19 Feb 1999; 9 Mar 2000
+%
+ mark
+ {
+ 4 dict begin
+ /MediaPosition null def
+ /MediaType (Transparency) def
+ /TraySwitch true def
+ /ManualFeed false def
+ currentdict end
+ setpagedevice
+ } stopped % execute procedure, ignoring errors
+ cleartomark % tidy up stack
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.tek550transparency
+ } pop % PostScript cleanup
+%
+% EOF config.tek550transparency
diff --git a/dviware/dvipsconfig/config.tray1 b/dviware/dvipsconfig/config.tray1
new file mode 100644
index 0000000000..91bade03bc
--- /dev/null
+++ b/dviware/dvipsconfig/config.tray1
@@ -0,0 +1,65 @@
+%!
+% config.tray1
+% Configuration and header file for dvips. Load with: dvips -P tray1
+%
+% Selects paper from "tray 1"
+% - often this is the manual feeder / upper tray / multipurpose tray.
+% This should work with these HP LaserJet printers:
+% 4/4M Plus PS 300 + 600
+% 4V/4MV PostScript
+% 5/5M PostScript, 5P/5MP PostScript
+% 5Si/5Si MX PS, 5Si Mopier PS
+% This is very unlikely to work with these HP LaserJet printers because they
+% select trays via media type and not media position:
+% 4Si/4SiMX PS 300dpi + 600dpi
+% 4/4M PS 600 dpi
+% Tested with:
+% gs 5.10, ...
+% Will be silently ignored by a PS level 1 PostScript interpreter,
+% or any other which doesn't know /MediaPosition.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Steffen Klupsch <steffen@klupsch.de>
+% 15 Mar 2000
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 21 Mar 2000
+%
+ /setpagedevice where
+ {
+ %dup { pstack flush pop pop } forall pstack flush
+ pop % remove dict name
+ % check whether pagedevice dict has /DeferredMediaSelection
+ % (gs 3.33 has setpagedevice, but error on /DeferredMediaSelection)
+ /hasDMS false def
+ currentpagedevice
+ {
+ /DeferredMediaSelection eq { /hasDMS true def } if
+ pop % throw value of key
+ } forall
+ hasDMS {
+ <<
+ /DeferredMediaSelection true % what exactly is this?
+ >>
+ setpagedevice
+ } if
+ % gs 5.10, 6.0: error on /MediaPosition
+ currentpagedevice /MediaPosition known {
+ <<
+ /MediaPosition 3 % select tray
+ >>
+ setpagedevice
+ } if
+ } if
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.tray1
+ } pop % PostScript cleanup
+%
+% EOF config.tray1
diff --git a/dviware/dvipsconfig/config.tray2 b/dviware/dvipsconfig/config.tray2
new file mode 100644
index 0000000000..84d9561ad5
--- /dev/null
+++ b/dviware/dvipsconfig/config.tray2
@@ -0,0 +1,65 @@
+%!
+% config.tray2
+% Configuration and header file for dvips. Load with: dvips -P tray2
+%
+% Selects paper from "tray 2"
+% - often this is the lower tray.
+% This should work with these HP LaserJet printers:
+% 4/4M Plus PS 300 + 600
+% 4V/4MV PostScript
+% 5/5M PostScript, 5P/5MP PostScript
+% 5Si/5Si MX PS, 5Si Mopier PS
+% This is very unlikely to work with these HP LaserJet printers because they
+% select trays via media type and not media position:
+% 4Si/4SiMX PS 300dpi + 600dpi
+% 4/4M PS 600 dpi
+% Tested with:
+% gs 5.10, ...
+% Will be silently ignored by a PS level 1 PostScript interpreter,
+% or any other which doesn't know /MediaPosition.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Steffen Klupsch <steffen@klupsch.de>
+% 15 Mar 2000
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 21 Mar 2000
+%
+ /setpagedevice where
+ {
+ %dup { pstack flush pop pop } forall pstack flush
+ pop % remove dict name
+ % check whether pagedevice dict has /DeferredMediaSelection
+ % (gs 3.33 has setpagedevice, but error on /DeferredMediaSelection)
+ /hasDMS false def
+ currentpagedevice
+ {
+ /DeferredMediaSelection eq { /hasDMS true def } if
+ pop % throw value of key
+ } forall
+ hasDMS {
+ <<
+ /DeferredMediaSelection true % what exactly is this?
+ >>
+ setpagedevice
+ } if
+ % gs 5.10, 6.0: error on /MediaPosition
+ currentpagedevice /MediaPosition known {
+ <<
+ /MediaPosition 0 % select tray
+ >>
+ setpagedevice
+ } if
+ } if
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.tray2
+ } pop % PostScript cleanup
+%
+% EOF config.tray2
diff --git a/dviware/dvipsconfig/config.tray3 b/dviware/dvipsconfig/config.tray3
new file mode 100644
index 0000000000..f553e30ae7
--- /dev/null
+++ b/dviware/dvipsconfig/config.tray3
@@ -0,0 +1,65 @@
+%!
+% config.tray3
+% Configuration and header file for dvips. Load with: dvips -P tray3
+%
+% Selects paper from "tray 3"
+% - often this is the large capacity / lower cassette.
+% This should work with these HP LaserJet printers:
+% 4/4M Plus PS 300 + 600
+% 4V/4MV PostScript
+% 5/5M PostScript, 5P/5MP PostScript
+% 5Si/5Si MX PS, 5Si Mopier PS
+% This is very unlikely to work with these HP LaserJet printers because they
+% select trays via media type and not media position:
+% 4Si/4SiMX PS 300dpi + 600dpi
+% 4/4M PS 600 dpi
+% Tested with:
+% gs 5.10, ...
+% Will be silently ignored by a PS level 1 PostScript interpreter,
+% or any other which doesn't know /MediaPosition.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Steffen Klupsch <steffen@klupsch.de>
+% 15 Mar 2000
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 21 Mar 2000
+%
+ /setpagedevice where
+ {
+ %dup { pstack flush pop pop } forall pstack flush
+ pop % remove dict name
+ % check whether pagedevice dict has /DeferredMediaSelection
+ % (gs 3.33 has setpagedevice, but error on /DeferredMediaSelection)
+ /hasDMS false def
+ currentpagedevice
+ {
+ /DeferredMediaSelection eq { /hasDMS true def } if
+ pop % throw value of key
+ } forall
+ hasDMS {
+ <<
+ /DeferredMediaSelection true % what exactly is this?
+ >>
+ setpagedevice
+ } if
+ % gs 5.10, 6.0: error on /MediaPosition
+ currentpagedevice /MediaPosition known {
+ <<
+ /MediaPosition 1 % select tray
+ >>
+ setpagedevice
+ } if
+ } if
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.tray3
+ } pop % PostScript cleanup
+%
+% EOF config.tray3
diff --git a/dviware/dvipsconfig/config.usledger b/dviware/dvipsconfig/config.usledger
new file mode 100644
index 0000000000..27f10c5350
--- /dev/null
+++ b/dviware/dvipsconfig/config.usledger
@@ -0,0 +1,52 @@
+%!
+% config.usledger
+% Configuration and header file for dvips. Load with: dvips -P usledger
+%
+% Forces printing on US ledger paper, if available.
+% Works with HP LJ 5000. Probably also works with other printers.
+% Will be silently ignored by a PS level 1 PostScript interpreter.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 21 Feb 1995; 14, 16, 17, 26 Oct 1997; 25 Jan 1998; 9 Mar 2000
+%
+ /setpagedevice where
+ {
+ %dup { pstack flush pop pop } forall pstack flush
+ pop % remove dict name
+ % check whether pagedevice dict has /DeferredMediaSelection
+ % (gs 3.33 has setpagedevice, but error on /DeferredMediaSelection)
+ /hasDMS false def
+ currentpagedevice
+ {
+ /DeferredMediaSelection eq { /hasDMS true def } if
+ pop % throw value of key
+ } forall
+ hasDMS {
+ <<
+ /DeferredMediaSelection true % what exactly is this?
+ >>
+ setpagedevice
+ } if
+ <<
+ % /DeferredMediaSelection true % what exactly is this?
+ /PageSize [792 1224] % size US ledger portrait
+ /ImagingBBox null % set null after /PageSize
+ >>
+ setpagedevice
+ }
+ { }
+ ifelse
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.usledger
+ } pop % PostScript cleanup
+%
+% EOF config.usledger
diff --git a/dviware/dvipsconfig/config.usletter b/dviware/dvipsconfig/config.usletter
new file mode 100644
index 0000000000..1a6876abbd
--- /dev/null
+++ b/dviware/dvipsconfig/config.usletter
@@ -0,0 +1,51 @@
+%!
+% config.usletter
+% Configuration and header file for dvips. Load with: dvips -P usletter
+%
+% Forces printing on US letter paper, if available.
+% Will be silently ignored by a PS level 1 PostScript interpreter.
+%
+% This file is built so it can be used both as the header file for
+% PostScript and as the configuration file for dvips.
+% (Note that dvips ignores any lines beginning with a space or a "%".)
+%
+% Copyright (C) 1995-2006 by Volker Kuhlmann.
+% Released under the terms of the GNU General Public License (GPL) Version 2.
+% See http://www.gnu.org/ for details.
+%
+% Volker Kuhlmann <VolkerKuhlmann@gmx.de>
+% 21 Feb 1995; 14, 16, 17, 26 Oct 1997; 25 Jan 1998; 9 Mar 2000
+%
+ /setpagedevice where
+ {
+ %dup { pstack flush pop pop } forall pstack flush
+ pop % remove dict name
+ % check whether pagedevice dict has /DeferredMediaSelection
+ % (gs 3.33 has setpagedevice, but error on /DeferredMediaSelection)
+ /hasDMS false def
+ currentpagedevice
+ {
+ /DeferredMediaSelection eq { /hasDMS true def } if
+ pop % throw value of key
+ } forall
+ hasDMS {
+ <<
+ /DeferredMediaSelection true % what exactly is this?
+ >>
+ setpagedevice
+ } if
+ <<
+ % /DeferredMediaSelection true % what exactly is this?
+ /PageSize [612 792] % size US letter portrait
+ /ImagingBBox null % set null after /PageSize
+ >>
+ setpagedevice
+ }
+ { }
+ ifelse
+%
+ { % start a procedure so PostScript `ignores' the dvips configuration part.
+h config.usletter
+ } pop % PostScript cleanup
+%
+% EOF config.usletter