summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipsk/contrib/configs
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-17 21:41:51 +0000
committerKarl Berry <karl@freefriends.org>2006-01-17 21:41:51 +0000
commit487ca4806cc046076293cf6cc5fbba0db282bac7 (patch)
tree847b412ab5158dd7bdd7ed7e5a4cc3fbca94be32 /Build/source/texk/dvipsk/contrib/configs
parenta3d3111bfe26b8e5f5bc6049dfb2a4ca2edc7881 (diff)
texk 1
git-svn-id: svn://tug.org/texlive/trunk@1485 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipsk/contrib/configs')
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/2a4.ps49
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/config.fax5
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/config.lino93
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/config.lj2p95
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/config.post3x328
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/config.rokicki62
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/loop.ps2
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/mkdvipspapers429
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/papersize.level2236
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/papersize.simple44
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/prepipe.ps1
-rw-r--r--Build/source/texk/dvipsk/contrib/configs/showpage.ps1
12 files changed, 1045 insertions, 0 deletions
diff --git a/Build/source/texk/dvipsk/contrib/configs/2a4.ps b/Build/source/texk/dvipsk/contrib/configs/2a4.ps
new file mode 100644
index 00000000000..cf2d4f479eb
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/2a4.ps
@@ -0,0 +1,49 @@
+% @(#)2a4.ps 1.0 95/10/30 pete
+%
+% The following code defines PostScript procedures to work dvips.
+% they must be downloaded or sent as a header file together with
+% the PostScript version of your (La)TeX file.
+%
+% Originated probably by Piet van Oostrum, Department of Computer Science,
+% Utrecht University, Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht
+% Phone +31 30 531806
+% Fax +31 30 513791
+% <piet@cs.ruu.nl> uunet!mcsun!ruuinf!piet
+%
+% it is now re-written to work with dvips(k)-5.58f by Peter Dyballa
+% Johann Wolfgang Goethe-Universit\"at Robert-Mayer-Str. 11-15
+% Fachbereich 20 - Theoretische Informatik D 60325 Frankfurt am Main
+% (Department for Computer Science) (Federal Republic of Germany)
+%
+%
+% To use 2a4.ps include this on invocation of dvips:
+% -h 2a4.ps -t landscape
+%
+% do not include this in your (La)TeX source:
+% \special{landscape}\special{header=2a4.ps}
+%
+/isoddpage true def
+/orig-showpage /showpage load def
+/factor 0.707106781187 def
+/showpage {
+ isoddpage not { orig-showpage } if
+ /isoddpage isoddpage not store
+ } def
+
+/bop-hook {
+ /vsize 1 factor add neg def
+ isoddpage {factor factor scale
+ 842 412 translate }
+ { 0 -595 translate } ifelse
+ } def
+
+/end-hook {
+ isoddpage not { orig-showpage } if
+ } def
+%
+% Theses measures are for those paper formats:
+%
+% DIN A4 letter legal
+% 148mm = 412 PS pt 5.5in = 396 PS pt 7in = 504 PS pt
+% 210mm = 595 PS pt 8.5in = 612 PS pt 8.5in = 612 PS pt
+% 297mm = 842 PS pt 11in = 792 PS pt 14in = 1008 PS pt
diff --git a/Build/source/texk/dvipsk/contrib/configs/config.fax b/Build/source/texk/dvipsk/contrib/configs/config.fax
new file mode 100644
index 00000000000..963ebffaf33
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/config.fax
@@ -0,0 +1,5 @@
+*
+* For FAX output, we set 200 dpi, FAX mode.
+*
+D 200
+M FAX
diff --git a/Build/source/texk/dvipsk/contrib/configs/config.lino b/Build/source/texk/dvipsk/contrib/configs/config.lino
new file mode 100644
index 00000000000..4e3285f5089
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/config.lino
@@ -0,0 +1,93 @@
+*
+* This configuration file is a sample one for a typesetter. See the
+* end of the file especially, where we use setpageparams. With a
+* configuration file like this, you can use
+*
+* -t film0 -k -T 11in,17in
+*
+* for instance to print an 11x17 inch document in orientation 0 with
+* crop marks.
+*
+* Assume we have a nice modern lino with lots of memory.
+*
+m 1000000
+*
+* And send output by default to a PostScript file.
+*
+o
+*
+* Default resolution. We must get this right!
+*
+D 1270
+*
+* Compress the fonts.
+*
+Z
+*
+* Paper size information. First definition is the default.
+*
+* If your default is a4 uncomment the following definition
+* and comment out the letterSize definition.
+*
+*@ a4size 210mm 297mm
+*@+ %%PaperSize: a4
+
+@ letterSize 8.5in 11in
+@+ %%PaperSize: Letter
+
+@ letter 8.5in 11in
+@+ %%BeginPaperSize: Letter
+@+ letter
+@+ %%EndPaperSize
+
+@ legal 8.5in 14in
+@+ ! %%DocumentPaperSizes: Legal
+@+ %%BeginPaperSize: Legal
+@+ legal
+@+ %%EndPaperSize
+
+@ ledger 17in 11in
+@+ ! %%DocumentPaperSizes: Ledger
+@+ %%BeginPaperSize: Ledger
+@+ ledger
+@+ %%EndPaperSize
+
+@ tabloid 11in 17in
+@+ ! %%DocumentPaperSizes: Tabloid
+@+ %%BeginPaperSize: Tabloid
+@+ 11x17
+@+ %%EndPaperSize
+
+@ a4 210mm 297mm
+@+ ! %%DocumentPaperSizes: a4
+@+ %%BeginPaperSize: a4
+@+ a4
+@+ %%EndPaperSize
+
+@ a3 297mm 420mm
+@+ ! %%DocumentPaperSizes: a3
+@+ %%BeginPaperSize: a3
+@+ a3
+@+ %%EndPaperSize
+*
+* These last two are only for typesetters that can set the page size;
+* uncomment and put them in a `config.lino', for instance.
+*
+* Use this for pages where you want the text to run in the same direction
+* as the film feeds (slow scan direction; down the length of the film.)
+* Best for everything *but* pages higher than the film is wide or pages
+* wider than they are tall; needed for pages wider than the film is wide.
+*
+@ film0 0in 0in
+@+ statusdict /setpageparams known { vsize hsize 0 0 statusdict begin {
+@+ setpageparams } stopped end } { true } ifelse { statusdict /setpage known
+@+ { vsize hsize 0 statusdict begin { setpage } stopped pop end } if } if
+*
+* Use this for pages where you want the text to run across the width of
+* the film (fast scan direction.) Needed for pages taller than the film
+* is wide; preferred for pages wider than they are tall.
+*
+@ film1 0in 0in
+@+ statusdict /setpageparams known { hsize vsize 0 1 statusdict begin {
+@+ setpageparams } stopped end } { true } ifelse { statusdict /setpage known
+@+ { hsize vsize 1 statusdict begin { setpage } stopped pop end } if } if
diff --git a/Build/source/texk/dvipsk/contrib/configs/config.lj2p b/Build/source/texk/dvipsk/contrib/configs/config.lj2p
new file mode 100644
index 00000000000..aaf2a25f3f2
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/config.lj2p
@@ -0,0 +1,95 @@
+* original config.ps -- default definitions for dvips output.
+*
+* (If you change or delete `original' on the previous line, dvips won't
+* install its config.ps over this file.)
+*
+* Configuration file for Karl & Kathy's LaserJet IIP.
+
+* We have 2 2MB expansion cards.
+*
+m 2750000
+
+
+* Send output by default to our printer.
+*
+o |lpr
+
+
+* Default resolution.
+*
+D 300
+
+
+* Reverse the pages, since we usually print on the face-up tray.
+*
+r
+
+
+* Mode is for Canon engine.
+*
+M CanonCX
+
+
+* Also look for this list of resolutions.
+*
+R 300
+
+
+* The printer offsets the output by this much.
+*
+O 0pt,-6pt
+
+
+* Paper size information. First definition is the default.
+*
+* If your default is a4 uncomment the following definition
+* and comment out the letterSize definition.
+*
+* There is some redundancy in the following comments; that is to
+* get things to work both on the NeXT and on other printers.
+*
+*@ a4size 210mm 297mm
+*@+ %%PaperSize: a4
+
+@ letterSize 8.5in 11in
+
+@ letter 8.5in 11in
+@+ %%PaperSize: Letter
+@+ %%BeginPaperSize: Letter
+@+ letter
+@+ %%EndPaperSize
+
+@ legal 8.5in 14in
+@+ ! %%DocumentPaperSizes: Legal
+@+ %%PaperSize: Legal
+@+ %%BeginPaperSize: Legal
+@+ legal
+@+ %%EndPaperSize
+
+@ ledger 17in 11in
+@+ ! %%DocumentPaperSizes: Ledger
+@+ %%PaperSize: Ledger
+@+ %%BeginPaperSize: Ledger
+@+ ledger
+@+ %%EndPaperSize
+
+@ tabloid 11in 17in
+@+ ! %%DocumentPaperSizes: Tabloid
+@+ %%PaperSize: Tabloid
+@+ %%BeginPaperSize: Tabloid
+@+ 11x17
+@+ %%EndPaperSize
+
+@ a4 210mm 297mm
+@+ ! %%DocumentPaperSizes: a4
+@+ %%PaperSize: a4
+@+ %%BeginPaperSize: a4
+@+ a4
+@+ %%EndPaperSize
+
+@ a3 297mm 420mm
+@+ ! %%DocumentPaperSizes: a3
+@+ %%PaperSize: a3
+@+ %%BeginPaperSize: a3
+@+ a3
+@+ %%EndPaperSize
diff --git a/Build/source/texk/dvipsk/contrib/configs/config.post3x3 b/Build/source/texk/dvipsk/contrib/configs/config.post3x3
new file mode 100644
index 00000000000..f43b3071b4c
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/config.post3x3
@@ -0,0 +1,28 @@
+ %
+ % This file is an example of a header file for dvips. It prints a page
+ % (or a whole document) as a 3x3 poster. This file is built so it can
+ % be used both as the header file for PostScript and as the configuration
+ % file for dvips. First comes the PostScript part. (Note that dvips
+ % ignores any lines beginning with a space.) Change the number here.
+ % Use it with -P post3x3. We try to overlap pages a bit.
+ %
+ /xpost 3 def /ypost 3 def
+ userdict begin /bop-hook {
+ 36 36 translate
+ dup xpost ypost mul mod
+ dup xpost mod hsize 36 xpost 1 sub mul sub mul neg exch
+ xpost idiv vsize 36 ypost 1 sub mul sub mul neg translate % translate!
+ xpost ypost scale % scale!
+ -36 -36 translate
+ } def end
+ { % we start a procedure so PostScript `ignores' the dvips options.
+ %
+ % Now the dvips options. Change the number here too, to be
+ % xpost * ypost.
+ %
+b 9
+h config.post3x3
+ %
+ % Now PostScript cleanup.
+ %
+ } pop
diff --git a/Build/source/texk/dvipsk/contrib/configs/config.rokicki b/Build/source/texk/dvipsk/contrib/configs/config.rokicki
new file mode 100644
index 00000000000..62828369a74
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/config.rokicki
@@ -0,0 +1,62 @@
+*
+* See config.lino for more info.
+* With a virtual machine, we can claim 1M of memory.
+*
+m 1000000
+*
+* And send output by default to the printer.
+*
+o !lpr
+*
+* Default resolution.
+*
+D 400
+*
+* Last resort sizes.
+*
+R 100 120 144 300 360 400 432 480
+*
+* Paper size information. First definition is the default.
+*
+* If your default is a4 uncomment the following definition
+* and comment out the letterSize definition.
+*
+*@ A4size 210mm 297mm
+*@+ %%PaperSize: A4
+
+@ letterSize 8.5in 11in
+
+@ letter 8.5in 11in
+@+ %%BeginPaperSize: Letter
+@+ letter
+@+ %%EndPaperSize
+
+@ legal 8.5in 14in
+@+ ! %%DocumentPaperSizes: Legal
+@+ %%BeginPaperSize: Legal
+@+ legal
+@+ %%EndPaperSize
+
+@ ledger 17in 11in
+@+ ! %%DocumentPaperSizes: Ledger
+@+ %%BeginPaperSize: Ledger
+@+ ledger
+@+ %%EndPaperSize
+
+@ tabloid 11in 17in
+@+ ! %%DocumentPaperSizes: Tabloid
+@+ %%BeginPaperSize: Tabloid
+@+ 11x17
+@+ %%EndPaperSize
+
+@ A4 210mm 297mm
+@+ ! %%DocumentPaperSizes: A4
+@+ %%BeginPaperSize: A4
+@+ a4
+@+ %%EndPaperSize
+
+@ A3 297mm 420mm
+@+ ! %%DocumentPaperSizes: A3
+@+ %%BeginPaperSize: A3
+@+ a3
+@+ %%EndPaperSize
diff --git a/Build/source/texk/dvipsk/contrib/configs/loop.ps b/Build/source/texk/dvipsk/contrib/configs/loop.ps
new file mode 100644
index 00000000000..a38c4a19863
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/loop.ps
@@ -0,0 +1,2 @@
+%(%stdin) (r) file 1 string readstring
+{ } loop
diff --git a/Build/source/texk/dvipsk/contrib/configs/mkdvipspapers b/Build/source/texk/dvipsk/contrib/configs/mkdvipspapers
new file mode 100644
index 00000000000..b1adffcaa7a
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/mkdvipspapers
@@ -0,0 +1,429 @@
+#!/usr/local/bin/perl
+
+#
+# mkdvipspapers: a simple Perl script that generates a bunch of paper sizes
+# definitions for dvips.
+#
+# Copyright (C) 1995, Yves Arrouye <Yves.Arrouye@imag.fr> [06/15/95]
+#
+# THIS CODE IS PROVIDED AS IS, WITHOUT ANY WARRANTIES, EITHER EXPRESSED OR
+# IMPLIED, OF ITS FITNESS TO ANY PURPOSE. IT'S AUTHOR CANNOT BE HELD LIABLE
+# FOR ANY DAMAGES OCCURING DUE TO THE USE OF THIS CODE. USE AT YOUR OWN RISKS!
+
+# Known bugs: this script is written in Perl 5. (If you ever rewrite it in
+# Perl 4, I'm interested to get your version; I can provide a Perl-4 options
+# parser that is Getopt modified for it).
+
+# Last change: added the -p (--paper) option for specifying default size
+# (the first that will be generated). Arranged for the letter and a4 defs
+# be the first ones if nothing is specified (i.e. in the dvips default).
+# Note: the default paper size need not be in the chose ones, it is taken from
+# all the known papers sizes.
+
+# Read what follows for simple documentation and explanations.
+
+#
+# Options accepted by the script:
+#
+# --help print a small help message
+# --version print version
+#
+# -s, --standard generate standard definitions (Adobe ones)
+# -n, --non-standard generate dvips non-standard definitions
+# -d, --dvips generate dvips (i.e. standard + some) definitions
+# -g, --gs generate non-standard gs definitions
+# -e, --extra generate non-standard extra definitions
+# -l, --local generate local definitions
+# -a, --all generate all definitions
+#
+# -p, --paper default paper size
+#
+# default behaviour is the same as --dvips.
+#
+
+use Getopt::Long;
+
+#
+# The paper sizes definitions are stored in arrays with the following entries
+# for each paper size:
+#
+# - the name of the paper for dvips, e.g. letter;
+# - the name of the paper for the DSC PaperSize comment, e.g. Letter;
+# - the name of an accessible PostScript operator that may select the
+# correct paper size, e.g. letter;
+# - the name of a PostScript operator in statusdict that may select the
+# correct paper tray. e.g. lettertray (this is preferred);
+# - the physical width and height of the paper, either in points (no units
+# or bp, as in 4000bp), in inches (e.g 8.5in), centimeters (e.g. 21cm)
+# or in millimeters (e.g. 297mm);
+# - a flag indicating the orientation of the sheet, 0 meaning portrait and
+# 1 meaning landscape (this actually used only for gs' setpage operator).
+#
+# The PostScript code generated in the Setup section does the following.
+# First, we look in statusdict in order to look for a tray selection operator.
+# If there is none, but the specified PostScript operator is accessible with
+# the current dictionaries stacking order, we use it. If setpagedevice is
+# implemented and the other methods did fail, we use it. Otherwise, if the
+# setpage operator is present in statusdict, use this one. The setpage op. is
+# assumed to be
+#
+# <width> <height> <orient> setpage --
+#
+# where <orient> is 0 for portrait and 1 for landscape (in which case <width>
+# and <height> are swapped!).
+#
+
+#
+# This code has been tested with an Apple LaserWriter II, an Hewlett Packard
+# 4L laser printer, Ghostscript 3.33 and Ghostview 1.5 with success.
+#
+
+#
+# Enter your local definitions here in the same format as the examples
+# below.
+#
+# Papers defined here: (none).
+#
+
+@localpapersdefs = (
+);
+
+#
+# Standard (Adobe) names. Missing names are a4small and lettersmall, because
+# I don't have their definition handy.
+#
+# Papers defined here: 11x17, a3, a4, b5, ledger, legal, letter, note.
+#
+
+@stdpapersdefs = (
+ [
+ 'letter',
+ 'Letter', 'letter', 'lettertray',
+ '8.5in', '11in', 0
+ ],
+ [
+ 'a4',
+ 'A4', 'a4', 'a4tray',
+ '210mm', '297mm', 0
+ ],
+ [
+ '11x17',
+ '11x17', '11x17', '11x17tray',
+ '11in', '17in', 0
+ ],
+ [
+ 'a3',
+ 'A3', 'a3', 'a3tray',
+ '297mm', '420mm', 0
+ ],
+ [
+ 'b5',
+ 'B5', 'ab5', 'b5tray',
+ '177mm', '250mm', 0
+ ],
+ [
+ 'ledger',
+ 'Ledger', 'ledger', 'ledgertray',
+ '11in', '17in', 1
+ ],
+ [
+ 'legal',
+ 'Legal', 'legal', 'legaltray',
+ '8.5in', '14in', 0
+ ],
+ [
+ 'note',
+ 'Note', 'note', 'notetray',
+ '7.5in', '10in', 0
+ ]
+);
+
+#
+# Names that are present in the standard dvips distribution.
+#
+# Papers defined here: tabloid (aka 11x17).
+#
+
+@dvipspapersdefs = (
+ [
+ 'tabloid',
+ 'Tabloid', '11x17', '11x17tray',
+ '11in', '17in', 0
+ ],
+);
+
+#
+# Names that are present in the standard gs distribution. (Some names are
+# currently missing...)
+#
+# Papers defined here: a0, a1, a2, a5, a6, a7, a8, a9, a10,
+# b0, b1, b2, b3, b4.
+#
+
+@gspapersdefs = (
+ [
+ 'a0',
+ 'A0', 'a0', 'a0tray',
+ '840mm', '1188mm', 0
+ ],
+ [
+ 'a1',
+ 'A1', 'a1', 'a1tray',
+ '594mm', '840mm', 0
+ ],
+ [
+ 'a2',
+ 'A2', 'a2', 'a2tray',
+ '420mm', '594mm', 0
+ ],
+ [
+ 'a5',
+ 'A5', 'a5', 'a5tray',
+ '148mm', '210mm', 0
+ ],
+ [
+ 'a6',
+ 'A6', 'a6', 'a6tray',
+ '105mm', '148mm', 0
+ ],
+ [
+ 'a7',
+ 'A7', 'a7', 'a7tray',
+ '74mm', '105mm', 0
+ ],
+ [
+ 'a8',
+ 'A8', 'a8', 'a8tray',
+ '52.5mm', '74mm', 0
+ ],
+ [
+ 'a9',
+ 'A9', 'a9', 'a9tray',
+ '37mm', '52.5mm', 0
+ ],
+ [
+ 'a10',
+ 'A10', 'a10', 'a10tray',
+ '26.25mm', '37mm', 0
+ ],
+ [
+ 'b0',
+ 'B0', 'b0', 'b0tray',
+ '2836bp', '4008bp', 0
+ ],
+ [
+ 'b1',
+ 'B1', 'b1', 'b1tray',
+ '2004bp', '2836bp', 0
+ ],
+ [
+ 'b2',
+ 'B2', 'b2', 'b2tray',
+ '1418bp', '2004bp', 0
+ ],
+ [
+ 'b3',
+ 'B3', 'b3', 'b3tray',
+ '1002bp', '1418bp', 0
+ ],
+ [
+ 'b4',
+ 'B4', 'b4', 'b4tray',
+ '709bp', '1002bp', 0
+ ],
+);
+
+@extrapapersdefs = (
+ [
+ 'executive',
+ 'Executive', 'executivepage', 'executivepagetray',
+ '7.25in', '10.5in', 0
+ ],
+ [
+ 'halfexecutive',
+ 'HalfExecutive', 'halfexecutivepage', 'halfexecutivepagetray',
+ '5.25in', '7.25in', 0
+ ]
+);
+
+sub basename {
+ local($fullname, $ext) = @_;
+ local($basename) = $fullname;
+
+ $basename =~ s,(.*/)?([^/]+),$2,;
+ $ext && $basename =~ s,$ext$,,;
+
+ $basename;
+}
+
+sub dumpsizes {
+ local($legend, @sizes) = @_;
+
+ print "$legend";
+
+ for $spec (@sizes) {
+ local(@array) = @$spec;
+ local($name) = @array;
+
+ print $name, " ";
+ }
+ print "\n";
+}
+
+sub usage {
+ local($exitcode) = @_;
+ local($myname) = &basename($0);
+
+ if ($exitcode) {
+ select STDERR;
+ }
+
+ print "usage: $myname [ --version ] [ -h, --help ] [ -s, --standard ] [ -n, --non-standard ] [ -d, --dvips ] [ -g, --gs ] [ -e, --extra ] [ -l, --local ] [ -a, --all ] [ -p, --paper papername ]\n";
+
+ if ($exitcode == 0) {
+ print "\n";
+ print "options: --version\t\tprint version information\n";
+ print " -h, --help\t\tprint this help message\n";
+ print " -s, --standard\t\tdefine standard paper sizes\n";
+ print " -n, --non-standard\tdefine dvips' non-standard paper sizes\n";
+ print " -d, --dvips\t\tdefine all dvips paper sizes\n";
+ print " -g, --gs\t\tdefine gs' non-standard paper sizes\n";
+ print " -e, --extra\t\tdefine extra paper sizes\n";
+ print " -l, --local\t\tdefine local paper sizes\n";
+ print " -a, --all\t\tdefine all previous paper sizes\n";
+ print " -p, --paper papername\tspecify default paper size\n";
+ print "\npapers: "; &dumpsizes("--standard\t\t", @stdpapersdefs);
+ print " "; &dumpsizes("--non-standard\t\t", @dvipspapersdefs);
+ print " "; &dumpsizes("--gs\t\t\t", @gspapersdefs);
+ print " "; &dumpsizes("--extra\t\t", @extrapapersdefs);
+ print " "; &dumpsizes("--local\t\t", @localpapersdefs);
+ }
+
+ exit $exitcode;
+}
+
+sub pssize {
+ local ($size) = @_;
+ local $number = $size;
+
+ $number =~ s/\D+$//;
+
+ if ($size =~ /in$/) {
+ $number *= 72;
+ } elsif ($size =~ /cm$/) {
+ $number *= 72 / 2.54;
+ } elsif ($size =~ /mm$/) {
+ $number *= 72 / 25.4;
+ }
+
+ return int($number + .4);
+}
+
+sub genpaperdefs {
+ local ($papername, $dscname, $psname, $trayname,
+ $width, $height, $orient) = @$_;
+ local ($pswidth, $psheight) = (&pssize($width), &pssize($height));
+
+ local ($exch) = ($orient == 1 ? " exch" : "");
+
+ if ($width =~ /^\d$/) { $width = "${width}bp"; }
+ if ($height =~ /^\d$/) { $height = "${height}bp"; }
+
+ print <<EPD
+@ $papername $width $height
+@+ ! %%DocumentPaperSizes: $dscname
+@+ %%PaperSize: $dscname
+@+ %%BeginPaperSize: $dscname
+@+ /setpagedevice where {
+@+ pop 1 dict dup /PageSize [ $pswidth $psheight$exch ] put setpagedevice
+@+ } {
+@+ statusdict /$trayname known {
+@+ statusdict begin $trayname end
+@+ /$psname where { pop $psname } if
+@+ } {
+@+ /$psname where {
+@+ pop $psname
+@+ } {
+@+ statusdict /setpage known {
+@+ statusdict begin
+@+ $pswidth $psheight $orient setpage
+@+ end
+@+ } if
+@+ } ifelse
+@+ } ifelse
+@+ } ifelse
+@+ %%EndPaperSize
+
+EPD
+}
+
+if (!&GetOptions("standard|s", "non-standard|n", "dvips|d", "gs|g", "extra|e",
+ "local|l", "all|a", "paper|p=s", "help|h", "version")) {
+ &usage(1);
+} elsif ($#ARGV != -1) {
+ &usage(1);
+} elsif ($opt_help) {
+ &usage(0);
+} elsif ($opt_version) {
+ print &basename($0),
+ " version 1.2, by Yves Arrouye <Yves.Arrouye\@imag.fr>\n";
+ exit(0);
+} else {
+ @allpapersdefs = (@stdpapersdefs, @dvipspapersdefs, @gspapersdefs,
+ @extrapapersdefs, @localpapersdefs);
+ if ($opt_all) {
+ @paperdefs = @allpapersdefs;
+ } else {
+ @papersdefs = ();
+
+ if ($opt_dvips) {
+ $opt_standard = 1;
+ $opt_non_standard = 1;
+ }
+
+ if ($opt_standard && !$opt_dvips) {
+ @papersdefs = (@papersdefs, @stdpapersdefs);
+ }
+ if ($opt_non_standard && !$opt_dvips) {
+ @papersdefs = (@papersdefs, @dvipspapersdefs);
+ }
+ if ($opt_gs) {
+ @papersdefs = (@papersdefs, @gsspapersdefs);
+ }
+ if ($opt_extra) {
+ @papersdefs = (@papersdefs, @extrapapersdefs);
+ }
+ if ($opt_local) {
+ @papersdefs = (@papersdefs, @localpapersdefs);
+ }
+
+ if ($#papersdefs == -1) {
+ @papersdefs = (@stdpapersdefs, @dvipspapersdefs);
+ }
+ }
+}
+
+# Find default paper def in *all* definitions and generate config
+
+if ($opt_paper) {
+ for (@allpapersdefs) {
+ local(@paper) = @$_;
+ local($papername) = @paper;
+
+ if ($papername eq $opt_paper) {
+ genpaperdefs @paper;
+ last;
+ }
+ }
+}
+
+# Generate config for all selected paper sizes but the default one
+
+for (@defaultpaper, @papersdefs) {
+ local($papername) = @$_;
+
+ if ($papername eq $opt_paper) { next; }
+
+ genpaperdefs $_;
+}
+
diff --git a/Build/source/texk/dvipsk/contrib/configs/papersize.level2 b/Build/source/texk/dvipsk/contrib/configs/papersize.level2
new file mode 100644
index 00000000000..8d708facafa
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/papersize.level2
@@ -0,0 +1,236 @@
+% If your printer doesn't support setpagedevice, and your default paper
+% size is A4, uncomment this.
+%@ A4size 210mm 297mm
+%@+ %%PaperSize: A4
+
+% If you want the lettersize definition that uses setpagedevice to be
+% the default, comment this out.
+@ letterSize 8.5in 11in
+
+% More paper size information. First definition is the default.
+% These definitions were generated by the contrib/mkdvipspapers Perl 5 script,
+% by Yves.Arrouye@imag.fr.
+%
+% If your default is a4 put the a4 definition first (i.e., before the letter
+% definition). You should always keep a definition here in order to have the
+% document print on the desired paper if possible even outside your original
+% environment.
+%
+% If your default is something else than a4, of course, put its
+% definition first!
+
+@ letter 8.5in 11in
+@+ ! %%DocumentPaperSizes: Letter
+@+ %%PaperSize: Letter
+@+ %%BeginPaperSize: Letter
+@+ /setpagedevice where {
+@+ pop 1 dict dup /PageSize [ 612 792 ] put setpagedevice
+@+ } {
+@+ statusdict /lettertray known {
+@+ statusdict begin lettertray end
+@+ /letter where { pop letter } if
+@+ } {
+@+ /letter where {
+@+ pop letter
+@+ } {
+@+ statusdict /setpage known {
+@+ statusdict begin
+@+ 612 792 0 setpage
+@+ end
+@+ } if
+@+ } ifelse
+@+ } ifelse
+@+ } ifelse
+@+ %%EndPaperSize
+
+@ a4 210mm 297mm
+@+ ! %%DocumentPaperSizes: a4
+@+ %%PaperSize: a4
+@+ %%BeginPaperSize: a4
+@+ /setpagedevice where {
+@+ pop 1 dict dup /PageSize [ 595 842 ] put setpagedevice
+@+ } {
+@+ statusdict /a4tray known {
+@+ statusdict begin a4tray end
+@+ /a4 where { pop a4 } if
+@+ } {
+@+ /a4 where {
+@+ pop a4
+@+ } {
+@+ statusdict /setpage known {
+@+ statusdict begin
+@+ 595 842 0 setpage
+@+ end
+@+ } if
+@+ } ifelse
+@+ } ifelse
+@+ } ifelse
+@+ %%EndPaperSize
+
+@ 11x17 11in 17in
+@+ ! %%DocumentPaperSizes: 11x17
+@+ %%PaperSize: 11x17
+@+ %%BeginPaperSize: 11x17
+@+ /setpagedevice where {
+@+ pop 1 dict dup /PageSize [ 792 1224 ] put setpagedevice
+@+ } {
+@+ statusdict /11x17tray known {
+@+ statusdict begin 11x17tray end
+@+ /11x17 where { pop 11x17 } if
+@+ } {
+@+ /11x17 where {
+@+ pop 11x17
+@+ } {
+@+ statusdict /setpage known {
+@+ statusdict begin
+@+ 792 1224 0 setpage
+@+ end
+@+ } if
+@+ } ifelse
+@+ } ifelse
+@+ } ifelse
+@+ %%EndPaperSize
+
+@ a3 297mm 420mm
+@+ ! %%DocumentPaperSizes: a3
+@+ %%PaperSize: a3
+@+ %%BeginPaperSize: a3
+@+ /setpagedevice where {
+@+ pop 1 dict dup /PageSize [ 842 1190 ] put setpagedevice
+@+ } {
+@+ statusdict /a3tray known {
+@+ statusdict begin a3tray end
+@+ /a3 where { pop a3 } if
+@+ } {
+@+ /a3 where {
+@+ pop a3
+@+ } {
+@+ statusdict /setpage known {
+@+ statusdict begin
+@+ 842 1190 0 setpage
+@+ end
+@+ } if
+@+ } ifelse
+@+ } ifelse
+@+ } ifelse
+@+ %%EndPaperSize
+
+@ b5 177mm 250mm
+@+ ! %%DocumentPaperSizes: b5
+@+ %%PaperSize: b5
+@+ %%BeginPaperSize: b5
+@+ /setpagedevice where {
+@+ pop 1 dict dup /PageSize [ 502 709 ] put setpagedevice
+@+ } {
+@+ statusdict /b5tray known {
+@+ statusdict begin b5tray end
+@+ /ab5 where { pop ab5 } if
+@+ } {
+@+ /ab5 where {
+@+ pop ab5
+@+ } {
+@+ statusdict /setpage known {
+@+ statusdict begin
+@+ 502 709 0 setpage
+@+ end
+@+ } if
+@+ } ifelse
+@+ } ifelse
+@+ } ifelse
+@+ %%EndPaperSize
+
+@ ledger 11in 17in
+@+ ! %%DocumentPaperSizes: Ledger
+@+ %%PaperSize: Ledger
+@+ %%BeginPaperSize: Ledger
+@+ /setpagedevice where {
+@+ pop 1 dict dup /PageSize [ 792 1224 exch ] put setpagedevice
+@+ } {
+@+ statusdict /ledgertray known {
+@+ statusdict begin ledgertray end
+@+ /ledger where { pop ledger } if
+@+ } {
+@+ /ledger where {
+@+ pop ledger
+@+ } {
+@+ statusdict /setpage known {
+@+ statusdict begin
+@+ 792 1224 1 setpage
+@+ end
+@+ } if
+@+ } ifelse
+@+ } ifelse
+@+ } ifelse
+@+ %%EndPaperSize
+
+@ legal 8.5in 14in
+@+ ! %%DocumentPaperSizes: Legal
+@+ %%PaperSize: Legal
+@+ %%BeginPaperSize: Legal
+@+ /setpagedevice where {
+@+ pop 1 dict dup /PageSize [ 612 1008 ] put setpagedevice
+@+ } {
+@+ statusdict /legaltray known {
+@+ statusdict begin legaltray end
+@+ /legal where { pop legal } if
+@+ } {
+@+ /legal where {
+@+ pop legal
+@+ } {
+@+ statusdict /setpage known {
+@+ statusdict begin
+@+ 612 1008 0 setpage
+@+ end
+@+ } if
+@+ } ifelse
+@+ } ifelse
+@+ } ifelse
+@+ %%EndPaperSize
+
+@ note 7.5in 10in
+@+ ! %%DocumentPaperSizes: Note
+@+ %%PaperSize: Note
+@+ %%BeginPaperSize: Note
+@+ /setpagedevice where {
+@+ pop 1 dict dup /PageSize [ 540 720 ] put setpagedevice
+@+ } {
+@+ statusdict /notetray known {
+@+ statusdict begin notetray end
+@+ /note where { pop note } if
+@+ } {
+@+ /note where {
+@+ pop note
+@+ } {
+@+ statusdict /setpage known {
+@+ statusdict begin
+@+ 540 720 0 setpage
+@+ end
+@+ } if
+@+ } ifelse
+@+ } ifelse
+@+ } ifelse
+@+ %%EndPaperSize
+
+@ tabloid 11in 17in
+@+ ! %%DocumentPaperSizes: Tabloid
+@+ %%PaperSize: Tabloid
+@+ %%BeginPaperSize: Tabloid
+@+ /setpagedevice where {
+@+ pop 1 dict dup /PageSize [ 792 1224 ] put setpagedevice
+@+ } {
+@+ statusdict /11x17tray known {
+@+ statusdict begin 11x17tray end
+@+ /11x17 where { pop 11x17 } if
+@+ } {
+@+ /11x17 where {
+@+ pop 11x17
+@+ } {
+@+ statusdict /setpage known {
+@+ statusdict begin
+@+ 792 1224 0 setpage
+@+ end
+@+ } if
+@+ } ifelse
+@+ } ifelse
+@+ } ifelse
+@+ %%EndPaperSize
diff --git a/Build/source/texk/dvipsk/contrib/configs/papersize.simple b/Build/source/texk/dvipsk/contrib/configs/papersize.simple
new file mode 100644
index 00000000000..5112bdf40d4
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/papersize.simple
@@ -0,0 +1,44 @@
+* Paper size information. First definition is the default.
+*
+* If your default is a4 uncomment the following definition
+* and comment out the letterSize definition.
+*
+*@ A4size 210mm 297mm
+*@+ %%PaperSize: A4
+
+@ letterSize 8.5in 11in
+
+@ letter 8.5in 11in
+@+ %%BeginPaperSize: Letter
+@+ letter
+@+ %%EndPaperSize
+
+@ legal 8.5in 14in
+@+ ! %%DocumentPaperSizes: Legal
+@+ %%BeginPaperSize: Legal
+@+ legal
+@+ %%EndPaperSize
+
+@ ledger 17in 11in
+@+ ! %%DocumentPaperSizes: Ledger
+@+ %%BeginPaperSize: Ledger
+@+ ledger
+@+ %%EndPaperSize
+
+@ tabloid 11in 17in
+@+ ! %%DocumentPaperSizes: Tabloid
+@+ %%BeginPaperSize: Tabloid
+@+ 11x17
+@+ %%EndPaperSize
+
+@ A4 210mm 297mm
+@+ ! %%DocumentPaperSizes: A4
+@+ %%BeginPaperSize: A4
+@+ a4
+@+ %%EndPaperSize
+
+@ A3 297mm 420mm
+@+ ! %%DocumentPaperSizes: A3
+@+ %%BeginPaperSize: A3
+@+ a3
+@+ %%EndPaperSize
diff --git a/Build/source/texk/dvipsk/contrib/configs/prepipe.ps b/Build/source/texk/dvipsk/contrib/configs/prepipe.ps
new file mode 100644
index 00000000000..57b690963cd
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/prepipe.ps
@@ -0,0 +1 @@
+/showpage { 1 true .outputpage } def
diff --git a/Build/source/texk/dvipsk/contrib/configs/showpage.ps b/Build/source/texk/dvipsk/contrib/configs/showpage.ps
new file mode 100644
index 00000000000..97a4789f75d
--- /dev/null
+++ b/Build/source/texk/dvipsk/contrib/configs/showpage.ps
@@ -0,0 +1 @@
+showpage