diff options
author | Karl Berry <karl@freefriends.org> | 2008-12-31 18:34:50 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-12-31 18:34:50 +0000 |
commit | 017ad2f10327ba4679d28c4ac52d6e7fc9b2f434 (patch) | |
tree | 80d978e151fe5730ecbdac1467218f6ee8b1d9d7 | |
parent | e006a130a7f539e06670eeb76d56bcf4cad5d923 (diff) |
new latex package zwpagelayout (27dec08)
git-svn-id: svn://tug.org/texlive/trunk@11767 c570f23f-e606-0410-a88d-b1316a301751
15 files changed, 1942 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/zwpagelayout/License.txt b/Master/texmf-dist/doc/latex/zwpagelayout/License.txt new file mode 100644 index 00000000000..90e5e3ab797 --- /dev/null +++ b/Master/texmf-dist/doc/latex/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/Master/texmf-dist/doc/latex/zwpagelayout/LoremIpsumDolor.tex b/Master/texmf-dist/doc/latex/zwpagelayout/LoremIpsumDolor.tex new file mode 100644 index 00000000000..1a0670edacd --- /dev/null +++ b/Master/texmf-dist/doc/latex/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/Master/texmf-dist/doc/latex/zwpagelayout/README b/Master/texmf-dist/doc/latex/zwpagelayout/README new file mode 100644 index 00000000000..63079be0ddf --- /dev/null +++ b/Master/texmf-dist/doc/latex/zwpagelayout/README @@ -0,0 +1,9 @@ +============================================================================= +Package: zwpagelayout Version 1.0 26 December 2008 +============================================================================= + +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. diff --git a/Master/texmf-dist/doc/latex/zwpagelayout/adjustfoot.pdf b/Master/texmf-dist/doc/latex/zwpagelayout/adjustfoot.pdf Binary files differnew file mode 100644 index 00000000000..0a1c502ded3 --- /dev/null +++ b/Master/texmf-dist/doc/latex/zwpagelayout/adjustfoot.pdf diff --git a/Master/texmf-dist/doc/latex/zwpagelayout/adjustfoot.tex b/Master/texmf-dist/doc/latex/zwpagelayout/adjustfoot.tex new file mode 100644 index 00000000000..edf59078d87 --- /dev/null +++ b/Master/texmf-dist/doc/latex/zwpagelayout/adjustfoot.tex @@ -0,0 +1,16 @@ +\input utf8-t1 +\documentclass{book} +\usepackage{zwtools,lmodern} +\usepackage[T1]{fontenc} +\usepackage[protrusion=false,expansion=true,stretch=8,shrink=24,step=4]{microtype} +\Nsize 8/4mm +\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/Master/texmf-dist/doc/latex/zwpagelayout/adjusthead.pdf b/Master/texmf-dist/doc/latex/zwpagelayout/adjusthead.pdf Binary files differnew file mode 100644 index 00000000000..47169c8ae14 --- /dev/null +++ b/Master/texmf-dist/doc/latex/zwpagelayout/adjusthead.pdf diff --git a/Master/texmf-dist/doc/latex/zwpagelayout/adjusthead.tex b/Master/texmf-dist/doc/latex/zwpagelayout/adjusthead.tex new file mode 100644 index 00000000000..64f2c2be5c6 --- /dev/null +++ b/Master/texmf-dist/doc/latex/zwpagelayout/adjusthead.tex @@ -0,0 +1,16 @@ +\input utf8-t1 +\documentclass{book} +\usepackage{zwtools,lmodern} +\usepackage[T1]{fontenc} +\usepackage[protrusion=false,expansion=true,stretch=8,shrink=24,step=4]{microtype} +\Nsize 8/4mm +\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/Master/texmf-dist/doc/latex/zwpagelayout/coversample.pdf b/Master/texmf-dist/doc/latex/zwpagelayout/coversample.pdf Binary files differnew file mode 100644 index 00000000000..73686603962 --- /dev/null +++ b/Master/texmf-dist/doc/latex/zwpagelayout/coversample.pdf diff --git a/Master/texmf-dist/doc/latex/zwpagelayout/coversample.tex b/Master/texmf-dist/doc/latex/zwpagelayout/coversample.tex new file mode 100644 index 00000000000..3124acae229 --- /dev/null +++ b/Master/texmf-dist/doc/latex/zwpagelayout/coversample.tex @@ -0,0 +1,27 @@ +\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[SC0,ISBN=978-80-7340-097-2]{ean13isbn} +\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 \EANisbn}\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/Master/texmf-dist/doc/latex/zwpagelayout/zwpagelayout.pdf b/Master/texmf-dist/doc/latex/zwpagelayout/zwpagelayout.pdf Binary files differnew file mode 100644 index 00000000000..06b479d5af5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/zwpagelayout/zwpagelayout.pdf diff --git a/Master/texmf-dist/doc/latex/zwpagelayout/zwpagelayout.tex b/Master/texmf-dist/doc/latex/zwpagelayout/zwpagelayout.tex new file mode 100644 index 00000000000..3291d9da76e --- /dev/null +++ b/Master/texmf-dist/doc/latex/zwpagelayout/zwpagelayout.tex @@ -0,0 +1,792 @@ +%% $Id: zwpagelayout.tex 290 2008-12-26 17:43:49Z zw $ +\input utf8-t1 % encTeX required +\documentclass[11pt]{article} +\usepackage{zwgetfdate} +\usepackage[footskip=30pt,topmargin=2cm,leftmargin=2cm,rightmargin=5cm,botmargin]{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} + +\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}{}} + +\begin{document} +\hyphenation{allow-with-height-switching} +\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. +\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 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{Usage} +The package is loaded simply by: + +\vb +\verb;\usepackage[;$\langle$options$\rangle$\verb;]{zwpagelayout}; + +\vb +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. + +\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}\omg{\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}). + +\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{xsipne}), +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} + +\medskip +\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: + +\medskip +\begin{verbatim} +\usepackage[c8,margins=6mm,headheight=4mm,headsep=4mm, + croplength=3mm,cropgap=2mm, + cropmarks,cropframe,croptitle=Adjust\ footskip]{zwpagelayout} +\end{verbatim} + +\medskip \noindent +The sample on te right side of the figure was created by: + +\medskip +\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{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. + +\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. + +\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. + +\subsubsection{Option \opt{cropframe}, default \false, standard \true} +\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. Currently only the \textit{default} style is +defined, thus the option is only useful if you write your own extension. + +\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*;\ ;. + +\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{Color support for crop marks} +The package is able to produce 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. + +\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} +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: + +\medskip + +\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} + +\medskip + +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: + +\medskip + +\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} + +\medskip + +Notice that the \opt{colormodel} option was not specified. Its default value was used. The +\opt{cropcolor} option left zero for the yellow separation. + +\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: + +\medskip +\cmd{paperheight} = \opt{topmargin} + \opt{textheight} + \opt{botmargin} + 2 \opt{ytrim} + +\medskip \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: + +\medskip +\cmd{paperwidth} = \opt{leftmargin} + \opt{textwidth} + \opt{rightmargin} + +\medskip \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: + +\medskip +\cmd{textwidth} = \cmd{paperwidth} -- \opt{leftmargin} -- \opt{rightmargin} + +\medskip +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: + +\medskip +\cmd{paperwidth} = \opt{leftmargin} + \opt{flap} + \opt{textwidth} + \opt{xtrim} + +\opt{rightmargin} + +\medskip \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: + +\medskip +\textit{width} = \opt{xspine} + \opt{textwidth} + \opt{flap} + \opt{xtrim} + +\cmd{paperwidth} = \opt{leftmargin} + \opt{spine} + 2 \textit{width} + \opt{rightmargin} + +\medskip \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: + +\medskip +\opt{leftmargin} + \opt{textwidth} + \opt{rightmargin} = \cmd{paperwidth} + +\medskip \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} +\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 and +some driver may get totally confused. 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. + +\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: + +\medskip +\verb;\NewOddPage*[;$\langle$style$\rangle$\verb;]; + +\medskip\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 syntaxe 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: + +\medskip +\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: + +\medskip +\begin{verbatim} +\ifcat$\CropFlap$ + % no flaps +\else + \vbox to \textheight{\hsize\CropFlap + Flap text + }\hss +\fi +\end{verbatim} + +\medskip + +\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}. + +\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: + +\medskip +\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. + +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. + +\enlargethispage*{2in} + +\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} + +\end{document} diff --git a/Master/texmf-dist/tex/latex/zwpagelayout/zwpagelayout.sty b/Master/texmf-dist/tex/latex/zwpagelayout/zwpagelayout.sty new file mode 100644 index 00000000000..cd5e9af9cd6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/zwpagelayout/zwpagelayout.sty @@ -0,0 +1,607 @@ +\ProvidesPackage{zwpagelayout}[2008/12/26 ZW Page Layout] +\PackageInfo{zwpagelayout}{$Id: zwpagelayout.sty 290 2008-12-26 17:43:49Z zw $\@gobble} + +%% Copyright 2008 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. + +\RequirePackage{kvoptions,ifpdf} +\SetupKeyvalOptions{family=zwpl,prefix=zwpl@} + +% 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 +\errorcontextlines 999 + +\DeclareVoidOption{a0}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={841mm,1189mm}}} +\DeclareVoidOption{a1}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={594mm,841mm}}} +\DeclareVoidOption{a2}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={420mm,594mm}}} +\DeclareVoidOption{a3}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={297mm,420mm}}} +\DeclareVoidOption{a4}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={210mm,297mm}}} +\DeclareVoidOption{a5}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={148mm,210mm}}} +\DeclareVoidOption{a6}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={105mm,148mm}}} +\DeclareVoidOption{a7}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={74mm,105mm}}} +\DeclareVoidOption{a8}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={52mm,74mm}}} +\DeclareVoidOption{a9}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={37mm,52mm}}} +\DeclareVoidOption{a10}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={26mm,37mm}}} +\DeclareVoidOption{b0}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={1000mm,1414mm}}} +\DeclareVoidOption{b1}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={707mm,1000mm}}} +\DeclareVoidOption{b2}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={500mm,707mm}}} +\DeclareVoidOption{b3}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={353mm,500mm}}} +\DeclareVoidOption{b4}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={250mm,353mm}}} +\DeclareVoidOption{b5}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={176mm,250mm}}} +\DeclareVoidOption{b6}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={125mm,176mm}}} +\DeclareVoidOption{b7}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={88mm,125mm}}} +\DeclareVoidOption{b8}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={62mm,88mm}}} +\DeclareVoidOption{b9}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={44mm,62mm}}} +\DeclareVoidOption{b10}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={31mm,44mm}}} +\DeclareVoidOption{c0}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={917mm,1279mm}}} +\DeclareVoidOption{c1}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={648mm,917mm}}} +\DeclareVoidOption{c2}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={458mm,648mm}}} +\DeclareVoidOption{c3}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={324mm,458mm}}} +\DeclareVoidOption{c4}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={229mm,324mm}}} +\DeclareVoidOption{c5}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={162mm,229mm}}} +\DeclareVoidOption{c6}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={114mm,162mm}}} +\DeclareVoidOption{c7}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={81mm,114mm}}} +\DeclareVoidOption{c8}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={57mm,81mm}}} +\DeclareVoidOption{c9}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={40mm,57mm}}} +\DeclareVoidOption{c10}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={28mm,40mm}}} +\DeclareVoidOption{letter}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={8.5in,11in}}} +\DeclareVoidOption{legal}{\setkeys{zwpl}{AllowWidthHeightSwitching,papersize={8.5in,14in}}} +\DeclareVoidOption{executive}{\setkeys{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} + +% Color support for cropmarks +\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} + +% Reflect, works with pdftex and dvips + +\def\zwpl@makeHreflect{\AtBeginDocument{\ifpdf + \let\zwpl@Hship\shipout + \def\shipout{\zwpl@Hreflect\zwpl@Hship}\zwpl@Hreflect + \else\zwpl@psHreflect\fi}} + +\def\zwpl@makeVreflect{\AtBeginDocument{\ifpdf + \let\zwpl@Vship\shipout + \def\shipout{\zwpl@Vreflect\zwpl@Vship}\zwpl@Vreflect + \else\zwpl@psVreflect\fi}} + +\DeclareVoidOption{ReflectHorizontally}{\zwpl@makeHreflect} +\DeclareVoidOption{ReflectVertically}{\zwpl@makeVreflect} + +\ProcessKeyvalOptions* + +% Other packages + +\ifzwpl@onlycropmarks + \setkeys{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 + +\AtBeginDocument{\ifpdf + \pdfpagewidth\paperwidth \pdfpageheight\paperheight +\else + \special{papersize=\the\paperwidth,\the\paperheight}\fi} + +\ifcat$\zwpl@margins$ \else + \setkeys{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 + \setkeys{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$ + \setkeys{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} + +% 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 + \ifzwpl@color + \RequirePackage{color} + \else \ifzwpl@nobleedclip \else + \RequirePackage{color} + \fi \fi + \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{\@ifundefined{zwpl@ps@#1}{\zwpl@patchps{#1}}{}\zwpl@next{#1}} + +\def\zwpl@patchps#1{\expandafter\let\csname zwpl@ps@#1\expandafter\endcsname\csname ps@#1\endcsname + \expandafter\def\csname ps@#1\endcsname{\csname zwpl@ps@#1\endcsname \zwpl@patchfoot}} + +\def\zwpl@patchfoot{\let\zwpl@oddfoot\@oddfoot \let\zwpl@evenfoot\@evenfoot + \def\@oddfoot{\zwpl@cropbox\zwpl@oddfoot}% + \def\@evenfoot{\zwpl@cropbox\zwpl@evenfoot}} + +\def\zwpl@cropbox{\rlap{% Some parameters may be changed within the document + \raisebox{\zwpl@low}[\z@][\z@]{\everyvbox{}\offinterlineskip\boxmaxdepth\z@ + \hskip -\hoffset \hskip -1in \hskip - + \ifodd\c@page \oddsidemargin \else \evensidemargin \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 + +\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}} + +\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}} + +\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]} + +\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@printcolor#1:#2:{\edef\zwpl@temp{\noexpand\textcolor[\zwpl@colormodel]{#2}{#1}}\zwpl@temp\space} + +\def\zwpl@showcolors#1,#2*{\zwpl@printcolor#1:% + \ifcat$#2$\let\zwpl@next\relax + \else\def\zwpl@next{\zwpl@showcolors#2*}\fi \zwpl@next} + +\def\zwpl@showallcolors{\raisebox{.2ex}[\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{\zwpl@calcshift\zwpl@Vshift\vsize + \pdfliteral{1 0 0 -1 0 -\the\zwpl@Vshift\space cm}} + +% 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/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 0af6decfd14..b5fa344656d 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -241,7 +241,7 @@ my @WorkingTLP = qw( xkeyval xlop xltxtra xmpincl xnewcommand xoptarg xpackages xq xskak xstring xtab xtcapts xunicode xyling xypic-tut-pt xytree york-thesis yplan - ziffer zwgetfdate + ziffer zwgetfdate zwpagelayout ); diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index 494fc386e39..181c256a93e 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -595,4 +595,5 @@ depend yplan depend zed-csp depend ziffer depend zwgetfdate +depend zwpagelayout depend collection-latex diff --git a/Master/tlpkg/tlpsrc/zwpagelayout.tlpsrc b/Master/tlpkg/tlpsrc/zwpagelayout.tlpsrc new file mode 100644 index 00000000000..b817aed7130 --- /dev/null +++ b/Master/tlpkg/tlpsrc/zwpagelayout.tlpsrc @@ -0,0 +1,2 @@ +name zwpagelayout +category Package |