summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/zwpagelayout
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/zwpagelayout
Initial commit
Diffstat (limited to 'macros/latex/contrib/zwpagelayout')
-rw-r--r--macros/latex/contrib/zwpagelayout/License.txt416
-rw-r--r--macros/latex/contrib/zwpagelayout/LoremIpsumDolor.tex55
-rw-r--r--macros/latex/contrib/zwpagelayout/README21
-rw-r--r--macros/latex/contrib/zwpagelayout/adjustfoot.pdfbin0 -> 88990 bytes
-rw-r--r--macros/latex/contrib/zwpagelayout/adjustfoot.tex16
-rw-r--r--macros/latex/contrib/zwpagelayout/adjusthead.pdfbin0 -> 88751 bytes
-rw-r--r--macros/latex/contrib/zwpagelayout/adjusthead.tex16
-rw-r--r--macros/latex/contrib/zwpagelayout/coversample.pdfbin0 -> 65922 bytes
-rw-r--r--macros/latex/contrib/zwpagelayout/coversample.tex26
-rw-r--r--macros/latex/contrib/zwpagelayout/zwpagelayout.pdfbin0 -> 471045 bytes
-rw-r--r--macros/latex/contrib/zwpagelayout/zwpagelayout.sty1067
-rw-r--r--macros/latex/contrib/zwpagelayout/zwpagelayout.tex1356
12 files changed, 2973 insertions, 0 deletions
diff --git a/macros/latex/contrib/zwpagelayout/License.txt b/macros/latex/contrib/zwpagelayout/License.txt
new file mode 100644
index 0000000000..90e5e3ab79
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/License.txt
@@ -0,0 +1,416 @@
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.3c 2006-05-20
+
+Copyright 1999 2002-2006 LaTeX3 Project
+ Everyone is allowed to distribute verbatim copies of this
+ license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the primary license under
+which the the LaTeX kernel and the base LaTeX packages are distributed.
+
+You may use this license for any work of which you hold the copyright
+and which you wish to distribute. This license may be particularly
+suitable if your work is TeX-related (such as a LaTeX package), but
+it is written in such a way that you can use it even if your work is
+unrelated to TeX.
+
+The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
+below, gives instructions, examples, and recommendations for authors
+who are considering distributing their works under this license.
+
+This license gives conditions under which a work may be distributed
+and modified, as well as conditions under which modified versions of
+that work may be distributed.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of your work
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+that work. If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex'
+and `modguide.tex' in the base LaTeX distribution for suggestions.
+
+
+DEFINITIONS
+===========
+
+In this license document the following terms are used:
+
+ `Work'
+ Any work being distributed under this License.
+
+ `Derived Work'
+ Any work that under any applicable law is derived from the Work.
+
+ `Modification'
+ Any procedure that produces a Derived Work under any applicable
+ law -- for example, the production of a file containing an
+ original file associated with the Work or a significant portion of
+ such a file, either verbatim or with modifications and/or
+ translated into another language.
+
+ `Modify'
+ To apply any procedure that produces a Derived Work under any
+ applicable law.
+
+ `Distribution'
+ Making copies of the Work available from one person to another, in
+ whole or in part. Distribution includes (but is not limited to)
+ making any electronic components of the Work accessible by
+ file transfer protocols such as FTP or HTTP or by shared file
+ systems such as Sun's Network File System (NFS).
+
+ `Compiled Work'
+ A version of the Work that has been processed into a form where it
+ is directly usable on a computer system. This processing may
+ include using installation facilities provided by the Work,
+ transformations of the Work, copying of components of the Work, or
+ other activities. Note that modification of any installation
+ facilities provided by the Work constitutes modification of the Work.
+
+ `Current Maintainer'
+ A person or persons nominated as such within the Work. If there is
+ no such explicit nomination then it is the `Copyright Holder' under
+ any applicable law.
+
+ `Base Interpreter'
+ A program or process that is normally needed for running or
+ interpreting a part or the whole of the Work.
+
+ A Base Interpreter may depend on external components but these
+ are not considered part of the Base Interpreter provided that each
+ external component clearly identifies itself whenever it is used
+ interactively. Unless explicitly specified when applying the
+ license to the Work, the only applicable Base Interpreter is a
+ `LaTeX-Format' or in the case of files belonging to the
+ `LaTeX-format' a program implementing the `TeX language'.
+
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+1. Activities other than distribution and/or modification of the Work
+are not covered by this license; they are outside its scope. In
+particular, the act of running the Work is not restricted and no
+requirements are made concerning any offers of support for the Work.
+
+2. You may distribute a complete, unmodified copy of the Work as you
+received it. Distribution of only part of the Work is considered
+modification of the Work, and no right to distribute such a Derived
+Work may be assumed under the terms of this clause.
+
+3. You may distribute a Compiled Work that has been generated from a
+complete, unmodified copy of the Work as distributed under Clause 2
+above, as long as that Compiled Work is distributed in such a way that
+the recipients may install the Compiled Work on their system exactly
+as it would have been installed if they generated a Compiled Work
+directly from the Work.
+
+4. If you are the Current Maintainer of the Work, you may, without
+restriction, modify the Work, thus creating a Derived Work. You may
+also distribute the Derived Work without restriction, including
+Compiled Works generated from the Derived Work. Derived Works
+distributed in this manner by the Current Maintainer are considered to
+be updated versions of the Work.
+
+5. If you are not the Current Maintainer of the Work, you may modify
+your copy of the Work, thus creating a Derived Work based on the Work,
+and compile this Derived Work, thus creating a Compiled Work based on
+the Derived Work.
+
+6. If you are not the Current Maintainer of the Work, you may
+distribute a Derived Work provided the following conditions are met
+for every component of the Work unless that component clearly states
+in the copyright notice that it is exempt from that condition. Only
+the Current Maintainer is allowed to add such statements of exemption
+to a component of the Work.
+
+ a. If a component of this Derived Work can be a direct replacement
+ for a component of the Work when that component is used with the
+ Base Interpreter, then, wherever this component of the Work
+ identifies itself to the user when used interactively with that
+ Base Interpreter, the replacement component of this Derived Work
+ clearly and unambiguously identifies itself as a modified version
+ of this component to the user when used interactively with that
+ Base Interpreter.
+
+ b. Every component of the Derived Work contains prominent notices
+ detailing the nature of the changes to that component, or a
+ prominent reference to another file that is distributed as part
+ of the Derived Work and that contains a complete and accurate log
+ of the changes.
+
+ c. No information in the Derived Work implies that any persons,
+ including (but not limited to) the authors of the original version
+ of the Work, provide any support, including (but not limited to)
+ the reporting and handling of errors, to recipients of the
+ Derived Work unless those persons have stated explicitly that
+ they do provide such support for the Derived Work.
+
+ d. You distribute at least one of the following with the Derived Work:
+
+ 1. A complete, unmodified copy of the Work;
+ if your distribution of a modified component is made by
+ offering access to copy the modified component from a
+ designated place, then offering equivalent access to copy
+ the Work from the same or some similar place meets this
+ condition, even though third parties are not compelled to
+ copy the Work along with the modified component;
+
+ 2. Information that is sufficient to obtain a complete,
+ unmodified copy of the Work.
+
+7. If you are not the Current Maintainer of the Work, you may
+distribute a Compiled Work generated from a Derived Work, as long as
+the Derived Work is distributed to all recipients of the Compiled
+Work, and as long as the conditions of Clause 6, above, are met with
+regard to the Derived Work.
+
+8. The conditions above are not intended to prohibit, and hence do not
+apply to, the modification, by any method, of any component so that it
+becomes identical to an updated version of that component of the Work as
+it is distributed by the Current Maintainer under Clause 4, above.
+
+9. Distribution of the Work or any Derived Work in an alternative
+format, where the Work or that Derived Work (in whole or in part) is
+then produced by applying some process to that format, does not relax or
+nullify any sections of this license as they pertain to the results of
+applying that process.
+
+10. a. A Derived Work may be distributed under a different license
+ provided that license itself honors the conditions listed in
+ Clause 6 above, in regard to the Work, though it does not have
+ to honor the rest of the conditions in this license.
+
+ b. If a Derived Work is distributed under a different license, that
+ Derived Work must provide sufficient documentation as part of
+ itself to allow each recipient of that Derived Work to honor the
+ restrictions in Clause 6 above, concerning changes from the Work.
+
+11. This license places no restrictions on works that are unrelated to
+the Work, nor does this license place any restrictions on aggregating
+such works with the Work by any means.
+
+12. Nothing in this license is intended to, or may be used to, prevent
+complete compliance by all parties with all applicable laws.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for the Work. Except when otherwise stated in
+writing, the Copyright Holder provides the Work `as is', without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for a
+particular purpose. The entire risk as to the quality and performance
+of the Work is with you. Should the Work prove defective, you assume
+the cost of all necessary servicing, repair, or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any author named in the components of the
+Work, or any other party who may distribute and/or modify the Work as
+permitted above, be liable to you for damages, including any general,
+special, incidental or consequential damages arising out of any use of
+the Work or out of inability to use the Work (including, but not limited
+to, loss of data, data being rendered inaccurate, or losses sustained by
+anyone as a result of any failure of the Work to operate with any other
+programs), even if the Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+MAINTENANCE OF THE WORK
+=======================
+
+The Work has the status `author-maintained' if the Copyright Holder
+explicitly and prominently states near the primary copyright notice in
+the Work that the Work can only be maintained by the Copyright Holder
+or simply that it is `author-maintained'.
+
+The Work has the status `maintained' if there is a Current Maintainer
+who has indicated in the Work that they are willing to receive error
+reports for the Work (for example, by supplying a valid e-mail
+address). It is not required for the Current Maintainer to acknowledge
+or act upon these error reports.
+
+The Work changes from status `maintained' to `unmaintained' if there
+is no Current Maintainer, or the person stated to be Current
+Maintainer of the work cannot be reached through the indicated means
+of communication for a period of six months, and there are no other
+significant signs of active maintenance.
+
+You can become the Current Maintainer of the Work by agreement with
+any existing Current Maintainer to take over this role.
+
+If the Work is unmaintained, you can become the Current Maintainer of
+the Work through the following steps:
+
+ 1. Make a reasonable attempt to trace the Current Maintainer (and
+ the Copyright Holder, if the two differ) through the means of
+ an Internet or similar search.
+
+ 2. If this search is successful, then enquire whether the Work
+ is still maintained.
+
+ a. If it is being maintained, then ask the Current Maintainer
+ to update their communication data within one month.
+
+ b. If the search is unsuccessful or no action to resume active
+ maintenance is taken by the Current Maintainer, then announce
+ within the pertinent community your intention to take over
+ maintenance. (If the Work is a LaTeX work, this could be
+ done, for example, by posting to comp.text.tex.)
+
+ 3a. If the Current Maintainer is reachable and agrees to pass
+ maintenance of the Work to you, then this takes effect
+ immediately upon announcement.
+
+ b. If the Current Maintainer is not reachable and the Copyright
+ Holder agrees that maintenance of the Work be passed to you,
+ then this takes effect immediately upon announcement.
+
+ 4. If you make an `intention announcement' as described in 2b. above
+ and after three months your intention is challenged neither by
+ the Current Maintainer nor by the Copyright Holder nor by other
+ people, then you may arrange for the Work to be changed so as
+ to name you as the (new) Current Maintainer.
+
+ 5. If the previously unreachable Current Maintainer becomes
+ reachable once more within three months of a change completed
+ under the terms of 3b) or 4), then that Current Maintainer must
+ become or remain the Current Maintainer upon request provided
+ they then update their communication data within one month.
+
+A change in the Current Maintainer does not, of itself, alter the fact
+that the Work is distributed under the LPPL license.
+
+If you become the Current Maintainer of the Work, you should
+immediately provide, within the Work, a prominent and unambiguous
+statement of your status as Current Maintainer. You should also
+announce your new status to the same pertinent community as
+in 2b) above.
+
+
+WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
+======================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+works under this license. These authors are addressed as `you' in
+this section.
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your work you want or need to use *distribution*
+conditions that differ significantly from those in this license, then
+do not refer to this license anywhere in your work but, instead,
+distribute your work under a different license. You may use the text
+of this license as a model for your own license, but your license
+should not refer to the LPPL or otherwise give the impression that
+your work is distributed under the LPPL.
+
+The document `modguide.tex' in the base LaTeX distribution explains
+the motivation behind the conditions of this license. It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate. Even if your work is
+unrelated to LaTeX, the discussion in `modguide.tex' may still be
+relevant, and authors intending to distribute their works under any
+license are encouraged to read it.
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a component of the Work, even for your own
+personal use, without also meeting the above conditions for
+distributing the modified component. While you might intend that such
+modifications will never be distributed, often this will happen by
+accident -- you may forget that you have modified that component; or
+it may not occur to you when allowing others to access the modified
+version that you are thus distributing it and violating the conditions
+of this license in ways that could have legal implications and, worse,
+cause problems for the community. It is therefore usually in your
+best interest to keep your copy of the Work identical with the public
+one. Many works provide ways to control the behavior of that work
+without altering any of its licensed components.
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the components of your work both
+an explicit copyright notice including your name and the year the work
+was authored and/or last substantially modified. Include also a
+statement that the distribution and/or modification of that
+component is constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+ %% pig.dtx
+ %% Copyright 2005 M. Y. Name
+ %
+ % This work may be distributed and/or modified under the
+ % conditions of the LaTeX Project Public License, either version 1.3
+ % of this license or (at your option) any later version.
+ % The latest version of this license is in
+ % http://www.latex-project.org/lppl.txt
+ % and version 1.3 or later is part of all distributions of LaTeX
+ % version 2005/12/01 or later.
+ %
+ % This work has the LPPL maintenance status `maintained'.
+ %
+ % The Current Maintainer of this work is M. Y. Name.
+ %
+ % This work consists of the files pig.dtx and pig.ins
+ % and the derived file pig.sty.
+
+Given such a notice and statement in a file, the conditions
+given in this license document would apply, with the `Work' referring
+to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
+generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
+referring to any `LaTeX-Format', and both `Copyright Holder' and
+`Current Maintainer' referring to the person `M. Y. Name'.
+
+If you do not want the Maintenance section of LPPL to apply to your
+Work, change `maintained' above into `author-maintained'.
+However, we recommend that you use `maintained', as the Maintenance
+section was added in order to ensure that your Work remains useful to
+the community even when you can no longer maintain and support it
+yourself.
+
+Derived Works That Are Not Replacements
+---------------------------------------
+
+Several clauses of the LPPL specify means to provide reliability and
+stability for the user community. They therefore concern themselves
+with the case that a Derived Work is intended to be used as a
+(compatible or incompatible) replacement of the original Work. If
+this is not the case (e.g., if a few lines of code are reused for a
+completely different task), then clauses 6b and 6d shall not apply.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes the Work
+
+ The LPPL requires that distributions of the Work contain all the
+ files of the Work. It is therefore important that you provide a
+ way for the licensee to determine which files constitute the Work.
+ This could, for example, be achieved by explicitly listing all the
+ files of the Work near the copyright notice of each file or by
+ using a line such as:
+
+ % This work consists of all files listed in manifest.txt.
+
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you
+ to comprise the Work and, in such a case, the licensee would be
+ entitled to make reasonable conjectures as to which files comprise
+ the Work.
+
diff --git a/macros/latex/contrib/zwpagelayout/LoremIpsumDolor.tex b/macros/latex/contrib/zwpagelayout/LoremIpsumDolor.tex
new file mode 100644
index 0000000000..91f3906d2e
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/LoremIpsumDolor.tex
@@ -0,0 +1,55 @@
+\language=-1 % no hyphenation in the sample text
+\tolerance 9999
+\hbadness 10000
+
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
+labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo
+dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
+amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
+invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et
+justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
+dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
+tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam
+et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem
+ipsum dolor sit amet.
+
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum
+dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit
+praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit
+amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna
+aliquam erat volutpat.
+
+Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut
+aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit
+esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et
+iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla
+facilisi.
+
+Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim
+placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam
+nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim
+veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo
+consequat.
+
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum
+dolore eu feugiat nulla facilisis. At vero eos et accusam et justo duo dolores et ea rebum. Stet
+clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
+amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
+aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
+clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
+amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos
+erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no
+rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor
+sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut laboreet dolore
+magna aliquyam erat.
+
+Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
+aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
+clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
+amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
+aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
+clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
+amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna
+aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
+clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
+
diff --git a/macros/latex/contrib/zwpagelayout/README b/macros/latex/contrib/zwpagelayout/README
new file mode 100644
index 0000000000..accc23f8a1
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/README
@@ -0,0 +1,21 @@
+=============================================================================
+Package: zwpagelayout Version 1.4c 13 Janyary 2013
+=============================================================================
+
+This package was developed as a typographers toolbox offering the most
+important features for everyday work. First it allows setting the paper size
+as well as the page layout. The next important feature is the ability of
+printing crop marks both with TeX + dvips or (x)dvipdfm(x) and with pdfTeX.
+Finally it is possible to reflect pages both horizontally and vertically.
+Partial PDF/X conformance is implemented and black overprint is enabled
+in pdfTeX, dvips, as well as (x)dvipdfm(x) drivers, i.e in XeLaTeX.
+
+Version 1.4c is a bug fix, the PDF boxes now properly work in the
+(x)dvipdfm(x) family of drivers.
+
+Version 1.4 implements black overprint for (x)dvipdfm(x) family of drivers,
+i.e. it now works also with XeLaTeX.
+
+The license of the package is LPPL.
+
+Author: Z. Wagner, http://icebearsoft.euweb.cz
diff --git a/macros/latex/contrib/zwpagelayout/adjustfoot.pdf b/macros/latex/contrib/zwpagelayout/adjustfoot.pdf
new file mode 100644
index 0000000000..ef284c605d
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/adjustfoot.pdf
Binary files differ
diff --git a/macros/latex/contrib/zwpagelayout/adjustfoot.tex b/macros/latex/contrib/zwpagelayout/adjustfoot.tex
new file mode 100644
index 0000000000..271723e490
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/adjustfoot.tex
@@ -0,0 +1,16 @@
+\documentclass{book}
+\usepackage{lmodern}
+\usepackage[T1]{fontenc}
+\usepackage[protrusion=false,expansion=true,stretch=8,shrink=24,step=4]{microtype}
+\makeatletter
+\renewcommand\normalsize{\@setfontsize\normalsize{8}{4mm}}\makeatother
+\small \normalsize
+\usepackage[c8,margins=6mm,headheight=4mm,headsep=4mm,
+ croplength=3mm,cropgap=2mm,
+ cropmarks,cropframe,croptitle=Adjust\ footskip]{zwpagelayout}
+
+\markboth{Sample page}{Sample page}
+
+\begin{document}
+\input{LoremIpsumDolor}
+\end{document}
diff --git a/macros/latex/contrib/zwpagelayout/adjusthead.pdf b/macros/latex/contrib/zwpagelayout/adjusthead.pdf
new file mode 100644
index 0000000000..98727f1f81
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/adjusthead.pdf
Binary files differ
diff --git a/macros/latex/contrib/zwpagelayout/adjusthead.tex b/macros/latex/contrib/zwpagelayout/adjusthead.tex
new file mode 100644
index 0000000000..17751435e2
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/adjusthead.tex
@@ -0,0 +1,16 @@
+\documentclass{book}
+\usepackage{lmodern}
+\usepackage[T1]{fontenc}
+\usepackage[protrusion=false,expansion=true,stretch=8,shrink=24,step=4]{microtype}
+\makeatletter
+\renewcommand\normalsize{\@setfontsize\normalsize{8}{4mm}}\makeatother
+\small \normalsize
+\usepackage[c8,margins=6mm,headheight=4mm,headsep=4mm,adjustheadsep,
+ croplength=3mm,cropgap=2mm,
+ cropmarks,cropframe,croptitle=Adjust\ headsep]{zwpagelayout}
+
+\markboth{Sample page}{Sample page}
+
+\begin{document}
+\input{LoremIpsumDolor}
+\end{document}
diff --git a/macros/latex/contrib/zwpagelayout/coversample.pdf b/macros/latex/contrib/zwpagelayout/coversample.pdf
new file mode 100644
index 0000000000..614b3124d1
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/coversample.pdf
Binary files differ
diff --git a/macros/latex/contrib/zwpagelayout/coversample.tex b/macros/latex/contrib/zwpagelayout/coversample.tex
new file mode 100644
index 0000000000..35ad4a3a08
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/coversample.tex
@@ -0,0 +1,26 @@
+\input utf8-t1 % conversion from UTF-8 to T1 by encTeX
+\documentclass{book}
+\usepackage[papersize={,80mm},topmargin=5mm,
+ botmargin,strictheight,
+ leftmargin=0mm,flap=40mm,textwidth=50mm,spine=8mm,
+ cropmarks,cropframe,croptitle=Cover]{zwpagelayout}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern,rotating}
+\pagestyle{empty}
+\parindent 0mm
+\def\thePageNumber{Designed by Zdeněk Wagner}
+\begin{document}
+\small
+\hbox to \textwidth{%
+ \vbox to \textheight{\hsize \CropFlap \centering
+ Back flap\vfill}\hss
+ \vbox to \textheight{\hsize \UserWidth \centering
+ Back cover\vfill \leavevmode ISBN+EAN}\hss
+ \vbox to \textheight{\hsize \CropSpine \centering
+ \vfill
+ \begin{sideways}Spine\end{sideways}\vfill}\hss
+ \vbox to \textheight{\hsize \UserWidth \centering
+ Front cover\vfill \LaTeX}\hss
+ \vbox to \textheight{\hsize \CropFlap \centering
+ Front flap\vfill}}
+\end{document}
diff --git a/macros/latex/contrib/zwpagelayout/zwpagelayout.pdf b/macros/latex/contrib/zwpagelayout/zwpagelayout.pdf
new file mode 100644
index 0000000000..73f1b92a91
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/zwpagelayout.pdf
Binary files differ
diff --git a/macros/latex/contrib/zwpagelayout/zwpagelayout.sty b/macros/latex/contrib/zwpagelayout/zwpagelayout.sty
new file mode 100644
index 0000000000..6dc256aa63
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/zwpagelayout.sty
@@ -0,0 +1,1067 @@
+\ProvidesPackage{zwpagelayout}[2013/01/13 ZW Page Layout]
+\PackageInfo{zwpagelayout}{$Id: zwpagelayout.sty 453 2013-01-13 17:12:17Z zw $\@gobble}
+
+%% Copyright 2008--2013 Z. Wagner, http://icebearsoft.euweb.cz
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is Z. Wagner.
+%
+% This work consists of the files: zwpagelayout.sty and
+% the documentation files zwpagelayout.tex, zwpagelayout.pdf together with
+% adjustfoot.tex, adjustfoot.pdf, adjusthead.tex, adjusthead.pdf,
+% coversample.tex, coversample.pdf, LoremIpsumDolor.tex.
+
+\@ifpackageloaded{ifpdf}{}{\IfFileExists{ifpdf.sty}{\RequirePackage{ifpdf}}{\newif\ifpdf}}
+\@ifpackageloaded{ifxetex}{}{\IfFileExists{ifxetex.sty}{\RequirePackage{ifxetex}}{\newif\ifxetex}}
+\RequirePackage{kvoptions}[2010/02/22]
+\SetupKeyvalOptions{family=zwpl,prefix=zwpl@}
+
+% Fix a problem with xkeyval
+
+\expandafter\ifx\csname kvsetkeys\endcsname\relax
+ \let\ZWsetkeys\setkeys
+\else
+ \let\ZWsetkeys\kvsetkeys
+\fi
+
+% Backslash character with catcode=12
+
+{\lccode`\!`\\ \lowercase{\gdef\PDFbkslash{!}}}
+
+% Percent character with catcode=12
+
+{\lccode`\!`\% \lowercase{\gdef\ZWpercent{!}}}
+
+% Driver selection macros and options
+
+\def\zwpl@useunknown{0}
+\def\zwpl@usepdftex{1}
+\def\zwpl@usexetex{2}
+\def\zwpl@usedvips{3}
+\let\zwpl@usedvipdfm\zwpl@usexetex
+\let\zwpl@usexdvipdfmx\zwpl@usexetex
+\let\zwpl@useother\zwpl@useunknown
+\newcount\zwpl@Driver
+\zwpl@Driver\ifpdf \zwpl@usepdftex \else \ifxetex \zwpl@usexetex \else \zwpl@usedvips \fi \fi
+\relax
+
+\DeclareStringOption{driver}
+
+% Landscape/Portrait
+
+\DeclareBoolOption{Landscape}
+\DeclareComplementaryOption{Portrait}{Landscape}
+\DeclareBoolOption{AllowWidthHeightSwitching}
+
+% Generic paper size, default=A4
+
+\DeclareStringOption[210mm,297mm]{papersize}[] % empty means to calculate
+
+% Normalized paper sizes
+
+\DeclareVoidOption{a0}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={841mm,1189mm}}}
+\DeclareVoidOption{a1}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={594mm,841mm}}}
+\DeclareVoidOption{a2}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={420mm,594mm}}}
+\DeclareVoidOption{a3}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={297mm,420mm}}}
+\DeclareVoidOption{a4}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={210mm,297mm}}}
+\DeclareVoidOption{a5}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={148mm,210mm}}}
+\DeclareVoidOption{a6}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={105mm,148mm}}}
+\DeclareVoidOption{a7}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={74mm,105mm}}}
+\DeclareVoidOption{a8}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={52mm,74mm}}}
+\DeclareVoidOption{a9}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={37mm,52mm}}}
+\DeclareVoidOption{a10}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={26mm,37mm}}}
+\DeclareVoidOption{b0}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={1000mm,1414mm}}}
+\DeclareVoidOption{b1}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={707mm,1000mm}}}
+\DeclareVoidOption{b2}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={500mm,707mm}}}
+\DeclareVoidOption{b3}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={353mm,500mm}}}
+\DeclareVoidOption{b4}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={250mm,353mm}}}
+\DeclareVoidOption{b5}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={176mm,250mm}}}
+\DeclareVoidOption{b6}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={125mm,176mm}}}
+\DeclareVoidOption{b7}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={88mm,125mm}}}
+\DeclareVoidOption{b8}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={62mm,88mm}}}
+\DeclareVoidOption{b9}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={44mm,62mm}}}
+\DeclareVoidOption{b10}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={31mm,44mm}}}
+\DeclareVoidOption{c0}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={917mm,1279mm}}}
+\DeclareVoidOption{c1}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={648mm,917mm}}}
+\DeclareVoidOption{c2}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={458mm,648mm}}}
+\DeclareVoidOption{c3}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={324mm,458mm}}}
+\DeclareVoidOption{c4}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={229mm,324mm}}}
+\DeclareVoidOption{c5}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={162mm,229mm}}}
+\DeclareVoidOption{c6}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={114mm,162mm}}}
+\DeclareVoidOption{c7}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={81mm,114mm}}}
+\DeclareVoidOption{c8}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={57mm,81mm}}}
+\DeclareVoidOption{c9}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={40mm,57mm}}}
+\DeclareVoidOption{c10}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={28mm,40mm}}}
+\DeclareVoidOption{letter}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={8.5in,11in}}}
+\DeclareVoidOption{legal}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={8.5in,14in}}}
+\DeclareVoidOption{executive}{\ZWsetkeys{zwpl}{AllowWidthHeightSwitching,papersize={7.25in,10.5in}}}
+
+% Layout (for the odd page, even page is mirrored)
+
+\DeclareStringOption{margins}[0mm]
+\DeclareStringOption[1in]{topmargin}
+\DeclareStringOption[-1in]{leftmargin}
+\DeclareStringOption[-1in]{rightmargin}
+\DeclareStringOption[-1in]{textwidth}
+\DeclareStringOption[-1in]{textheight} % height including a header, headsep, and footskip
+\DeclareStringOption[0mm]{headheight}
+\DeclareStringOption[0mm]{headsep}
+\DeclareStringOption[0mm]{footskip}
+\DeclareStringOption{topskip}
+\DeclareStringOption{botmargin}[\zwpl@topmargin]
+\DeclareBoolOption{strictheight}
+\DeclareBoolOption[true]{adjustfootskip}
+\DeclareComplementaryOption{adjustheadsep}{adjustfootskip}
+
+% Options for cropmarks
+
+\DeclareBoolOption{onlycropmarks}% Page layout is already set in a compatible way
+\DeclareBoolOption{cropmarks}
+\DeclareComplementaryOption{nocropmarks}{cropmarks}
+\DeclareStringOption[5mm]{croplength}
+\DeclareStringOption[5mm]{cropgap}
+\DeclareStringOption{spine}
+\DeclareStringOption{xspine}
+\DeclareStringOption{flap}
+\DeclareStringOption{xtrim}
+\DeclareStringOption{ytrim}
+\DeclareStringOption{trim}
+\DeclareBoolOption{cropframe}
+\DeclareComplementaryOption{nocropframe}{cropframe}
+\DeclareStringOption[default]{cropmarkstyle}
+\DeclareStringOption{croptitle}
+\DeclareStringOption[:\quad]{cropseparator}
+\DeclareBoolOption{pagenumberfirst}
+\DeclareComplementaryOption{pagenumberlast}{pagenumberfirst}
+\DeclareBoolOption[true]{usepagenumbers}
+\DeclareComplementaryOption{nopagenumbers}{usepagenumbers}
+%%%\DeclareStringOption[\fontsize{10}{10}]{cropfontsize}
+%%%\DeclareStringOption[\normalfont]{cropfont}
+\DeclareBoolOption{nobleedclip}
+\DeclareBoolOption{noBboxes}
+
+% Leaflet cropmarks (cropmarkstyle=leaflet)
+\DeclareStringOption[0mm]{foldcorr}% Ignored when fold=4 and fold=Z
+\DeclareStringOption[2]{fold}% Valid options: 2, 3left, 3right, 4, Z
+\DeclareStringOption[4]{leafcount}% For fold=Z only
+
+% Color support for cropmarks and black overprint
+\DeclareBoolOption{color}
+\DeclareStringOption[cmyk]{colormodel}
+\DeclareStringOption[1,1,1,1]{cropcolor}
+\DeclareStringOption[{CYAN:1,0,0,0},{MAGENTA:0,1,0,0},{*YELLOW:0,0,1,0},{BLACK:0,0,0,1}]{colors}
+\DeclareBoolOption{redefineblack}
+\DeclareBoolOption{redefinetocmyk}
+
+% Overprint support, it will automatically request color
+\DeclareBoolOption{overprint}
+
+% PDF information
+\DeclareStringOption[\zwpl@default@title]{title}[]
+\DeclareStringOption{author}
+\DeclareStringOption{subject}
+\DeclareStringOption{keywords}
+\DeclareVoidOption{nopdfinfo}{\ZWsetkeys{zwpl}{title}}
+
+\def\zwpl@default@title{\ifcat$\zwpl@croptitle$\jobname\else\zwpl@croptitle\fi}
+
+% PDF/X-1a support etc.
+\DeclareStringOption{pdfminorversion}
+\DeclareBoolOption{pdfx}
+\DeclareStringOption[Euroscale Coated v2]{OutputCondition}
+\DeclareStringOption[Euroscale Coated v2]{OutputConditionIdentifier}
+\DeclareStringOption{ICCfile}
+
+% Reflect, works with pdftex, (x)dvipdfm(x) aa well as dvips
+
+\def\zwpl@makeHreflect{\AtBeginDocument{\ifcaseZWdriver
+ \or
+ \let\zwpl@Hship\shipout
+ \def\shipout{\zwpl@Hreflect\zwpl@Hship}\zwpl@Hreflect
+ \or
+ \zwpl@XHreflect
+ \else\zwpl@psHreflect\fi}}
+
+\def\zwpl@makeVreflect{\AtBeginDocument{\ifcaseZWdriver
+ \or
+ \let\zwpl@Vship\shipout
+ \def\shipout{\zwpl@Vreflect\zwpl@Vship}\zwpl@Vreflect
+ \or
+ \zwpl@XVreflect
+ \else\zwpl@psVreflect\fi}}
+
+\DeclareVoidOption{ReflectHorizontally}{\zwpl@makeHreflect}
+\DeclareVoidOption{ReflectVertically}{\zwpl@makeVreflect}
+
+\ProcessKeyvalOptions*
+
+% Define the driver
+
+\ifcat$\zwpl@driver$ \else
+ \expandafter\ifx\csname zwpl@use\zwpl@driver\endcsname\relax
+ \PackageErrorNoLine{zwpagelayout}{Unsupported driver \zwpl@driver}
+ \else
+ \zwpl@Driver\csname zwpl@use\zwpl@driver\endcsname\relax
+ \fi
+\fi
+\def\ifcaseZWdriver{\ifcase\zwpl@Driver}
+\DeclareRobustCommand\ZWifdriver[2]{\expandafter\ifx\csname zwpl@use#1\endcsname\relax
+ \PackageWarningNoLine{zwpagelayout}{Driver #1 not recognized, code ignored}%
+ \else
+ \ifnum\csname zwpl@use#1\endcsname=\zwpl@Driver\relax #2\fi\fi}
+
+\PackageInfo{zwpagelayout}{Driver mode used:
+ \ifcaseZWdriver unknown\or pdftex\or xetex\else dvips\fi.\MessageBreak}
+
+% Define pdfmark if the RIP does not know it
+
+\ifnum\zwpl@Driver=\zwpl@usedvips
+ \special{!/pdfmark where {pop}{userdict /pdfmark /cleartomark load put} ifelse}
+\fi
+
+% Other packages
+
+\ifzwpl@onlycropmarks
+ \ZWsetkeys{zwpl}{cropmarks}
+\else
+
+% Set the paper size
+
+\def\zwpl@setpapersize#1,#2\zw@{\paperwidth\z@ \paperheight\z@
+ \ifcat$#1$\else \paperwidth#1 \fi
+ \ifcat$#2$\else \paperheight#2 \fi}
+
+\ifcat$\zwpl@papersize$
+ \zwpl@setpapersize,\zw@
+\else
+ \expandafter\zwpl@setpapersize\zwpl@papersize\zw@
+\fi
+
+\def\zwpl@switchpapdims{\@tempdima=\paperheight \paperheight=\paperwidth \paperwidth=\@tempdima}
+
+\ifzwpl@AllowWidthHeightSwitching
+ \ifzwpl@Landscape
+ \ifdim\paperheight>\paperwidth \zwpl@switchpapdims\fi
+ \else
+ \ifdim\paperheight<\paperwidth \zwpl@switchpapdims\fi
+ \fi
+\fi
+\fi % \ifzwpl@cropmarks
+
+% This part used always
+
+\let\ZWPL@XeTeXboxes\relax
+\AtBeginDocument{\ifcaseZWdriver \or
+ \pdfpagewidth\paperwidth \pdfpageheight\paperheight
+\else
+ \special{papersize=\the\paperwidth,\the\paperheight}\fi}
+
+\def\zwpl@setbpdim#1#2{\@tempdimc#2 \@tempdimc .99626\@tempdimc
+ \edef#1{\strip@pt\@tempdimc}}
+
+\def\zwpl@setboxex{\zwpl@setbpdim\zwpl@bleedorig\zwpl@croplength
+ \@tempdima\paperwidth \advance\@tempdima-\zwpl@croplength
+ \zwpl@setbpdim\zwpl@bleedwidth\@tempdima
+ \@tempdima\paperheight \advance\@tempdima-\zwpl@croplength
+ \zwpl@setbpdim\zwpl@bleedheight\@tempdima
+ \@tempdimb\zwpl@croplength \advance\@tempdimb\zwpl@cropgap
+ \zwpl@setbpdim\zwpl@trimorig\@tempdimb
+ \@tempdima\paperwidth \advance\@tempdima-\@tempdimb
+ \zwpl@setbpdim\zwpl@trimwidth\@tempdima
+ \@tempdima\paperheight \advance\@tempdima-\@tempdimb
+ \zwpl@setbpdim\zwpl@trimheight\@tempdima
+ \edef\zw@tmp{/BleedBox [\zwpl@bleedorig\space \zwpl@bleedorig\space
+ \zwpl@bleedwidth\space \zwpl@bleedheight]
+ /TrimBox [\zwpl@trimorig\space \zwpl@trimorig\space
+ \zwpl@trimwidth\space \zwpl@trimheight]
+ %/ArtBox [\zwpl@trimorig\space \zwpl@trimorig\space
+ %\zwpl@trimwidth\space \zwpl@trimheight]
+ }
+ \ifcaseZWdriver
+ \or
+ \expandafter\pdfpageattr\expandafter{\zw@tmp}
+ \or
+ \edef\ZWPL@XeTeXboxes{\noexpand\special{pdf:put @thispage <<\zw@tmp>>}}
+ \else
+ \special{! userdict begin
+ userdict /bop-hook known {/bop-hook load cvx /ZWBox-hook exch def} if
+ /bop-hook {
+ [/BleedBox [\zwpl@bleedorig\space \zwpl@bleedorig\space
+ \zwpl@bleedwidth\space \zwpl@bleedheight] /PAGE pdfmark
+ [/TrimBox [\zwpl@trimorig\space \zwpl@trimorig\space
+ \zwpl@trimwidth\space \zwpl@trimheight] /PAGE pdfmark
+ %[/ArtBox [\zwpl@trimorig\space \zwpl@trimorig\space
+ %\zwpl@trimwidth\space \zwpl@trimheight] /PAGE pdfmark
+ userdict /ZWBox-hook known {ZWBox-hook} if
+ } def
+ end}
+ \fi}
+
+\ifzwpl@cropmarks
+ \ifzwpl@noBboxes \else \AtBeginDocument{\zwpl@setboxex}\fi
+\fi
+
+\def\noBboxes{\def\zwpl@setboxex{}}
+\@onlypreamble\noBboxes
+
+% Two digits
+\def\zwpl@num#1{\ifnum #1<10 0\fi \the#1}
+
+% Date of TeXing in PDF format (without parentheses and D:)
+\def\SetTeXingDate#1{\xdef#1{\the\year\zwpl@num\month\zwpl@num\day}}
+\SetTeXingDate\DateOfTeXing
+
+% Time of TeXing, you can modify Date of TeXing by:
+% \edef\DateOfTeXing{\DateOfTeXing\TimeOfTeXing}
+\count@=\time \divide\count@ by 60
+\edef\@temp{\zwpl@num\count@}%
+\multiply\count@ by -60 \advance\count@ by \time
+\edef\TimeOfTeXing{\@temp\zwpl@num\count@}%
+
+% Default version of the modification date
+\def\zwpl@modt{(D:\DateOfTeXing\TimeOfTeXing)}
+
+% PDF info + PDF/X-1a
+\def\SetPDFminorversion#1{\ZWifdriver{pdftex}{\pdfminorversion#1 \relax}}
+\@onlypreamble\SetPDFminorversion
+
+\ifzwpl@pdfx
+ \ZWsetkeys{zwpl}{pdfminorversion=3}
+ \let\SetPDFminorversion\@gobble
+\fi
+
+\ifcat$\zwpl@pdfminorversion$ \else \ZWifdriver{pdftex}{\pdfminorversion3 \relax}\fi
+\def\zwpl@pdfxinfo{}
+\ifzwpl@pdfx
+ \def\zwpl@pdfxinfo{ /GTS_PDFXVersion (PDF/X-1:2001) /GTS_PDFXConformance (PDFX-1a:2001)}
+ \ifcat$\zwpl@ICCfile$ \else
+ \ifcase\zwpl@Driver
+ \or
+ \immediate\pdfobj stream attr{/N 4} file{\zwpl@ICCfile}
+ \edef\zwpl@iccobj{\the\pdflastobj}
+ \fi
+ \fi
+\fi
+
+\edef\zwpl@pdftitle{\zwpl@title}
+\ifcat$\zwpl@pdftitle$
+ \ifzwpl@pdfx
+ \ifcase\zwpl@Driver
+ \or
+ \pdfinfo{\zwpl@pdfinfo}
+ \or
+ \ifxetex \def\zwpl@crt{XeTeX}\else \def\zwpl@crt{TeX+dvipdfm}\fi
+ \edef\zwpl@pdfcrt{ /Creator (\zwpl@crt) }
+ \special{pdf:docinfo << \zwpl@pdfmoddate \zwpl@pdfcrt \zwpl@pdfxinfo >>}
+ \fi
+ \fi
+\else
+ \edef\zwpl@pdftitle{/Title (\zwpl@pdftitle)}
+ \ifcat$\zwpl@author$\def\zwpl@pdfauthor{}\else
+ \edef\zwpl@pdfauthor{ /Author (\zwpl@author)}\fi
+ \ifcat$\zwpl@subject$\def\zwpl@pdfsubject{}\else
+ \edef\zwpl@pdfsubject{ /Subject (\zwpl@subject)}\fi
+ \ifcat$\zwpl@keywords$\def\zwpl@pdfkeywords{}\else
+ \edef\zwpl@pdfkeywords{ /Keywords (\zwpl@keywords)}\fi
+ \edef\zwpl@pdfcreationdate{ /CreationDate \zwpl@modt}
+ \edef\zwpl@pdfmoddate{ /ModDate \zwpl@modt}
+ \ifcase\zwpl@Driver
+ \or
+ \pdfinfo{\zwpl@pdftitle \zwpl@pdfauthor \zwpl@pdfsubject \zwpl@pdfkeywords \zwpl@pdfxinfo}
+ \or
+ \ifxetex \def\zwpl@crt{XeTeX}\else \def\zwpl@crt{TeX+dvipdfm}\fi
+ \edef\zwpl@pdfcrt{ /Creator (\zwpl@crt) }
+ \special{pdf:docinfo << \zwpl@pdftitle \zwpl@pdfauthor \zwpl@pdfsubject \zwpl@pdfkeywords
+ \zwpl@pdfmoddate \zwpl@pdfcrt \zwpl@pdfxinfo >>}
+ \else
+ \def\zwpl@pdfcrt{ /Creator (TeX+dvips) }
+ \special{ps:[ \zwpl@pdftitle \zwpl@pdfauthor \zwpl@pdfsubject \zwpl@pdfkeywords
+ \zwpl@pdfcreationdate \zwpl@pdfmoddate \zwpl@pdfcrt /DOCINFO pdfmark}
+ \fi
+\fi
+
+% Catalog entry for PDF/X
+\ifzwpl@pdfx
+ \ifx\zwpl@iccobj\undefined
+ \def\zwpl@profile{}
+ \else
+ \def\zwpl@profile{ /DestOutputProfile \zwpl@iccobj\space 0 R}
+ \fi
+ \def\zwpl@catalog{/OutputIntents [ <<
+ /Type/OutputIntent
+ /S/GTS_PDFX
+ /OutputCondition (\zwpl@OutputCondition)
+ /OutputConditionIdentifier (\zwpl@OutputConditionIdentifier)
+ /RegistryName (http://www/color.org)\zwpl@profile
+ >> ]}
+ \ifcase\zwpl@Driver
+ \or
+ \pdfcatalog{\zwpl@catalog}
+ \or
+ \special{pdf: put @catalog <<\zwpl@catalog>>}
+ \fi
+\fi
+
+\ifzwpl@onlycropmarks \else % page layout disabled if only cropomarks requested
+
+% Page margins
+\ifcat$\zwpl@margins$ \else
+ \ZWsetkeys{zwpl}{topmargin=\zwpl@margins,botmargin,
+ leftmargin=\zwpl@margins,rightmargin=\zwpl@margins}
+\fi
+\topmargin\zwpl@topmargin
+\oddsidemargin\zwpl@leftmargin
+\evensidemargin\zwpl@rightmargin
+\textwidth\zwpl@textwidth
+\textheight\zwpl@textheight
+\headheight\zwpl@headheight
+\headsep\zwpl@headsep
+\footskip\zwpl@footskip
+\ifcat$\zwpl@topskip$\else
+ \topskip\zwpl@topskip
+\fi
+
+\ifcat$\zwpl@trim$ \else
+ \ZWsetkeys{zwpl}{xtrim=\zwpl@trim,ytrim=\zwpl@trim}
+\fi
+
+% Paper width
+\ifdim\paperwidth>\z@
+
+\ifdim\textwidth>\z@
+ \ifdim\oddsidemargin<\z@\else
+ \ifdim\evensidemargin<\z@\else
+ \textwidth -1in
+\fi \fi \fi
+
+\ifdim\textwidth>\z@
+ \ifdim\oddsidemargin<\z@
+ \ifdim\evensidemargin<\z@
+ \oddsidemargin\paperwidth
+ \advance\oddsidemargin-\textwidth
+ \divide\oddsidemargin 2
+ \evensidemargin\oddsidemargin
+ \else
+ \oddsidemargin\paperwidth
+ \advance\oddsidemargin -\textwidth
+ \advance\oddsidemargin -\evensidemargin
+ \fi
+ \else
+ \evensidemargin\paperwidth
+ \advance\evensidemargin -\textwidth
+ \advance\evensidemargin -\oddsidemargin
+ \fi
+\else
+ \ifdim\oddsidemargin<\z@
+ \ifdim\evensidemargin<\z@
+ \oddsidemargin\topmargin
+ \evensidemargin\topmargin
+ \else
+ \oddsidemargin\evensidemargin
+ \fi
+ \else
+ \ifdim\evensidemargin<\z@
+ \evensidemargin\oddsidemargin
+ \fi
+ \fi
+ \textwidth\paperwidth
+ \advance\textwidth -\oddsidemargin
+ \advance\textwidth -\evensidemargin
+\fi
+
+\else % calculate \paperwidth
+ % \textwidth is the page body text without a spine, xspine, flaps, trim
+ \ifcat$\zwpl@flap$\else \advance\textwidth\zwpl@flap \fi
+ \ifcat$\zwpl@spine$\else
+ % xspine ignored without spine
+ \ifcat$\zwpl@xspine$\else
+ \advance\textwidth\zwpl@xspine
+ \fi
+ \multiply\textwidth 2
+ \advance\textwidth\zwpl@spine
+ \fi
+ \ifcat$\zwpl@xtrim$\else
+ \@tempdima\zwpl@xtrim
+ \advance\textwidth 2\@tempdima
+ \fi
+ \ifdim\oddsidemargin<\z@
+ \ifdim\evensidemargin<\z@
+ \oddsidemargin\topmargin
+ \evensidemargin\topmargin
+ \else
+ \oddsidemargin\evensidemargin
+ \fi
+ \else
+ \ifdim\evensidemargin<\z@
+ \evensidemargin\oddsidemargin
+ \fi
+ \fi
+ \paperwidth\textwidth
+ \advance\paperwidth\oddsidemargin
+ \advance\paperwidth\evensidemargin
+\fi
+
+% Paper height
+\ifdim\paperheight>\z@
+
+\ifdim\textheight>\z@ \else
+ \ifcat$\zwpl@botmargin$
+ \ZWsetkeys{zwpl}{botmargin}
+ \fi
+\fi
+
+\ifcat$\zwpl@botmargin$\else
+ \textheight\paperheight
+ \advance\textheight -\topmargin
+ \advance\textheight -\zwpl@botmargin
+\fi
+
+\else % calculate \paperheight
+ \paperheight\topmargin
+ \ifcat$\zwpl@ytrim$\else
+ % add 2*ytrim to textheight
+ \@tempdima\zwpl@ytrim
+ \advance\textheight 2\@tempdima
+ \fi
+ \advance\paperheight\textheight
+ \ifcat$\zwpl@botmargin$ \else
+ \advance\paperheight\zwpl@botmargin
+ \fi
+\fi
+
+\small\normalsize
+
+\parskip\z@
+
+% Set \textheight
+\advance\textheight -\footskip
+\advance\textheight -\headheight
+\advance\textheight -\headsep
+\ifzwpl@strictheight\else
+ \ifzwpl@adjustfootskip
+ \advance\footskip \textheight
+ \else
+ \advance\headsep \textheight
+ \fi
+ \advance\textheight -\topskip
+ \divide\textheight by \baselineskip
+ \count@ \textheight
+ \textheight \count@\baselineskip
+ \advance\textheight \topskip
+ \ifzwpl@adjustfootskip
+ \advance\footskip -\textheight
+ \else
+ \advance\headsep -\textheight
+ \fi
+\fi
+\advance\topskip 100sp minus 500sp
+
+\advance\topmargin -1in
+\advance\oddsidemargin -1in
+\advance\evensidemargin -1in
+
+
+% \vskip multiple baselines hacked for emTeX
+
+\DeclareRobustCommand\vb{\begingroup \catcode`\-12 \catcode`\.12 \ZW@vb}
+\newcommand*\ZW@vb[1][1]{\endgroup\vspace{#1\ZW@baselineskip}}
+
+\newskip\ZW@baselineskip
+\def\set@ZW@baselineskip{\ZW@baselineskip \baselineskip
+ \advance\ZW@baselineskip 10sp minus 50sp }
+
+\AtBeginDocument{\set@ZW@baselineskip}
+
+% Correction \vskip
+
+\newcommand*\Vcorr{\vskip 10sp minus 50sp}
+
+% New odd/even page leaving an empty page of a specific style
+
+\def\NewOddPage{\@ifstar{\ZW@s@oddpage}{\ZW@oddpage}}
+\def\ZW@s@oddpage{\def\ZW@maybewarning{\PackageWarningNoLine{zwpagelayout}}\ZW@oddpage}
+\newcommand*\ZW@oddpage[1][empty]{\clearpage
+ \ifodd\c@page \else \thispagestyle{#1}\null\ZW@maybewarning{\ZW@oddwarning}\clearpage
+ \let\ZW@maybewarning\@gobble
+ \fi}
+
+\def\NewEvenPage{\@ifstar{\ZW@s@evenpage}{\ZW@evenpage}}
+\def\ZW@s@evenpage{\def\ZW@maybewarning{\PackageWarningNoLine{zwpagelayout}}\ZW@evenpage}
+\newcommand*\ZW@evenpage[1][empty]{\clearpage
+ \ifodd\c@page \thispagestyle{#1}\null\ZW@maybewarning{\ZW@evenwarning}\clearpage
+ \let\ZW@maybewarning\@gobble
+ \fi}
+
+\let\ZW@maybewarning\@gobble
+\def\SetOddPageMessage#{\gdef\ZW@oddwarning}
+\def\SetEvenPageMessage#{\gdef\Z@@evenwarning}
+\def\ZW@oddwarning{Empty page inserted}\let\ZW@evenwarning\ZW@oddwarning
+
+% End of page layout setting
+
+\fi % \ifzwpl@onlycropmarks ... \else ... \fi
+
+
+% User defined dimensions
+
+\def\CropFlap{\zwpl@flap}
+\def\CropSpine{\zwpl@spine}
+\def\CropXSpine{\zwpl@xspine}
+\def\CropXtrim{\zwpl@xtrim}
+\def\CropYtrim{\zwpl@ytrim}
+\def\UserWidth{\zwpl@textwidth}
+\def\UserLeftMargin{\zwpl@leftmargin}
+\def\UserRightMargin{\zwpl@rightmargin}
+\def\UserTopMargin{\zwpl@topmargin}
+\def\UserBotMargin{\zwpl@botmargin}
+
+% Handling color, needed in several cases
+\ifzwpl@redefinetocmyk \zwpl@redefineblacktrue \fi
+\def\zwpl@next{}
+\def\zwpl@reqclr{\def\zwpl@next{\RequirePackage{color}}}
+\expandafter\ifx\csname definecolor\endcsname\relax
+ \ifzwpl@color \zwpl@reqclr \fi
+ \ifzwpl@cropmarks \ifzwpl@nobleedclip \else \zwpl@reqclr \fi \fi
+ \ifzwpl@redefineblack \zwpl@reqclr \fi
+ \ifzwpl@overprint \zwpl@reqclr \fi
+\fi
+\zwpl@next
+\expandafter\ifx\csname definecolor\endcsname\relax \else
+ \definecolor{cmykblack}{cmyk}{0,0,0,1}
+ \definecolor{grblack}{gray}{0}
+ \ifzwpl@redefineblack
+ \definecolor{black}{cmyk}{0,0,0,1}\color{black}
+ \fi
+ \definecolor{cmykred}{cmyk}{0,1,1,0}
+ \definecolor{cmykgreen}{cmyk}{1,0,1,0}
+ \definecolor{cmykblue}{cmyk}{1,1,0,0}
+ \definecolor{rgbred}{rgb}{1,0,0}
+ \definecolor{rgbgreen}{rgb}{0,1,0}
+ \definecolor{rgbblue}{rgb}{0,0,1}
+ \ifzwpl@redefinetocmyk
+ \definecolor{red}{cmyk}{0,1,1,0}
+ \definecolor{green}{cmyk}{1,0,1,0}
+ \definecolor{blue}{cmyk}{1,1,0,0}
+ \fi
+\fi
+
+% Black overprint user macros
+\DeclareRobustCommand\SetOverprint{\zwpl@optrue \zwpl@setop \ignorespaces}
+\DeclareRobustCommand\SetKnockout{\zwpl@opfalse \zwpl@setop \ignorespaces}
+\DeclareRobustCommand\textoverprint[1]{{\SetOverprint#1}}
+\DeclareRobustCommand\textknockout[1]{{\SetKnockout#1}}
+
+% Black overprint implementation
+\let\zwpl@setop\relax
+\let\zwpl@resetop\relax
+\let\OverprintXeTeXExtGState\relax
+\newif\ifzwpl@op
+
+\ifzwpl@overprint
+\ifcase\zwpl@Driver
+\or % pdftex
+ \AtBeginDocument{%
+ \immediate\pdfobj{<< /Type /ExtGState /op false /OP false /OPM 0 >>}
+ \edef\op@off{\the\pdflastobj}
+ \immediate\pdfobj{<< /Type /ExtGState /op true /OP true /OPM 1 >>}
+ \edef\op@on{\the\pdflastobj}
+ \immediate\pdfobj{ << %
+ /GSko \op@off\space 0 R %
+ /GSop \op@on\space 0 R >>}
+ \edef\@extgs{\the\pdflastobj}
+ \edef\next{\global\noexpand\pdfpageresources={\the\pdfpageresources
+ \space /ExtGState \@extgs\space 0 R }}
+ \next
+ }
+ % macros for setting and resetting the overprint state
+ \def\zwpl@setop{\zwpl@resetop
+ \aftergroup\zwpl@resetop}
+ \def\zwpl@resetop{%
+ \ifzwpl@op
+ \pdfliteral direct {/GSop gs}%
+ \else
+ \pdfliteral direct {/GSko gs}%
+ \fi
+ }
+\or % xetex
+ \special{pdf: object @opoff << /Type /ExtGState /op false /OP false /OPM 0 >>}
+ \special{pdf: object @opon << /Type /ExtGState /op true /OP true /OPM 1 >>}
+ \special{pdf: object @extgs << /GSko @opoff /GSop @opon >>}
+ % macros for setting and resetting the overprint state
+ % (x)dvipdfm(x) requires setting ExtGState at each page where overprint
+ % is going to be used, done automatically if cropmarks are enabled
+ \def\OverprintXeTeXExtGState{\special{pdf: put @resources << /ExtGState @extgs >>}}
+ \def\zwpl@setop{\zwpl@resetop
+ \aftergroup\zwpl@resetop}
+ \def\zwpl@resetop{%
+ \ifzwpl@op
+ \special{pdf: code /GSop gs}%
+ \else
+ \special{pdf: code /GSko gs}%
+ \fi
+ }
+\else % dvips
+ \def\zwpl@setop{\zwpl@resetop
+ \aftergroup\zwpl@resetop}
+ \def\zwpl@resetop{%
+ \ifzwpl@op
+ \special{ps: true setoverprint}%
+ \else
+ \special{ps: false setoverprint}%
+ \fi
+ }
+\fi
+\SetKnockout
+\else
+ \def\zwpl@setop{\global\let\zwpl@setop\relax
+ \PackageWarningNoLine{zwpagelayout}{Use the "overprint" option to enable overprint.}}
+\fi
+
+
+
+% Handle cropmarks
+\newdimen\zwpl@low \zwpl@low 1in
+\advance\zwpl@low\topmargin
+\advance\zwpl@low \headheight
+\advance\zwpl@low \headsep
+\advance\zwpl@low \textheight
+\advance\zwpl@low \footskip
+\advance\zwpl@low -\paperheight
+
+\ifzwpl@cropmarks
+ \AtBeginDocument{\expandafter\ifx\csname cropmarkstyle@\zwpl@cropmarkstyle\endcsname\relax
+ \PackageWarningNoLine{zwpagelayout}{Unimplemented cropmarkstyle=\zwpl@cropmarkstyle}
+ \fi \csname cropmarkstyle@\zwpl@cropmarkstyle @setup\endcsname}
+ \let\zwpl@pagestyle\pagestyle
+ \let\zwpl@thispagestyle\thispagestyle
+ \def\pagestyle{\let\zwpl@next\zwpl@pagestyle \zwpl@testps}
+ \def\thispagestyle{\let\zwpl@next\zwpl@thispagestyle \zwpl@testps}
+\fi
+
+\def\zwpl@testps#1{\xdef\zw@pstyle{ZW\ZWpercent#1\ZWpercent}%
+ \@ifundefined{ps@#1}{\xdef\zw@reqstyle{empty}%
+ \PackageError{zwpagelayout}{Page style `#1' undefined, `empty' will be used.}}%
+ {\xdef\zw@reqstyle{#1}}%
+ \@ifundefined{ps@\zw@pstyle}{\zwpl@patchps{\zw@reqstyle}{\zw@pstyle}}{}\zwpl@next{\zw@pstyle}}
+
+\def\zwpl@patchps#1#2{\expandafter\gdef\csname ps@#2\endcsname{\csname ps@#1\endcsname \zwpl@patchfoot}}
+
+\def\zwpl@patchfoot{\let\zwpl@oddfoot\@oddfoot \let\zwpl@evenfoot\@evenfoot
+ \ifzwpl@overprint
+ \expandafter\ifx\csname OverprintXeTeXExtGState\endcsname\relax \else
+ \let\zwpl@oddhead\@oddhead \let\zwpl@evenhead\evenhead
+ \def\@oddhead{\OverprintXeTeXExtGState \zwpl@oddhead}%
+ \def\@evenhead{\OverprintXeTeXExtGState \zwpl@evenhead}%
+ \fi
+ \fi
+ \def\@oddfoot{\zwpl@cropbox\zwpl@oddfoot\zw@tinyfil}%
+ \def\@evenfoot{\zwpl@cropbox\zwpl@evenfoot\zw@tinyfil}}
+
+\def\zw@tinyfil{\tolerance\@M \hskip \z@ plus .00001fil \relax}
+
+% We must use the knockout mode in the cropmarks (added 2010-12-21)
+\def\zwpl@cropbox{{\globaldefs=0\relax \ifzwpl@overprint\SetKnockout\fi
+ \csname ZWPL@XeTeXboxes\endcsname
+ \rlap{% Some parameters may be changed within the document
+ \raisebox{\zwpl@low}[\z@][\z@]{\everyvbox{}\offinterlineskip\boxmaxdepth\z@
+ \hskip -\hoffset \hskip -1in \hskip -
+ \if@twoside \ifodd\c@page \oddsidemargin \else \evensidemargin \fi \else \oddsidemargin \fi
+ \vbox to \paperheight{\hsize\paperwidth \parindent\z@
+ \ifzwpl@nobleedclip\else
+ \begingroup \vbox to \z@{\color{white}\noindent
+ \rlap{\vbox to \paperheight{\hsize \paperwidth
+ \hrule width \hsize height \zwpl@croplength \vfill
+ \hrule width \hsize height \zwpl@croplength}}%
+ \rlap{\vbox to \paperheight{\hsize\paperwidth
+ \vrule width \zwpl@croplength height \paperheight
+ \hfill \vrule width \zwpl@croplength}}%
+ \vss}%
+ \endgroup
+ \fi
+ \ifzwpl@color
+ \edef\zwpl@temp{\noexpand\color[\zwpl@colormodel]{\zwpl@cropcolor}}\zwpl@temp
+ \fi
+ %%%\zwpl@cropfont \zwpl@cropfontsize \selectfont
+ \normalfont \fontsize{10}{10}\selectfont
+ \csname cropmarkstyle@\zwpl@cropmarkstyle\endcsname
+ }%
+}}}}
+
+\ifzwpl@cropmarks \zwpl@patchfoot \fi
+
+% General definitions for the crop marks
+\newdimen\zwpl@len \zwpl@len\zwpl@croplength
+\newdimen\zwpl@gap \zwpl@gap\zwpl@cropgap
+\newdimen\zwpl@plus \newdimen\zwpl@minus
+\zwpl@plus \zwpl@croplength
+\zwpl@plus .5\zwpl@plus
+\zwpl@minus -\zwpl@plus
+\advance\zwpl@plus .2pt
+\advance\zwpl@minus .2pt
+
+\newdimen\zwpl@frame \zwpl@frame\paperheight
+
+\ifzwpl@cropmarks
+ \hoffset \zwpl@croplength
+ \advance\hoffset \zwpl@gap
+ \voffset\hoffset
+ \advance\paperheight 2\voffset
+ \advance\paperwidth 2\hoffset
+\fi
+\advance\zwpl@low -\voffset
+
+\newdimen\zwpl@vsize
+\zwpl@vsize\paperheight
+\advance\zwpl@vsize -2\zwpl@croplength
+
+\def\clap#1{\hbox to \z@{\hss #1\hss}}
+\def\zwpl@cbox#1{\rlap{\hbox to \zwpl@croplength{\hss #1\hss}}}
+
+\def\zwpl@vert{\vrule height \zwpl@croplength depth \z@ width .4pt }
+\def\zwpl@horiz{\vrule height .2pt depth .2pt width \zwpl@croplength}
+\def\zwpl@choriz{\vrule height \zwpl@plus depth \zwpl@minus width \zwpl@croplength}
+\def\zwpl@cross{\zwpl@cbox{\zwpl@vert}\zwpl@choriz}
+\def\zwpl@frm{\clap{\vrule height \zwpl@frame depth \z@ width .4pt}}
+\def\zwpl@hh{\hbox to \hsize}
+\def\zwpl@hline{\zwpl@hh{\zwpl@horiz \hskip\zwpl@gap
+ \ifzwpl@cropframe
+ \leaders \vrule height .2pt depth .2pt \hfill
+ \else
+ \hfill
+ \fi
+ \hskip\zwpl@gap \zwpl@horiz}}
+
+\def\zwpl@cvert{\clap{\zwpl@vert}}
+
+% Vertical crop lines for the default style
+\newcommand*\zwpl@vline[1][]{%
+ \zwpl@hh{\zwpl@cross \hskip\zwpl@gap \clap{\zwpl@vert}%
+ \ifcat$\zwpl@xtrim$\else
+ \hskip\zwpl@xtrim \clap{\zwpl@vert}%
+ \fi
+ \ifcat$\zwpl@flap$\else
+ \hskip\zwpl@flap \clap{\zwpl@vert}%
+ \fi
+ \rlap{\hskip\zwpl@gap #1}%
+ \hss
+ \ifcat$\zwpl@spine$\else
+ \ifcat$\zwpl@xspine$\else
+ \clap{\zwpl@vert}\hskip\zwpl@xspine
+ \fi
+ \clap{\zwpl@vert}\hskip\zwpl@spine \clap{\zwpl@vert}%
+ \ifcat$\zwpl@xspine$\else
+ \hskip\zwpl@xspine \clap{\zwpl@vert}%
+ \fi
+ \hss
+ \ifcat$\zwpl@flap$\else
+ \clap{\zwpl@vert}\hskip\zwpl@flap
+ \fi
+ \fi
+ \ifcat$\zwpl@xtrim$\else
+ \clap{\zwpl@vert}\hskip\zwpl@xtrim
+ \fi
+ \clap{\zwpl@vert}\hskip\zwpl@gap \zwpl@cross}}
+
+% Default crop mark style
+\def\cropmarkstyle@default{%
+ \expandafter\zwpl@vline\ifzwpl@color[\zwpl@showallcolors]\fi
+ \vskip\zwpl@gap \zwpl@hline
+ \ifcat$\zwpl@ytrim$\else
+ \vskip\zwpl@ytrim \zwpl@hline
+ \fi
+ \vss
+ \ifzwpl@cropframe
+ \zwpl@hh{\hskip \hoffset \zwpl@frm
+ \ifcat$\zwpl@xtrim$\else
+ \hskip\zwpl@xtrim \zwpl@frm
+ \fi
+ \ifcat$\zwpl@flap$\else
+ \hskip\zwpl@flap \zwpl@frm
+ \fi
+ \hss
+ \ifcat$\zwpl@spine$\else
+ \ifcat$\zwpl@xspine$\else
+ \zwpl@frm \hskip\zwpl@xspine
+ \fi
+ \zwpl@frm \hskip\zwpl@spine \zwpl@frm
+ \ifcat$\zwpl@xspine$\else
+ \hskip\zwpl@xspine \zwpl@frm
+ \fi
+ \hss
+ \ifcat$\zwpl@flap$\else
+ \zwpl@frm \hskip\zwpl@flap
+ \fi
+ \fi
+ \ifcat$\zwpl@xtrim$\else
+ \zwpl@frm \hskip\zwpl@xtrim
+ \fi
+ \zwpl@frm \hskip \hoffset}\vss
+ \fi
+ \ifcat$\zwpl@ytrim$\else
+ \zwpl@hline \vskip\zwpl@ytrim
+ \fi
+ \zwpl@hline \vskip\zwpl@gap \zwpl@vline[\zwpl@printcroptitle]}
+
+% Leaflet style
+\def\zwpl@fold@use#1{\csname zwpl@fold@#1@leaf\endcsname}
+\def\zwpl@fold@def#{\expandafter\expandafter\expandafter\def\zwpl@fold@use}
+
+% We can do this because cropmark dimensions are set within a group
+\def\zwpl@switchskips{\let\zwpl@temp\zwpl@leftskip
+ \let\zwpl@leftskip\zwpl@rightskip
+ \let\zwpl@rightskip\zwpl@temp}
+
+\newif\ifzwpl@middle
+\def\zwpl@nofoldcorr{\def\zwpl@foldcorr{0mm}}
+
+% Leaflet initialization
+\zwpl@fold@def{2}{\def\zwpl@leafcount{2}%
+ \def\zwpl@leftskip{\hskip\zwpl@foldcorr}%
+ \def\zwpl@rightskip{}}
+\zwpl@fold@def{3left}{\def\zwpl@leafcount{3}%
+ \def\zwpl@leftskip{\hskip\zwpl@foldcorr}%
+ \def\zwpl@rightskip{}}
+\zwpl@fold@def{3right}{\zwpl@fold@use{3left}\zwpl@switchskips}
+\zwpl@fold@def{Z}{\def\zwpl@leftskip{}\let\zwpl@rightskip\zwpl@leftskip\zwpl@nofoldcorr}
+\zwpl@fold@def{4}{\zwpl@fold@use{Z}\def\zwpl@leafcount{4}\zwpl@middletrue}
+
+\def\cropmarkstyle@leaflet@setup{%
+ \expandafter\expandafter\expandafter\ifx\zwpl@fold@use{\zwpl@fold}\relax
+ \PackageWarningNoLine{zwpagelayout}{Unimplemented leaflet fold=\zwpl@fold.\MessageBreak
+ Leaflet crop marks will not be printed.}
+ \def\zwpl@cropmarkstyle{\ZWpercent}
+ \else
+ \zwpl@fold@use{\zwpl@fold}%
+ % Test the variables by assignments
+ \@tempskipa=\zwpl@foldcorr\relax
+ \count@=\zwpl@leafcount\relax
+ \fi
+}
+
+% vertical crop lines for a leaflet
+\newcommand*\zwpl@vleaf[1][]{%
+ \zwpl@hh{\zwpl@cross \hskip\zwpl@gap \zwpl@cvert
+ \rlap{\hskip\zwpl@gap #1}\zwpl@leftskip
+ \count@=1
+ \loop
+ \hfil
+ \ifzwpl@middle
+ \ifnum\count@>1
+ \zwpl@middlefalse
+ \else
+ \zwpl@cvert
+ \fi
+ \else
+ \zwpl@cvert
+ \fi
+ \advance\count@ 1
+ \ifnum\count@<\zwpl@leafcount \repeat
+ \hfil \zwpl@rightskip
+ \zwpl@cvert\hskip\zwpl@gap \zwpl@cross}}
+
+% Crop marks for a leaflet
+\def\cropmarkstyle@leaflet{%
+ \if@twoside \ifodd\c@page \else \zwpl@switchskips \fi \fi
+ \expandafter\zwpl@vleaf\ifzwpl@color[\zwpl@showallcolors]\fi
+ \vskip\zwpl@gap \zwpl@hline
+ \vss
+ \ifzwpl@cropframe
+ \zwpl@hh{\hskip \hoffset \zwpl@frm \zwpl@leftskip
+ \count@=1
+ \loop
+ \hfil \zwpl@frm
+ \advance\count@ 1
+ \ifnum\count@<\zwpl@leafcount \repeat
+ \hfil \zwpl@rightskip
+ \zwpl@frm \hskip \hoffset}\vss
+ \fi
+ \zwpl@hline \vskip\zwpl@gap \zwpl@vleaf[\zwpl@printcroptitle]}
+
+% Print the crop title
+\def\zwpl@printcroptitle{\raisebox{.8ex}[\z@][\z@]{\ifzwpl@usepagenumbers
+ \ifzwpl@pagenumberfirst
+ \thePageNumber
+ \ifcat$\zwpl@croptitle$\else
+ \zwpl@cropseparator \zwpl@croptitle
+ \fi
+ \else
+ \ifcat$\zwpl@croptitle$\else
+ \zwpl@croptitle \zwpl@cropseparator
+ \fi
+ \thePageNumber
+ \fi
+\else
+ \ifcat$zwpl@croptitle$\else
+ \zwpl@croptitle
+ \fi
+\fi}}
+
+\def\thePageNumber{\#\,\arabic{page}}
+
+\def\zwpl@xprintcolor{\@ifstar\zwpl@s@printcolor\zwpl@printcolor}
+
+\def\zwpl@printcolor#1:#2:{\edef\zwpl@temp{\noexpand\textcolor[\zwpl@colormodel]{#2}{#1}}\zwpl@temp\space}
+
+\def\zwpl@s@printcolor#1:#2:{\bgroup
+ \setbox\@tempboxa=\hbox{\space \ignorespaces #1 \unskip \space}\@tempdima=\wd\@tempboxa
+ \@tempdimb=\ht\@tempboxa \advance\@tempdimb .5pt
+ \@tempdimc=\dp\@tempboxa \advance\@tempdimc .5pt
+ \edef\zwpl@temp{\noexpand\textcolor[\zwpl@colormodel]{#2}{\rlap{\vrule
+ width \@tempdima height \@tempdimb depth \@tempdimc}}}\zwpl@temp
+ \color{white}\box\@tempboxa \egroup \space}
+
+\def\zwpl@showcolors#1,#2*{\zwpl@xprintcolor#1:%
+ \ifcat$#2$\let\zwpl@next\relax
+ \else\def\zwpl@next{\zwpl@showcolors#2*}\fi \zwpl@next}
+
+\def\zwpl@showallcolors{\raisebox{.25ex}[\z@][\z@]{\expandafter\zwpl@showcolors\zwpl@colors,*}}
+
+% Reflect (should be at the end of the package)
+
+\newcount\zwpl@Hshift
+\newcount\zwpl@Vshift
+
+% shift calculation
+\def\zwpl@calcshift#1#2{#1#2
+ \divide #1 8
+ \multiply #1 5
+ \divide #1 8
+ \multiply #1 5
+ \divide #1 25696 }
+
+% pdftex version
+\def\zwpl@Hreflect{\zwpl@calcshift\zwpl@Hshift\hsize
+ \pdfliteral{-1 0 0 1 \the\zwpl@Hshift\space 0 cm}}
+
+\def\zwpl@Vreflect{\@tempdima\vsize
+ \advance\@tempdima-\topmargin
+ \zwpl@calcshift\zwpl@Vshift\@tempdima
+ \pdfliteral{1 0 0 -1 0 -\the\zwpl@Vshift\space cm}}
+
+% (x)dvipdfm(x) version, modifies bop and eop
+\def\zwpl@XHreflect{\zwpl@calcshift\zwpl@Hshift\paperwidth
+ \special{pdf: bop q -1 0 0 1 \the\zwpl@Hshift\space 0 cm}\special{pdf: eop Q}}
+
+\def\zwpl@XVreflect{\zwpl@calcshift\zwpl@Vshift\paperheight
+ \special{pdf: bop q 1 0 0 -1 0 \the\zwpl@Vshift\space cm}\space{pdf: eop Q}}
+
+% dvips version (modifies bop-hook)
+\def\zwpl@psreflect#1#2#3#4{\zwpl@calcshift#3#4
+ \special{! userdict begin
+ userdict /bop-hook known {/bop-hook load cvx /ZW#1-hook exch def} if
+ /bop-hook {
+ [#2] concat
+ userdict /ZW#1-hook known {ZW#1-hook} if
+ } def end}}
+
+\def\zwpl@psHreflect{\zwpl@psreflect H{-1 0 0 1 \the\zwpl@Hshift\space 0}\zwpl@Hshift\paperwidth}
+\def\zwpl@psVreflect{\zwpl@psreflect V{1 0 0 -1 0 \the\zwpl@Vshift}\zwpl@Vshift\paperheight}
diff --git a/macros/latex/contrib/zwpagelayout/zwpagelayout.tex b/macros/latex/contrib/zwpagelayout/zwpagelayout.tex
new file mode 100644
index 0000000000..460e3805bc
--- /dev/null
+++ b/macros/latex/contrib/zwpagelayout/zwpagelayout.tex
@@ -0,0 +1,1356 @@
+%% $Id: zwpagelayout.tex 454 2013-01-13 18:30:27Z zw $
+\input utf8-t1 % encTeX required
+\documentclass[11pt]{article}
+\usepackage{zwgetfdate}
+\usepackage[footskip=30pt,topmargin=2cm,leftmargin=15mm,rightmargin=55mm,botmargin,nopdfinfo]{zwpagelayout}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern,array,dcolumn,verbatim,graphicx}
+\usepackage[figuresright]{rotating}
+\usepackage[protrusion=false,expansion=true,stretch=8,shrink=24,step=4]{microtype}
+\makeatletter
+\renewcommand*\l@section{\@dottedtocline{1}{\z@}{1.5em}}
+\makeatother
+\extrarowheight 2pt
+\mubytein 0 % important due to bug in url.sty
+\usepackage[pdftitle=Page\ Layout\ with\ Crop\ Marks, pdfauthor=Zdenek\ Wagner,
+ pdfkeywords={page layout,\ crop marks},
+ bookmarks,bookmarksopen,bookmarksopenlevel=2]{hyperref}
+\mubytein 1 \mubyteout 1 \mubytelog 1
+
+\marginparwidth\UserRightMargin
+\advance\marginparwidth -1cm
+\advance\marginparwidth-\marginparsep
+
+\def\mg#1{\ifvmode\leavevmode\fi\marginpar{\texttt{#1}}\ignorespaces}
+\def\cmg#1{\mg{\char`\\#1}}
+\def\omg#1{\ifvmode\leavevmode\fi\marginpar{\raggedright\hspace{0pt}\opt{#1}}\ignorespaces}
+\def\opt#1{\texorpdfstring{\textmd{\textsc{#1}}}{#1}}
+\let\pkg\textsc
+\DeclareRobustCommand\cmd[1]{\texttt{\char`\\#1}}
+\def\ie.{i.\,e.\@}
+\def\eg.{e.\,g.\@}
+\def\true{\bool{true}}
+\def\false{\bool{false}}
+\def\bool#1{\texorpdfstring{\textit{#1}}{#1}}
+\def\is{\unskip\nobreak\space =\penalty200 \space\ignorespaces}
+
+\DeclareRobustCommand\XeTeX{X\kern-.125em\lower.5ex\hbox{\csname
+ reflectbox\endcsname{E}}\kern-.1667em\TeX}
+\DeclareRobustCommand\XeLaTeX{X\kern-.125em\lower.5ex\hbox{\csname
+ reflectbox\endcsname{E}}\LaTeX}
+
+\makeatletter
+\newcommand*\papdims[2][.]{\bgroup
+ \def\zw@papdim##1,##2\zw@{\sepunit{##1}#1\sepunit{##2}}%
+ \setkeys{zwpl}{#2}%
+ \expandafter\zw@papdim\zwpl@papersize\zw@\egroup}
+
+\newcommand*\sepunit[2][\,]{\def\zw@a{}\def\zw@x{#1}\def\zw@y{}\def\zw@z{}\zw@sepunit#2\zw@}
+\def\zw@sepunit#1{\ifx#1\zw@
+ \let\next\zw@sep@finished
+ \else
+ \edef\zw@a{\zw@a\zw@y}\edef\zw@y{\zw@z}\edef\zw@z{#1}\let\next\zw@sepunit
+ \fi \next}
+\def\zw@sep@finished{\zw@a\zw@x\mbox{\zw@y\zw@z}}
+\makeatother
+
+\def\krat{\,\ensuremath{\times}\,}
+
+\newcolumntype{x}{D{.}{\krat}{-1}}
+\def\xx#{\multicolumn{1}{c|}}
+
+\let\zwcomma\,
+\def\,{\texorpdfstring{\zwcomma}{}}
+
+\clubpenalty10000
+\widowpenalty10000
+
+\begin{document}
+\hyphenation{post-script ghost-script allow-with-height-switching Output-Condition Output-Condition-Identifier}
+
+\title{Page Layout with Crop Marks}
+\author{Zdeněk Wagner\\\url{http://icebearsoft.euweb.cz}}
+\date{Package date: \DateOfPackage{zwpagelayout}}
+\maketitle
+
+\begin{abstract}\noindent
+This package was developed as a typographers toolbox offering the most important features for
+everyday work. First it allows setting the paper size as well as the page layout. The next
+important feature is the ability of printing crop marks both with \TeX~+~dvips or (x)dvipdfm(x) and with pdf\TeX.
+Finally it is possible to reflect pages both horizontally and vertically, select black overprint
+and set various PDF/X features.
+\end{abstract}
+
+\tableofcontents
+
+\section{Introduction}
+Users will probably ask: ``Why another page layout package? Is not \pkg{geometry} all what we
+need?'' The answer to this question is not easy. The \pkg{geometry} package provides a lot of
+features, maybe even too many features. However, some features are missing. Packages for crop marks
+can also be found but correct positioning of the crop marks requires cooperation with the
+page layout package. It is therefore natural to integrate both these functions into a single
+package.
+
+The package is useful also for preparation of book covers. It places the marks showing the position
+of a spine and optionally flaps. If you want to see whether the spine and the front and back cover
+contents are properly aligned, you can display the frames. Moreover, it is often necessary to
+create a proof of the cover while the book is not yet finished and the thickness of the spine is
+not known and can be only approximated. You can thus leave the paper width empty and the package
+will calculate it from the page width, the flap width and the spine thickness. Whenever the final
+value of the spine thickness is known, you change it in the list of options and the whole layout
+will adapt automatically.
+
+The files usually fail to meet PDF/X conformance due to silly reasons. It is always mandatory to
+set the title, creation date and modification date in any PDF file. It can be done by the
+\pkg{hyperref} package. However, \pkg{hyperref} is a complex package that may cause clashes with
+other packages. We do not want to kill ants by cannon balls, therefore we do simple things by simple
+means. Options for partial PDF/X conformance were added but may be switched off if a user wishes to
+use \pkg{hyperref}.
+
+The package is a result of a long-term development inspired by author's everyday needs. It is a
+collection of macros that were manually copied from document to document, later placed into private
+packages and finally it matured into a package prepared for general use.
+
+Being a result of development it may happen that you may be in the same situation in which I was
+myself. The book was finished and the last task was to add the crop marks. Removing layout
+definition from a document and replacing it with a different package may cause errors and one more
+proof-reading is time consuming and expensive. This package therefore allows the page layout logic
+to be switched off and just add the crop marks provided the paper dimensions are correctly
+supplied. The details will be explained later when describing the package options.
+
+\section{Package dependence}
+As written in the introduction, the goal was to implement as much within this single package in
+order to reduce the risk of clashes. Yet a few packages may be loaded. The package needs to know
+what engine is being used. For this purpose the \pkg{ifxetex} and \pkg{ifpdf} packages are used. If
+any of these packages is not found, it is assumed that the corresponding engine is not available.
+No error is reported. The color support requires the \pkg{color} package. It is loaded only if the
+color support is requested. The algorithm for deciding when the package is needed will be described
+in detail in section~\ref{color}.
+
+Option setting is implemented via the \pkg{kvoptions} package which in turn loads the \pkg{keyval}
+package. These packages should be available in any nowaday's \TeX\ distribution.
+
+\section{Usage}
+The package is loaded simply by:
+
+\vb
+\verb;\usepackage[;$\langle$options$\rangle$\verb;]{zwpagelayout};
+
+\vb\noindent
+Remember that the options cannot be given later, all of them must be present either here or as
+options to the \cmd{documentclass} command. The package will set some dimensions based upon
+\cmd{normalsize}. The package that modifies font sizes must therefore be loaded before
+\pkg{zwpagelayout}.
+
+\section{Option values}
+
+Some options accept a value. If the option is not specified, it may have a \textbf{default} value. For ease of use an
+option may be given without a value. It will then have a \textbf{standard} value. The default and standard
+values will be given in the option description.
+
+The option value may sometimes contain spaces and commas. However, commas are used to separate
+options, and during parsing the spaces are ignored. The spaces must therefore be preceded by a
+backslash and an option value containing commas must be enclosed in braces, for example:
+
+\vb
+\begin{verbatim}
+\usepackage[a4,subject=Some\ subject,
+ keywords={keyword\ 1,\ keyword\ 2}]{zwpagelayout}
+\end{verbatim}
+
+\section{Driver selection}\label{driver.selection}
+The driver is usually selected automatically. The package makes use of the \pkg{ifxetex} and
+\pkg{ifpdf} packages to detect either \XeTeX\ or pdftex. If none of them is detected, dvips is
+assumed.
+
+\omg{driver}
+It may sometimes be necessary to set the driver manually by giving the \opt{driver} option. This
+option recognizes drivers \texttt{unknown}, \texttt{pdftex}, \texttt{xetex}, and \texttt{dvips}. In
+addition \texttt{other} is an alias to \texttt{unknown}, \texttt{dvipdfm} and \texttt{xdvipdfmx}
+are aliases to \texttt{xetex}.
+
+The package shows the driver in the log file. If the driver is set to \texttt{unknown}, all driver
+specific features will be disabled.
+
+\section{Paper size and orientation}
+The first task of the package is to define paper size and orientation. Remember that the package is
+intended for use in real life where we cannot be limitted to standard papers sizes. However, the
+standard paper sizes are used quite often and we must be able to use them too. The options were
+tested with pdf\TeX, \pkg{dvips} as well as \pkg{(x)dvipdfm(x)}.
+
+\subsection{Orientation}\label{orientation}
+\omg{AllowWidthHeightSwitching}
+The package usually accepts the dimentsions as they are, \ie. width and height of the page. The
+orientation cannot be changed. If you wish to have the possibility to change the orientation, you
+have to use this option. It is used automatically with all standard paper sizes (see
+section~\ref{standard}). You will rarely specify it yourself.
+
+\omg{Portrait}\omg{Landscape}
+These options sets the paper orientation, \opt{Portrait} is the default. They can be used only if
+\opt{AllowWidthHeightSwitching} was specified, otherwise they are ignored.
+
+\subsection{Paper size}
+The package option defines the trimmed paper size. If the crop marks are added, the real paper size
+will be added. Dimensions \cmd{paperwidth} and \cmd{paperheight} will thus contain the values that
+will subsequently be sent to the driver. If you for any reason wish to know the trimmed dimensions,
+you can calculate them as follows:
+
+\begin{center}
+trimmed width = \cmd{paperwidth} -- 2\cmd{hoffset}
+
+trimmed height = \cmd{paperheight} -- 2\cmd{voffset}
+\end{center}
+
+\subsubsection{Generic paper size}
+\omg{papersize}
+Option \opt{papersize} is used to define arbitrary paper size. You define it as a pair of two
+dimensions, the width and the height. The numbers are separated by a comma, therefore the
+specification must be enclosed within braces, \eg.
+
+\begin{verbatim}
+\usepackage[papersize={200mm,100mm}]{zwpagelayout}
+\end{verbatim}
+
+The above written command sets the paper width to 200\,mm and the paper height to 100\,mm, \ie. the
+paper orientation will be landscape. Now consider the following:
+
+\begin{verbatim}
+\usepackage[papersize={200mm,100mm},
+ AllowWidthHeightSwitching]{zwpagelayout}
+\end{verbatim}
+
+Since the width/height switching is allowed and the default orientation is portrait (option
+\opt{Portrait} is the default), the width will be 100\,mm and the height will be 200\,mm.
+
+You can achieve the same result as the first command by the lengthy code:
+
+\begin{verbatim}
+\usepackage[papersize={200mm,100mm},
+ AllowWidthHeightSwitching,Landscape]{zwpagelayout}
+\end{verbatim}
+
+You see that the command may become confusing. You should better not use
+\opt{AllowWidthHeightSwitching} together with \opt{papersize}.
+
+If the \opt{papersize} option is not used, it defaults to the A4 size, \ie. to paper dimensions \papdims[\krat]{a4}.
+
+If the book cover is being typeset, we want to calculate at least the width. The detailed
+explanation will be given in section~\ref{missing}. Here we put just as an example:
+
+\begin{verbatim}
+\usepackage[papersize={,200mm},spine=15mm,textwidth=14cm,
+ margins]{zwpagelayout}
+\end{verbatim}
+
+It is even possible to calculate both dimensions using \eg.
+
+\begin{verbatim}
+\usepackage[papersize,spine=15mm,textwidth=14cm,textheight=20cm,
+ margins]{zwpagelayout}
+\end{verbatim}
+
+\subsubsection{Standard paper sizes}\label{standard}
+\omg{a0\,\ldots\,c10}\omg{executive}\omg{legal}\omg{letter}
+Options \opt{a0}\ldots\opt{a10}, \opt{b0}\ldots\opt{b10}, \opt{c0}\ldots\opt{c10} are used to
+select paper size according to the A, B or C series where the dimensions are rounded to integers in
+milimeters. For instance, the A6 size is \papdims[\krat]{a6}. The package also supports paper sizes
+\opt{executive} (\papdims[\krat]{executive}), \opt{legal} (\papdims[\krat]{legal}), and
+\opt{letter} (\papdims[\krat]{letter}). If one of these options is used,
+\opt{AllowWidthHeightSwitching} and \opt{Portrait} are assumed. The page orientation may be
+switched by option \opt{Landscape} (see section~\ref{orientation}).
+
+\subsection{Page bounding boxes}\label{Bboxes}
+The drivers usually set MediaBox to the physical size of the page. If cropmarks are requested (see
+section~\ref{cropmarks}), the package sets also BleedBox and TrimBox, ArtBox is explicitely
+forbidden by PDF/X. CropBox is
+intentionally unset since it causes cropped display in Adobe Reader. Since page size setting is
+delayed, MediaBox contains the whole page including the area for the cropmarks. MediaBox is
+calculated by the driver, the other boxes are calculated by \TeX. Their dimensions are therefore
+not exact because \TeX\ does not use floating point arithmetic. The difference is negligible.
+
+\omg{noBboxes}
+Option \opt{noBboxes} disables setting the above mentioned boxes. Currently there is a known bug
+causing fatal error in Adobe Distiller if these boxes are set.
+
+\cmg{noBboxes}
+Macro \cmd{noBboxes} performs exactly the same action as the \opt{noBboxes} option. The only
+advantage is that it can be used later in the preamble of the document. It cannot be used after
+\verb.\begin{document}. because the boxes are already set at that time.
+
+\section{Page layout options}
+These options define the layout of the odd page. The layout of the even page is assumed to be a mirror image.
+The values of \cmd{oddsidemargin} and \cmd{evensidemargin} are calculated from the values of the options.
+
+\subsection{Margins}
+This set of options us used to define margin sizes.
+Remember that all margins are measured from the top left corner of the paper, not from 1in border which is
+the \textsc{dvi} origin!
+
+\subsubsection{Option \opt{margins}, standard 0\,mm}
+\omg{margins}
+This option sets all margins (top, left, right, bottom) to the specified size. You will not be able to change
+some of the margin to another size. If you need different size for any margin, you have to set all of them
+separately and not use this option. Notice that almost everything may be calculated automatically, thus it is
+not necessary to specify all values.
+
+\subsubsection{Option \opt{topmargin}, default 1\,in}
+\omg{topmargin}
+This option sets the value of \cmd{topmargin}.
+
+\subsubsection{Option \opt{botmargin}, standard \opt{topmargin}}
+\omg{botmargin}
+This option specifies the size of the margin below the running footer.
+
+\subsubsection{Option \opt{leftmargin}, default --1\,in}
+\omg{leftmargin}
+This option sets the value of the margin at the left side of an odd page (and the margin at the right side of
+an even page). Negative value means that the value was not given.
+
+\subsubsection{Option \opt{rightmargin}, default --1\,in}
+\omg{rightmargin}
+This is the size of the right side of an odd page. Similarly the negative value means that the option was not
+specified.
+
+\subsection{Text dimensions}
+The following options are used to specify the height and width of the text.
+
+\subsubsection{Option \opt{textwidth}, default --1\,in}
+\omg{textwidth}
+This option specifies the width of the text without marginal notes. Its meaning is different for
+book covers. The option specifies the width of the cover without the extra spine (\opt{xspine}),
+flap (\opt{flap}) and trimming (\opt{xtrim} or \opt{trim}).
+
+\subsubsection{Option \opt{textheight}, default --1\,in}
+\omg{textheight}
+This option specifies the total height of the text including the header and footer.
+
+\subsubsection{Option \opt{headheight}, default 0\,mm}
+\omg{headheight}
+This option specifies the height of the running head.
+
+\subsubsection{Option \opt{headsep}, default 0\,mm}
+\omg{headsep}
+This is the value of \cmd{headsep}.
+
+\subsubsection{Option \opt{footskip}, default 0\,mm}
+\omg{footskip}
+This option specifies the value of \cmd{footskip}.
+
+\subsubsection{Option \opt{topskip}\texorpdfstring{, default \cmd{topskip}}{}}
+\omg{topskip}
+This option enables changing the value of \cmd{topskip}. It is rarely needed. However, the value of
+\cmd{topskip} is usually less than \cmd{baselineskip} which may cause problems in some page layout schemes.
+Since we have already written that font sizes must be defined before \pkg{zwpagelayout} is loaded, you can
+safely specify \verb;topskip=\baselineskip;.
+
+\subsubsection{Option \opt{strictheight}, default \false, standard \true}
+\omg{strictheight}
+The value of the \LaTeX\ dimension \cmd{textheight} is calculated from the values of the options and later
+adjusted so that together with \cmd{topskip} it represents an integer number of lines. This may not be
+desirable in some cases. This option instructs the package not to perform any adjustment and accept the
+calculated value.
+
+\subsubsection{Option \opt{adjustfootskip}, default \true, standard \true}
+\omg{adjustfootskip}
+If option \opt{strictheight} is not given, the calculated value of \cmd{textheight} is decreased to the nearest
+integer multiple of \cmd{baselineskip}. The difference is then added to \cmd{footskip} in order to preserve to
+total height. If \opt{adjustfootskip} is set to \false, the difference is added to \cmd{headsep} instead.
+
+\begin{figure}[bt]
+\noindent
+\includegraphics{adjustfoot}\hfill
+\includegraphics{adjusthead}
+
+\vb
+\caption{Compensation of \cmd{textheight} by changing \cmd{footskip} (on the left) and
+\cmd{headsep} (on the right)}\label{adj}
+\end{figure}
+
+The difference betweem these two options is shown in figure~\ref{adj}. Adjustment of \cmd{footskip}
+was achieved by:
+
+\vb
+\begin{verbatim}
+\usepackage[c8,margins=6mm,headheight=4mm,headsep=4mm,
+ croplength=3mm,cropgap=2mm,
+ cropmarks,cropframe,croptitle=Adjust\ footskip]{zwpagelayout}
+\end{verbatim}
+
+\vb \noindent
+The sample on te right side of the figure was created by:
+
+\vb
+\begin{verbatim}
+\usepackage[c8,margins=6mm,headheight=4mm,headsep=4mm,adjustheadsep,
+ croplength=3mm,cropgap=2mm,
+ cropmarks,cropframe,croptitle=Adjust\ headsep]{zwpagelayout}
+\end{verbatim}
+
+\subsubsection{Option \opt{adjustheadsep}, default \true, standard \true}
+\omg{adjustheadsep}
+This is a complementary option to \opt{adjustfootskip}.
+
+\section{Calculation of missing dimensions}\label{missing}
+The package can either calculate paper size from the page layout dimensions or calculate missing
+page layout dimensions if the paper size and some dimensions are known. It operates separately for
+the height and width. You can \eg. define the paper height and calculate the text height from it
+and the margins but specify all width layout dimensions and calculate the paper width.
+
+When designing simple pages it is better to define the paper size and calculate some page layout
+dimensions. However, for bok covers it is recommended to calculate at least the paper width from
+the layout dimensions of the front cover, the spine and the flap width.
+
+\subsection{Calculation of the paper size}
+Remember that paper size can be calculated only if all page layout dimensions for the corresponding
+orientation (height, width) are specified. There is no diagnostics for warning you if some
+important options are missing, the resukt will just be wrong or the package may even report an
+error. All dimensions are considered \emph{without} the area for the crop marks.
+
+\subsubsection{Paper height}
+Calculation of the paper height is very simple. The formula is:
+
+\vb
+\cmd{paperheight} = \opt{topmargin} + \opt{textheight} + \opt{botmargin} + 2 \opt{ytrim}
+
+\vb \noindent
+Remember that \opt{textheight} includes also \cmd{headheight}, \cmd{headsep}, and \cmd{footskip}.
+It is not necessary to specify \opt{ytrim}, the package checks the existence of this option and
+removes it from the formula if not given.
+
+\subsubsection{Paper width}
+Algorithm for calculating the paper width differs for simple pages and book covers. In the simple
+case the paper width is calculated as follows:
+
+\vb
+\cmd{paperwidth} = \opt{leftmargin} + \opt{textwidth} + \opt{rightmargin}
+
+\vb \noindent
+The value of \cmd{textwidth} will be equal to \opt{textwidth}. The same value will be stored in
+macro \cmd{UserWidth}, see section~\ref{crop.macros}.
+
+If the book cover is designed, the \opt{textwidth} option refers to the width of the text at the
+front cover but \opt{leftmargin} and \opt{rightmargin} are used to set \cmd{oddsidemargin} and
+\cmd{evensidemargin}. It is therefore better to set these options to zero, or alternatively to the
+same value as \opt{flap} or \opt{xtrim} if the corresponding area will be left empty. The value of
+\cmd{textwidth} will then be calculated from the final paper width by:
+
+\vb
+\cmd{textwidth} = \cmd{paperwidth} -- \opt{leftmargin} -- \opt{rightmargin}
+
+\vb
+If the \opt{flap} option is used without the \opt{spine} option in order to emulate the front cover
+and spine with an empty back cover, the paper width is calculated as:
+
+\vb
+\cmd{paperwidth} = \opt{leftmargin} + \opt{flap} + \opt{textwidth} + \opt{xtrim} +
+\opt{rightmargin}
+
+\vb \noindent
+The value of \opt{xtrim} may be omitted. The value of \opt{xspine} will be silently ignored. It is
+not allowed to have just the spine, the front cover and the flap while leaqving the back cover
+empty.
+
+The case of a book cover with the spine given is a bit more complicated:
+
+\vb
+\textit{width} = \opt{xspine} + \opt{textwidth} + \opt{flap} + \opt{xtrim}
+
+\cmd{paperwidth} = \opt{leftmargin} + \opt{spine} + 2 \textit{width} + \opt{rightmargin}
+
+\vb \noindent
+Options \opt{xspine}, \opt{flap}, and \opt{xtrim} need not be specified if these elements are not
+needed.
+
+\subsection{Calculation of page layout dimensions}\label{calc.pg.layout}
+Algorithm for calculating the page layout dimensions is intended for simple pages, not for book
+covers. Options \opt{xtrim}, \opt{ytrim}, \opt{spine}, \opt{xspine}, and \opt{flap} are silently
+ignored but will be taken into account when producing the crop marks. You can still make use of
+this algorithm if you understand what you are doing and if you wish to do extra calculations
+yourself.
+
+The dimensions may be overdetermined. In such a case the algorithm disregards one of the dimensions
+and calculates it.
+
+\subsubsection{Vertical dimensions}\label{vert.dim}
+The algorithm first looks whether \opt{textheight} was given. If not it is assumed that the user
+wishes to have it calculated from the paper height and the margins. If the \opt{botmargin} option was
+not set, it will be set to the same valu as \opt{topmargin}.
+
+In the second step the package looks whether \opt{botmargin} is defined, either by the user or from
+the previous step. If so, the text height is calculated, otherwise the bottom margin is calculated
+from the top margin and the text height. As a matter of fact, the bottom margin is never used by
+\TeX.
+
+Finally the value of \cmd{textwidth} is reduced by \cmd{headheight}, \cmd{headsep}, and
+\cmd{footskip}. If \opt{strictheight} is \cmd{false}, the values are later adjusted according to
+options \opt{adjustfootskip} and \opt{adjustheadsep} so that \cmd{textheight} -- \cmd{topskip} is
+an integer multiple of \cmd{baselineskip}.
+
+\subsubsection{Horizontal dimensions}
+The sum of the horizontal dimensions must be equal to the paper width according to the relation:
+
+\vb
+\opt{leftmargin} + \opt{textwidth} + \opt{rightmargin} = \cmd{paperwidth}
+
+\vb \noindent
+If all three dimensions are specified, \opt{textwidth} is disregarded and calculated from the other
+dimensions. If any two dimensions are given, the missing one is calculated from the above formula.
+If only one dimension is given, it is assumed that both margins have the same size and the above
+formula is applied. It is even possible to omit all dimensions. In such a case the margins are
+assumed to have the same size as \opt{topmargin} and the text width can thus be calculated.
+
+\section{Page reflection}\label{reflection}
+\omg{Reflect\-Horizontally}
+\omg{ReflectVertically}
+We sometimes need to print the whole document as a mirror image. Although there are external tools
+that can provide such a job taking PDF or PS as input, it is useful to do everything in a single
+step. The package provides options \opt{ReflectHorizontally} for horizontal reflection and
+\opt{ReflectVertically} for vertical reflection, respectively. If you specify both, some drivers
+may interpret both of them and print rotated 180$^{\circ}$, some interpret only one of them.
+
+The PostScript to PDF converters optionally rotate pages according to the text direction. They may
+be confused by reflected text and add undesired rotation. If the horizontally reflected text is
+roteted 180$^{\circ}$, it looks as if it were reflected vertically instead.
+
+Remember that these options are intended for printing only.
+The hypertext links made by the \pkg{hyperref} package will be wrong. If you wish to rotate parts
+of texts and preserve hyperlinks, use \pkg{rotating} instead.
+
+A word of warning has to be said. In \texttt{pdftex} reflection is implemented by redefininng
+\cmd{shipout}. We add PDF literal code to the beginning of each page. For \texttt{dvips} we add
+code to the \texttt{bop-hook}. If you need your own code in the \texttt{bop-hook}, you have to
+store the old definition and execute it. For \texttt{xetex} we add code to \texttt{bop} and
+\texttt{eop}. It seems that only one \texttt{bop} and one \texttt{eop} can be used. That is why the
+page is reflected vertically if both options are used. As a result you are not allowed to use your
+own \texttt{bop} and \texttt{eop} code together with these options.
+
+\section{Crop marks}\label{cropmarks}
+The crop marks must appear outside the print area. The package assumes that \cmd{paperheight} and
+\cmd{paperwidth} contain the page size after trimming. These dimensions will then be increased and the page
+will be shifted by setting \cmd{hoffset} and \cmd{voffset}. If you wish to print the crop marks using
+\opt{zwpagelayout}, you must not change values of \cmd{hoffset} and \cmd{voffset}.
+
+The values of \cmd{hoffset} and \cmd{voffset} will be set to the sum of \opt{croplength} and \opt{cropgap}, see the following
+text.
+
+\subsection{Basic crop marks options}
+Options described in this section define basic behaviour of the crop marks. The options can be used
+in all crop mark styles.
+
+\subsubsection{Option \opt{onlycropmarks}, default \false, standard \true}
+\omg{onlycropmarks}
+It may happen that a document is already finished and proof-read and just the crop marks have to be added.
+By specifying option \opt{onlycropmarks} you instruct the package to ignore all page layout options and
+interpret the crop marks options only. You just have to ensure that \cmd{paperheight} and \cmd{paperwidth} are
+set to the dimensions of the trimmed page before the \pkg{zwpagelayout} package is loaded and \cmd{hoffset} and
+\cmd{voffset} are left at their default values.
+
+\subsubsection{Option \opt{cropmarks}, default \false, standard \true}
+\omg{cropmarks}
+This option asks for creation of the crop marks.
+
+\subsubsection{Option \opt{nocropmarks}, default \true, standard \true}
+\omg{nocropmarks}
+This is a complementary option to \opt{cropmarks}.
+
+\subsubsection{Option \opt{croplength}, default 5\,mm}
+\omg{croplength}
+This option specifies the length of the crop mark.
+
+\subsubsection{Option \opt{cropgap}, default 5\,mm}
+\omg{cropgap}
+This is the space that must be left blank between the crop marks and the trimmed page. This area is
+also known as bleed.
+
+\subsubsection{Option \opt{cropframe}, default \false, standard \true}\label{cropframe}
+\omg{cropframe}
+When designing a book cover we often wish to verify whether all elements are properly aligned.
+Option \opt{cropframe} can be used to print the frames. It is active only if \opt{cropmarks} was
+specified.
+
+\subsubsection{Option \opt{nocropframe}, default \true, standard \true}
+\omg{nocropframe}
+This is a complementary option to \opt{cropframe}.
+
+\subsubsection{Option \opt{cropstyle}}\label{cropstyle}
+\omg{cropstyle}
+This option selects the style of the crop marks. Two styles are defined, \textit{default} and
+\textit{leaflet}.
+
+\subsubsection{Option \opt{croptitle}}
+\omg{croptitle}
+This option defines the text that should be printed on each page. It may \eg. be the title of the
+document. Remember that all spaces are gobbled when parsing the options. The spaces must therefore
+be specified as \verb*;\ ; or the text must be enclosed in curly braces.
+
+\subsubsection{Option \opt{cropseparator}}
+\omg{cropseparator}
+This is the separator between the title and the page number. Its default value is \verb;:\quad;.
+
+\subsubsection{Option \opt{pagenumberfirst}, default \false, standard \true}
+\omg{pagenumberfirst}
+Each page contains the title followed by the separator and the page number. If you set this
+option to \true, the order will be reversed.
+
+\subsubsection{Option \opt{pagenumberlast}, default \true, standard \true}
+\omg{pagenumberlast}
+This is a complementary option to \opt{pagenumberfirst}.
+
+\subsubsection{Option \opt{usepagenumbers}, default \true, standard \true}
+\omg{usepagenumbers}
+This option requests printing the page numbers.
+
+\subsubsection{Option \opt{nopagenumbers}, default \false, standard \true}
+\omg{nopagenumbers}
+This is a complementary option to \opt{usepagenumbers}.
+
+\iffalse
+\subsubsection{Option \opt{cropfontsize}}
+\omg{cropfontsize}
+This option defines the font size command issued just before the title and page number are printed.
+The default command is \verb;\fontsize{10}{10};.
+
+\subsubsection{Option \opt{cropfont}}
+\omg{cropfont}
+This option contains the command to select a font for the title and the page number. The default
+command is \cmd{normalfont}.
+\fi
+
+\subsubsection{Option \opt{nobleedclip}, default \false, standard \true}
+\omg{nobleedclip}
+The pages are clipped to the bleed box so that graphics does not collide with the crop marks. Since
+the package must work also with \pkg{dvips}, the PDF operators are not used and the crop marks area
+outside the bleed box is just overpainted with white rectangles. The \pkg{color} package is thus
+required and will be loaded automatically. If you set \opt{nobleedclip} to \true, the pages will
+not be clipped. It may be useful if you know that nothing extends to the crop marks area and the
+\pkg{color} package may clash with other packages required by your document.
+
+\subsection{Options for the \textit{default} style}
+These options can be used if \opt{cropstyle} is set to \textit{default} or omitted.
+
+\subsubsection{Option \opt{spine}}
+\omg{spine}
+This option is used for designing book covers. It specifies the width of the book spine. You can
+even request a zero width but negative values will have disastrous results.
+
+\subsubsection{Option \opt{xspine}}
+\omg{xspine}
+This option defines the extra space adjacent to the spine so that the book can be safely opened.
+This space should not be used for printing logos etc., because they will soon be damaged by
+frequent use of the book. The option is ignored unless \opt{spine} is used.
+
+\subsubsection{Option \opt{flap}}
+\omg{flap}
+This is another option for book covers. It specifies the width of the flap. If \opt{spine} is
+given, the book cover is supposed to have flaps of equal sizes on both sides. Sometimes you do not
+have flaps and the back cover remains empty, thus you do not like to prepare the design of it, you
+just wish to design the spine and the front cover. This can be acheved by specifying \opt{flap} as
+the spine thickness and omitting \opt{spine}.
+
+\subsubsection{Options \opt{trim}, \opt{xtrim}, \opt{ytrim}}
+\omg{trim}\omg{xtrim}\omg{ytrim}
+The paper or canvas used for printing the book covers is folded to the inner side yet part of it
+will be visible. Such part is specified by \opt{xtrim} in horizontal direction and \opt{ytrim} in
+vertical direction. You can use \opt{trim} to set both of them to the same value.
+
+\subsection{Options for the \textit{leaflet} style}\label{cropstyle.leaflet}
+The following options can be used if \opt{cropstyle} is defined as \textit{leaflet}. As the value
+says, the style is useful for leaflet production because in addtion to the crop marks additional
+marks for folding. Not all options can be used with all fold types. It will be described in greater
+detail in the following text.
+
+The leaflets are usually printed on both sides and sometimes one of the leaves needs width
+correction as will be explained later. The macros will apply the correction the one side on odd
+pages and on the other side on even pages. This can only happen if the \opt{twoside} class option
+is given or a class is used where two-side printing is the default. Usually the leaflet will
+consist of two pages only but no check is made.
+
+The \opt{cropframe} option (see~\ref{cropframe}) can also be used for previewing the leaflet
+layout.
+
+\subsubsection{Option \opt{leafcount}, default 4}
+\omg{leafcount}
+This option defines the number of leaves to be used in the Z-type. It is silently ignored with
+other fold types. Internally other fold types overwrite it with the value they need in the macros.
+
+\subsubsection{Option \opt{foldcorr}, default 0mm}
+\omg{foldcorr}
+As default all leaves have equal width. However, from technical or stylistic reasons the letmost or
+righmost leaf requires a different width. This can be achieved by this option. The value specifies
+an additional horizontal skip that is applied when printing the crop/fold marks and the optional
+frames.
+
+The width of the leaves is equal because it is achieved by \cmd{hfil}. If you specify
+\verb.foldcorr=-2mm., the corrected leaf will be 2\,mm narower that the others. Since there is
+\textit{1fil} in the width specification of the leaves, you can achieve nice tricks be specifying
+\verb.foldcorr=5cm plus -1fil.. In such a case the \textit{1fil} in the corrected leaf will vanish
+and its width will be 5\,cm.
+
+Width corrections are not allowed in the \textit{Z} and \textit{4} types and the option value is
+ignored. The details of the \opt{foldcorr} will be given in the next section.
+
+\subsubsection{Option \opt{fold}, default 2}
+\omg{fold}
+This option selects a fold type used with the leaflet. Supported options are \textit{2},
+\textit{3left}, \textit{3right}, \textit{4}, \textit{Z}. Their exact meaning is described below.
+
+\begin{description}
+\item[2] This option is used for singly folded leaflet. Usually the leaves will have different
+widths. The width of the left leaf is modified by the \opt{foldcorr} option.
+\item[3left] This option defines a leaflet with three leaves folded inside. For technical reasons
+the leaf folded inside must be slightly narrower. Typically this is the leftmost leaf. The leaf can
+be made narrower by applying \opt{foldcorr}.
+\item[3right] This is essentially the same as the previous option with the only difference that the
+\opt{foldcorr} correction is applied to the rightmost leaf.
+\item[Z] This option is used for Z-folded leaflets. The number of leaves is defined by the
+\opt{leafcount} option and with correction is not allowed.
+\item[4] This type of leaflet looks as the Z-type but without a fold in the middle. It can be
+viewed as a middle leaf of double width and the outer leaves are folded so that they touch each
+other. The middle crop mark is therefore missing because there is no fold there but a line will be
+drawn if the \opt{cropframe} option is requested.
+\end{description}
+
+As a final remark it is important to write that the width correction is applied as explained above
+on the odd pages. The correction of the same size is applied to the opposite side of the leaflet on
+even pages.
+
+\section{Color support}\label{color}
+The package offers basic color support, namely it prints the names of separations. The
+color support is implemented via a few options. Color printing is performed using the \pkg{color}
+package that is loaded automatically. The package does not use predefined color names.
+
+The package recognizes the \pkg{color} package by existence of the \cmd{definecolor} macro. If this
+macro is not defined, the \pkg{color} package will be added if:
+\begin{itemize}
+\item option \opt{color} is \true
+\item option \opt{nobleedclip} is \false\ and \opt{cropmarks} is \true
+\item option \opt{redefineblack} is \true
+\item option \opt{redefinetocmyk} is \true
+\item option \opt{overprint} is \true
+\end{itemize}
+If none of the above applies, the color support is not needed and the package will not be loaded.
+
+If the \pkg{color} package is being loaded, no options are given to it. Especially the driver
+selected by the \opt{driver} option (see section~\ref{driver.selection}) is not set. If you must
+specify any option for the \pkg{color} package, you have to load it yourself before loading
+\pkg{zwpagelayout}.
+
+\subsection{Color support for cropmarks}
+\omg{color}
+Option \opt{color} asks for the color support. Without setting this option to \true\ all other
+color options are silently ignored.
+
+\omg{colormodel}
+Option \opt{colormodel} defines the color model used. Its default value is \texttt{cmyk}. You will
+rarely need to change it.
+
+\omg{cropcolor}
+Option \opt{cropcolor} specifies the color to be used for the crop marks. Remember that the crop
+marks must be visible on all separations, thus it might not be sufficient to print them in black.
+As default their color is mixed of 100\,\% of all components of the current color model. Since the
+default model is \texttt{cmyk}, the default value of this option is \verb;{1,1,1,1};. Notice that the
+syntax conforms to the requirements of the \pkg{color} package.
+
+\omg{colors}\label{colors}
+Option \opt{colors} assigns names to the color components of the current model. Specification of
+each color must be enclosed in curly brackets. The color name is followed by a colon and comma
+separated values conforming to the syntax of the \pkg{color} package. It will be clear from the
+following examples.
+
+Suppose that for some strange reason you prepare the document in the RGB space. Your specification
+will then be:
+
+\vb
+
+\begin{verbatim}
+\usepackage[cropmarks,color,colormodel=rgb,cropcolor={1,1,1},
+ colors={{RED:1,0,0},{GREEN:0,1,0},{BLUE:0,0,1}},
+ croptitle=RGB\ example]{zwpagelayout}
+\end{verbatim}
+
+\vb
+
+Now we show a more realistic example. The document should be printed in custom colors. Since the
+true specification of custom colors requires much work and is rarely worth the trouble, we make use
+of the CMYK model. We will use cyan instead of Pantone 298 (blue), magenta instead of Pantone 213
+(red), black will remain black and the yellow separation will be unused. The crop marks should not
+produce anything on the yellow separation and we should provide proper color names. The
+specification will therefore look as:
+
+\vb
+
+\begin{verbatim}
+\usepackage[cropmarks,color,cropcolor={1,1,0,1},
+ colors={{Pantone\ 298\ (blue):1,0,0,0},
+ {Pantone\ 213\ (red):0,1,0,0},{Black:0,0,0,1}},
+ croptitle=Example\ with\ custom\ colors]{zwpagelayout}
+\end{verbatim}
+
+\vb
+
+Notice that the \opt{colormodel} option was not specified. Its default value was used. The
+\opt{cropcolor} option left zero for the yellow separation.
+
+If a color is light as e.\,g. the process yellow, it may be better to display its name in white on
+a colored background. This is achieved by preceding the color name with an asterisk. This is now
+the default behaviour for the yellow color. The default definition is:
+
+\vb
+\begin{verbatim}
+colors={{CYAN:1,0,0,0},{MAGENTA:0,1,0,0},{*YELLOW:0,0,1,0},{BLACK:0,0,0,1}}
+\end{verbatim}
+
+\vb
+
+\subsection{CMYK colors}\label{cmykcolors}
+\mg{cmykblack}\mg{cmykread}\mg{cmykgreen}\mg{cmykblue}
+The \pkg{color} package defines \textit{black} using the GRAY model and colors \textit{red},
+\textit{green}, \textit{blue} by the RGB model. The GRAY model rarely causes any problem but the
+RGB model is not acceptable for printing. The \opt{zwpagelayout} package therefore defines the
+corresponding colors using the CMYK model. Different names are selected so that there is no clash
+in case you really need these colors in RGB.
+
+\subsection{Overprinting support, default \false, standard \true}\label{overprinting}
+\omg{overprint}
+The overprinting support must be requested by the \opt{overprint} option. If the option remains
+\false, the overprinting commands will be defined but will do nothing. Remember that you can
+overprint any color, not just black. You thus should not enable overprinting globally. The mode is
+therefore set to \textit{knockout} within the package.
+
+\cmg{OverprintXeTeXExtGState}
+Overprint is implemented in all supported drivers. However, there is a minor problem with the
+(x)dvipdfm(x) family of drivers. The definition of the graphic state must be present in the
+resources of each page where overprinting is used. The (x)dvipdfm(x) drivers do not do it
+automatically, it has to be done by the \cmd{OverprintXeTeXExtGState} macro. Since the cropmarks
+switch overprint off, they require the definition of the graphic state and the macro is always
+invoked from the running head. This requirement is thus a minor problem. The user usually does not
+care whether overprint is enabled for preview and proof-reading. The final document will have
+cropmarks and thus overprint will be enabled.
+
+\cmg{SetOverprint}\cmg{SetKnockout}
+These macros change the mode to \textit{overprint} or \textit{knockout}, respectively. They act as
+declarative macros, similarly as \eg. \cmd{itshape}. You have to use them within a group. The
+macros are intended to be used for changing the mode for a longer part of text. Due to the way how
+environments are handled in \LaTeX, it is also possible to write:
+
+\vb
+\begin{verbatim}
+\begin{SetOverprint}
+Some long text to be overprinted...
+\end{SetOverprint}
+\end{verbatim}
+
+\vb
+
+\cmg{textoverprint}\cmg{textknockout}
+If a short part of text should be printed in a different mode, one-argument macros
+\cmd{textoverprint} and \cmd{textknockout} can be used. They act similarly as the \cmd{textit}
+macro.
+
+\omg{redefineblack}
+Overprinting works only if both the background and forground colors are in the CMYK model. However,
+the \textit{black} color, which is most often overprinted, is defined in the GRAY model as default.
+This package defines the \texttt{cmykblack} color that may be used for this purpose. In addition if
+\opt{redefineblack} is set to \true, the standard \textit{black} color will be redefined in CMYK.
+
+\omg{redefinetocmyk}
+Although \textit{red}, \textit{green}, \textit{blue} will rarely be used for overprinting (maybe
+just as a background), option \opt{redefinetocmyk} requests redefinition of these colors to CMYK.
+The \textit{black} color will be redefined as well.
+
+\vb
+\textbf{Important note:} the (x)dvipdfm(x) drivers may switch to the gray colour model after
+\cmd{textcolor} even if redefinition of black or even all colours to CMYK was requested. If black
+overprint does not work, insert explicit \verb;\color{cmykblack};. This trick is not needed with
+pdf\TeX\ or dvips.
+
+\vb
+
+\mg{grblack}\mg{rgbred}\mg{rgbgreen}\mg{rgbblue}
+If the colors are redefined to CMYK, the original definitions are not available. Although you
+redefine them due to a printing process where the RGB colors are undesirable, you can sometimes
+need them. For this purpose \textit{grblack}, \textit{rgbred}, \textit{rgbgreen}, \textit{rgbblue}
+colors are always available.
+
+\section{PDF information}\label{pdfinfo}
+The package writes the basic information that is required by PDF/X even if PDF/X conformace is not
+requested. The basic pieces of information are \texttt{CreationDate} and \texttt{ModDate}.
+Implementation is driver dependent and some information is supplied by the driver itself. Thus
+\texttt{pdftex} inserts both, (x)dvipdfm(x) (\XeTeX) adds \texttt{CreationDate} only, dvips adds
+none. The missing information is supplied by this package based on \cmd{date} and \cmd{time}. The
+next subsections will explain how other fields can be defined and how they can be disabled if
+needed.
+
+\subsection{PDF title}\label{pdftitle}
+\omg{title}
+The \opt{title} option is used to set the title field. The default is to take the contents of the
+\opt{croptitle} option even if the cropmarks are switched off. If \opt{croptitle} is empty,
+\cmd{jobname} is used. If you specify this option without a value, it has a special meaning of
+suppressing creation of PDF information field. Since this is not mnemonic, there is a
+\opt{nopdfinfo} option with the same effect, see subsection~\ref{nopdfinfo}.
+
+\subsection{PDF author}
+\omg{author}
+The \opt{author} option sets the author of the document. The field is not required by PDF/X,
+therefore it has no default value.
+
+\subsection{PDF subject}
+\omg{subject}
+The \opt{subject} option defines the subject of the document.
+
+\subsection{PDF keywords}
+\omg{keywords}
+The \opt{keywords} option is used to set the list of keywords. Usually the keywords will be given
+as a comma separated list. They must therefore be enclosed in braces.
+
+\subsection{Option \opt{nopdfinfo}}\label{nopdfinfo}
+\omg{nopdfinfo}
+The above mentioned fields may also be set in the PDF file by the \pkg{hyperref} package. If
+\pkg{hyperref} is used, it may not be desirable if \pkg{zwpagelayout} wrote the PDF information. If
+you specify \opt{nopdfinfo} in the list of options, setting all above mentined information (including
+\texttt{ModDate}) will be disabled. This option is not boolean, it just erases the contents of the
+\opt{title} option, see subsection~\ref{pdftitle}. Since options are procesed in the order in which
+they are declared in the package, \opt{nopdfinfo} will always erase the PDF title even if it is
+specified before \opt{title}.
+
+It has recently been found that these packages do not conflict, it is safe to specify some
+pieces of information by \pkg{zwpagelayout} and other pieces of information via \pkg{hyperref}.
+Anyway, this option will be preserved for the case that it might be needed in the future.
+
+\section{PDF/X-1a compliance}\label{pdfx1a}
+The package partially implements the PDF/X-1a standard. Remember that implementation is driver
+dependent and not everything can be achieved with all drivers. The following sections will give you
+more detail. Unlike the \pkg{pdfx} package we try to do as much in \texttt{xetex} and set the
+bounding boxes according to the real page size.
+
+\subsection{Option \opt{pdfminorversion}}
+\omg{pdfminorversion}
+This option allows you to set the version of the PDF file. It works with \texttt{pdftex} only. There
+is no \cmd{special} for sending this information to (x)dvipdfm(x), it can only be set on the
+command line. Similarly PostScript to PDF converters accept such setting from the command line or a
+configuration file although there is a PS command for setting it.
+
+\cmg{SetPDFminorversion}
+The same effect can also be achieved by \cmd{SetPDFminorversion} from a preamble. The macro accepts
+a single argument and is implemented for \texttt{pdftex} only. It does nothing for other drivers.
+
+\subsection{Option \opt{pdfx}}
+\omg{pdfx}
+This option ask the package to create PDF/X-1a file. The first requirement is to set PDF version
+to~1.3, thus it sets the minor version to~3 and then disables macro \cmd{SetPDFminorversion}. Other options
+have reasonable default values but they can be changed as described in the following subsections.
+
+PDF/X-1a compliance is not handled for \texttt{dvips} and some features are not available for
+\texttt{xetex}.
+
+\subsection{Options \opt{OutputCondition} and \opt{OutputConditionIdentifier}, default Euroscale
+Coated~v2}
+\omg{OutputCondition}
+\omg{OutputConditionIdentifier}
+These options specify the ICC profile. I am not sure how to obtain the correct names. The default
+values correspond to the ICC profiles used in Europe but you can easily set another value. From my
+personal experience I prefer \textit{eucmyk50} when converting my images from AdobeRGB to CMYK.
+
+\subsection{Option \opt{ICCfile}}
+\omg{ICCfile}
+This option specifies the name of the file containing the ICC profile. There is no default
+definition and no profile is embedded. The profiles usually accompany commercial products as
+printers and scanners or can be downloaded from the web. If you have a CMYK profile that you wish
+to embed, you can specify its name with the opt{ICCfile} option. The profile can only be embedded
+by \texttt{pdftex}.
+
+\subsection{Font embedding}
+PDF/X requires all fonts to be embedded. The \pkg{zwpagelayout} package cannot ensure it. You have
+to verify your configuration files and make sure that fonts are embedded.
+
+\subsection{Page bounding boxes}
+It is mandatory to set BleedBox and TrimBox in addittion to MediaBox. Setting these boxes
+is explained in section~\ref{Bboxes}. ArtBox is explicitely forbidden by PDF/x, therefore it is not
+set.
+
+\subsection{PDF information}
+Mandatory fields are title, CreationDate and ModDate. All these fields are set automatically unless
+they are disabled as described in section~\ref{pdfinfo}.
+
+\subsection{MPT metadata}
+Emdedding MPT metadata is currently not implemented. It will be implemented in the future but only
+for \texttt{pdftex}.
+
+\subsection{Color}
+PDF/X-1a allows only CMYK colors and spot colors. Since \pkg{zwpagelayout} does not handle colors
+itself but makes use of the \pkg{color} package, it cannot verify that only allowed colors are
+used.
+
+
+\section{Useful macros}\label{macros}
+The package offers two types of useful macros. The macros from the first group help in designing
+the document. However, as mentioned in the Introduction, the package may be deployed in already
+existing document just for adding the crop marks. In order to reduce the risk of conflicts with
+other packages these macros are unavailable if the \opt{onlycropmarks} option is used. The second
+group contains macros that are primarily used in the crop mark generation. They are always visible.
+
+\subsection{Userspace macros}\label{user.macros}
+As written above, macros of this group are available only if the \opt{onlycropmarks} option was not
+used. It is not planned to make any interface for providing them even with the \opt{onlycropmarks}
+option. If the document is already finished, you do not need them. If you write a new document, it
+is preferable to use the whole package for defining the page layout. The macros will than be
+available.
+
+\cmg{topskip}
+\cmg{Vcorr}
+\TeX\ should use integer arithmetic but some implementations, \eg. em\TeX, violate this rule. This
+makes processing the text faster but may have bad results. If you combine text with boxes and fixed
+size glues the height of which is an integer multiple of \cmd{baselineskip}, the round-off errors
+may add a few scaled points, the page overflows and as a result is made one line shorter and
+underfull vbox is reported. For this reason tiny shrink is added to \cmd{topskip}, its
+size is \the\topskip. Yet it may not be sufficient in some cases. We therefore provide vertical
+skip macro \cmd{Vcorr} the size of which is shrinkable zero. The meaning of \cmd{Vcorr} is {\tt
+\meaning\Vcorr}.
+
+\cmg{vb}
+We often need a vertical skip the size of which is a multiple of \cmd{baselineskip}. Macro \cmd{vb}
+serves this very purpose. It accepts an optional argument in square brackets which denotes the
+multiple of \cmd{baselineskip}. The default value is~1. The command also contains compensation
+shrinkage. Some packages activate several characters, even those which could be used in numerical
+and dimension specifications. Hyphens and dots are temporarily deactivated within the optional
+argument of the \cmd{vb} macro. You thus can comfortably specify negative as well as fractional
+dimensions.
+
+\cmg{NewOddPage}
+\LaTeX\ provides \cmd{cleardoublepage} for moving the next text to the beginning of the odd page.
+However, you have no control over the page style of the inserted empty even page. This feature is
+enabled in the \cmd{NewOddPage} macro. Its syntax is:
+
+\vb
+\verb;\NewOddPage*[;$\langle$style$\rangle$\verb;];
+
+\vb\noindent
+Optional parameter $\langle$style$\rangle$ defines the style of the empty even page that should be
+fed to the \cmd{thispagestyle} command. The default is \texttt{empty}. The starred version displays
+a warning in the log file if an empty page was inserted.
+
+\cmg{SetOddPageMessage}
+This macro sets the contents of the message that should be displayed as a warning if an empty page
+was inserted as a result of \cmd{NewOddPage*}. The macro acts as \cmd{gdef}. This means that the
+definition is global and you can therefore have only one message unless you redefine it. The body
+of the message may contain macros. They will be expanded when the message is being written. You can
+use \cmd{MessageBreak} in order to split the text into several lines.
+
+\cmg{NewEvenPage}
+Generally speaking, you should not start a chapter on an even page but there are cases when it is
+desirable. Imagine the situation when each chapter starts with a full page illustration on the left
+and with its title page on the right. In such cases you need to start at the even page but \LaTeX\
+does not contain any direct tool for doing it. This package provides the \cmd{NewEvenPage} with the
+same syntax as \cmd{NewOddPage}.
+
+\cmg{SetEvenPageMessage}
+Similarly this macro serves for setting the message text that appears if an empty page was inserted
+as a result of the \cmd{NewEvenPage*} macro.
+
+\subsection{Crop mark macros}\label{crop.macros}
+\cmg{clap}
+\TeX\ offers zero-width horizontal boxes with contents overlapping to the right (\cmd{rlap}) or to
+the left (\cmd{llap}). The \pkg{zwpagelayout} package frequently needs a zero-width box with the
+contents centered overlapping evenly to both sides. The package thus provides macro \cmd{clap} and
+makes it available for the user.
+
+\cmg{CropFlap}
+\cmg{CropSpine}
+\cmg{CropXSpine}
+\cmg{CropXtrim}
+\cmg{CropYtrim}
+\cmg{UserWidth}
+\cmg{UserLeftMargin}
+\cmg{UserRightMargin}
+It was written in the Introduction that the package allows to prepare the book cover before the
+exact dimensions are known. Later we just adapt the values of the package options and everything is
+recalculated automatically. As a matter of fact, it could not happen if we did not refer to
+selected dimensions in the document symbolically. Thus the values of some options are available in
+macros: \cmd{CropFlap}\is\opt{flap}, \cmd{CropSpine}\is\opt{spine}, \cmd{CropXSpine}\is\opt{spine},
+\cmd{CropXtrim}\is\opt{xtrim}, \cmd{CropYtrim}\is\opt{ytrim},
+\cmd{UserWidth}\is\opt{textwidth}, \cmd{UserLeftMargin}\is\opt{leftmargin},
+\cmd{UserRightMargin}\is\opt{rightmargin}.
+
+The use of these macros can be shown by an example. The book cover with flaps displayed in
+Figure~\ref{cover} was prepared by the following code:
+
+\vb
+\verbatiminput{coversample}
+
+\begin{sidewaysfigure}[p]
+\centerline{\includegraphics{coversample}}
+
+\caption{Sample of a book cover with flaps}\label{cover}
+\end{sidewaysfigure}
+
+Remember that these macros contain only the dimensions that were specified in the \cmd{usepackage}
+command, not those that were calculated by the algorithm described in section~\ref{calc.pg.layout}.
+If a shortcut option was used, all real dimensions are defined, \ie. the \opt{margins} option fills
+all four margin options, \opt{topmargin}, \opt{leftmargin}, \opt{rightmargin}, \opt{botmargin}, and
+the \opt{trim} option fills both \opt{xtrim} and \opt{ytrim}. You can take advantage of it to make
+your document more general. You can \eg. define the book cover in two variants, with or without
+flaps, using this trick:
+
+\vb
+\begin{verbatim}
+\ifcat$\CropFlap$
+ % no flaps
+\else
+ \vbox to \textheight{\hsize\CropFlap
+ Flap text
+ }\hss
+\fi
+\end{verbatim}
+
+\vb
+
+\cmg{thePageNumber}
+Macro \cmd{thePageNumber} is used to print the page number together with the crop mark text. We have
+already shownd that it may be suppressed by the \opt{nopagenumbers} option. Another possibility is
+to redefine it. We can \eg. define the book title with the \opt{croptitle} option and use the
+text ``Cover'' instead of the page number when typesetting the cover. Usage of this macro is also
+demonstrated in Figure~\ref{cover}.
+
+\subsection{Driver switching macros}\label{driver.switching}
+These macros provides conditional branching according to the currently selected driver no matter
+whether it is chosen automatically or by specifying the \opt{driver} option described in
+section~\ref{driver.selection}. The macros do not change page layout, they are therefore available
+even if the \opt{onlycropmarks} option was given.
+
+\cmg{ifcaseZWdriver}
+Macro \cmd{ifcaseZWdriver} expands to an open \cmd{ifcase} primitive. You can thus branch the code
+according to the driver. The numeric values are 0 for \texttt{unknown}, 1 for \texttt{pdftex}, 2
+for \texttt{xetex}, 3 for \texttt{dvips}. The branching may look as follows:
+
+\vb
+\begin{verbatim}
+\ifcaseZWdriver
+ Code for unknown
+\or
+ Code for pdftex
+\or
+ Code for xetex
+\or
+ Code for dvips
+\else
+ Error, it may not happen!
+\fi
+\end{verbatim}
+
+\vb
+Since \cmd{ifcaseZWdriver} is a macro, it cannot be used inside another conditional statement. If
+it falls to the \false\ branch, it will not be expanded and \TeX\ will complain that it sees
+misplaced \cmd{else} etc. You would have to enter all corresponding contidional as \cmd{csname}
+constructions or define the condition in a separate macro that will be invoked from the condition.
+
+\textbf{Important note:} It is not guaranteed that the numerical assignment will be kept unchanched
+in future versions.
+
+\cmg{ZWifdriver}
+The \cmd{ZWifdriver} allows conditional execution of a code for a specified driver. It requires two
+parameters. The first parameter is the driver name, the second parameter is the code to be
+executed. The macro recognizes all driver names and aliases as given in
+section~\ref{driver.selection}. It can be used \eg. in cases when you have to perform some action
+for a specific driver only. Suppose that you do not want to set the page bounding boxes
+(see~\ref{Bboxes}) if \texttt{dvips} is used but want to set them if the same document is
+processed by any other driver. You can thus put the following command to the preamble of the
+document:
+
+\vb \noindent
+\verb.\ZWifdriver{dvips}{\noBboxes}.
+
+\vb
+\textbf{Note:} This macro does not depend on the numerical assignment given above. It will
+therefore work the same way in the future versions.
+
+\section{Customizing crop styles}
+This section is intended for real \TeX perts. The package tries to provide a lot of options that
+enable to customize the default crop style. Try to live with them because here you are touching the
+very guts of the package. If you squeeze them badly, your document will suffer from strange
+problems the source of which will be difficult to trace. However, if you like tough challenges and
+your stomach is strong enough, then read on, but remember, you have been warned.
+
+You ask for a different crop style by the \opt{cropstyle} option as described in
+section~\ref{cropstyle} on page~\pageref{cropstyle}. Assume that you load the package with:
+
+\vb
+\begin{verbatim}
+\usepackage[cropmarks,cropstyle=special,...]{zwpagelayout}
+\end{verbatim}
+
+\cmg{cropstyle@special}
+You will then have to define macro \cmd{cropstyle@special}. The package first patches the footer in
+all page styles. A zero-width, zero-height, zero-depth box is added to the beginning of the footer.
+The actual point is set to the lower left corner of the paper as defined by \cmd{paperheight} and
+\cmd{paperwidth}. If \opt{nobleedclip} was not used, the area outside the bleed box is erased. The
+current color is set according to \opt{cropcolor} option and the font is selected. Afterwards the
+\cmd{cropstyle@special} macro is called.
+
+Some crop styles may require initialization. If it is the case of your style, you have to define
+macro \cmd{cropstyle@special@setup}. This macro will be executed in the \cmd{AtBeginDocument} hook.
+Execution of the macro in that hook allows you to defin the crop style in a package that may be
+loaded after \pkg{zwpagelayout}.
+It is not an error if the setup macro does not exist.
+
+As already noted, the intention is to discourage users from writing their own crop styles. We will
+therefore only mention that the package defines a few useful macros that can be used in the crop
+style definition. If your temptation to design your own crop style is really strong, you should
+better study the package internals yourself.
+
+\section{Summary of driver specific features}
+The driver specific features are described throughout the manual but it may not be clear from the
+option or macro description that it is driver dependent. These features with the reference to the
+section, where it is described, are written below. All these features are disabled if an
+\texttt{unknown} driver is being used (section~\ref{driver.selection}).
+\begin{itemize}
+\item Page bounding boxes, section~\ref{Bboxes}
+\item Page reflection, section~\ref{reflection}
+\item Overprinting, section~\ref{overprinting}
+\item Setting PDF information, section~\ref{pdfinfo}
+\item PDF/X-1a compliance, section~\ref{pdfx1a}
+\end{itemize}
+Color support is, of course, driver dependent too. However, the \pkg{zwpagelayout} has no
+pretention to deal with it. It is fully handled within the \pkg{color} package.
+
+\section{Known bugs and unimplemented features}
+This section describes features that are known not to work in all case or those that do not work with
+all drivers.
+
+\subsection{Driver repertoire}
+Only a few most frequent drivers are automatically detected and supported. Their list is presented
+in section~\ref{driver.selection}. If you use another driver, you should probably disable all
+driver specific features.
+
+\subsection{Shifted cropmarks when the running foot overflows}
+If there is not enough space for the running foot, the cropmarks will most likely be shifted. It
+usually happens if you set option \opt{footskip} to zero (which is its default value) and forget to
+use \verb.\pagestyle{empty}..
+
+\subsection{Page boxes and Adobe Distiller}
+Setting page boxes causes a fatal error in Adobe Distiller (verified with versions 4 and~9). See
+section~\ref{Bboxes}.
+
+\subsection{Page reflection}
+Option \opt{ReflectVertically} seems to produce slightly shifted output. If any of these options is
+used in \XeTeX\ or more specifically with (x)dvipdfm(x) drivers, other \texttt{bop} or \texttt{eop}
+code must not be used. See section~\ref{reflection} for details on its implementation.
+
+\subsection{Overprinting}
+Overprinting works in (x)dvipdfm(x) drivers but may be cumbersome in some situations. More details
+are given in section~\ref{overprinting}.
+
+It was also found that overprinting does not work if the PostScript file is converted to PDF by
+GhostScript version~7.x. This is a bug in GhostScript, overprinting works fine if
+GhostScript~8.x is used.
+
+The effect of oveprinting was tested in Adobe Acrobat~9 Pro in MS~Windows~XP Home Service Pack~3.
+
+\subsection{Inconsistent dates}
+Values of \texttt{CreationDate} and \texttt{ModDate} (see section~\ref{pdfinfo}) supplied by the driver contain information on
+the time zone. Unfortunatelly, time zone setting is not available in \TeX. If both fields come from
+the same origin, they are set consistently. If one of them is set by the driver and the other by
+the \pkg{zwpagelayout} package, then only the field set by he driver will contain the time zone
+value. Depending on your time zone it may look as if the document were modified before it was
+created.
+
+\subsection{PDF/X conformance}
+The PDF/X conformance is only partial. The details are given in section~\ref{pdfx1a} and its
+subsections.
+
+\section{Changes}
+This section summarizes the changes. The version and the package date is given. It may be useful to
+specify the date in the \cmd{usepackage} or \cmd{RequirePackage} command if you rely on a specific
+feature not available in the old version of the package.
+
+\subsection{Version 1.4c, 2013/01/13}
+Bug fix, the PDF boxes are properly set even in the (x)dvipdfm(x) family of drivers, i.\,e.\@ in
+\XeLaTeX.
+
+\subsection{Version 1.4b, 2012/10/04}
+New feature, the color name in the cropmarks can be displayed in white on a colored background, see
+page~\pageref{color}.
+
+\subsection{Version 1.4a, 2012/05/20}
+Bug fix, if a user requested unexistent page style, the cropmark mechanism looped forever until all
+main memory was exhausted. Now the package issues an error message and uses the ``empty'' page
+style.
+
+\subsection{Version 1.4, 2012/05/13}
+Black overprint is implemented for the (x)dvipdfm(x) family of drivers. It means that it now works
+in \XeLaTeX, see section~\ref{overprinting}.
+
+\subsection{Version 1.3a, 2012/01/10}
+\begin{itemize}
+\item Bug fix, code rearrangement in order to prevent an error message if \opt{onlycropmarks} is
+used. It leads to the following changes in the functionality:
+\begin{enumerate}
+\item Page size is always set in the driver specific way. It is still assumed that
+\cmd{paperheight} and \cmd{paperwidth} contained correct values before the package was loaded.
+\item Bounding boxes are set unless they are explicitly suppressed.
+\item PDF options are honoured. It is therefore possible to request PDF/X compliance, set the PDF
+title and other information. If you do not wish it, you have to suppress it explicitely by
+\opt{nopdfinfo}.
+\end{enumerate}
+\end{itemize}
+
+\subsection{Version 1.3, 2011/11/22}
+\begin{itemize}
+\item Bug fix, weird errors appeared if the \pkg{ifxetex} package was loaded previously either
+directly or indirectly. Loading of both \pkg{ifpdf} and \pkg{ifxetex} packages written in a different way.
+\item Bug fix, pagestyle patching redesigned (r.~409); in the previous versions the crop marks may
+disapear if \cmd{pagestyle} was issued again, mainly when the \pkg{fancyhdr} package was used.
+\item New feature, when defining a page style, a part of another style may now be inherited. The
+following code now can be used:
+\begin{verbatim}
+\def\ps@mypagestyle{\ps@plain
+ \def\@oddhead{\hfill My running head}\let\@evenhead\@oddhead}
+\pagestyle{mypagestyle}
+\end{verbatim}
+\item Bug fix: \cmd{globaldefs} is set to zero for printing crop marks. If it were nonzero,
+crop marks will not work and will spoil the document. \LaTeX\ users probably do not know this
+primitive but who knows\,\ldots
+\item Bug fix: without the \opt{twoside} class option and with asymetric margins the crop marks were
+printed on wrong positions on the even pages.
+\item New feature: crop marks style for leaflets added (section~\ref{cropstyle.leaflet}).
+\end{itemize}
+
+\subsection{Version 1.2, 2011/09/04}
+\begin{itemize}
+\item Bug fix, \cmd{fi} was missing in the definition of \cmd{ZWifdriver}.
+\end{itemize}
+
+\subsection{Version 1.1, 2010/12/21}
+Two bugs were fixed and a few new features were introduced. Documentation is modified and extended as
+well.
+\begin{itemize}
+\item Bug fix, if \cmd{pagestyle} or \cmd{thispagestyle} was issued within a group while crop marks
+were active, the package often failed into an endless loop which resulted in exhausting the memory.
+\item Bug fix, the code for page reflection for \texttt{dvips} did not preserve properly the old
+\texttt{bop-hook}.
+\item New feature, the driver can be explicitly selected (section~\ref{driver.selection}) and the
+code can be branched according to the driver (section~\ref{driver.switching}).
+\item New feature, page reflection implemented for (x)dvipdfm(x) drivers, \ie. for \XeTeX\
+(section~\ref{reflection}).
+\item New feature, CMYK and RGB colors explicitly defined (section~\ref{color}).
+\item New feature, colors may be redefined to use the CMYK model (section~\ref{color}).
+\item New feature, overprinting implemented for \texttt{pdftex} and \texttt{dvips}
+(section~\ref{overprinting}).
+\item New feature, PDF information can be set without the need of loading the \pkg{hyperref}
+package (section~\ref{pdfinfo}).
+\item New feature, partial PDF/X-1a compliance (section~\ref{pdfx1a}).
+\end{itemize}
+
+\subsection{Version 1.0a, 2008/12/26}
+The sample files distributed with the package no longer require enc\TeX\ and private macro
+packages.
+
+\section{License}
+The package can be used and distributed according to the \LaTeX\ Project Public License version~1.3 or later the
+text of which can be found at the \texttt{License.txt} file in the \texttt{doc} directory or at
+\url{http://www.latex-project.org/lppl.txt}
+
+\section{Trade marks}
+This document makes use of trade marks owned by Adobe Systems Incorporated and Microsoft
+Corporation when refering to their products.
+
+\end{document}