summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-13 00:10:00 +0000
committerKarl Berry <karl@freefriends.org>2006-01-13 00:10:00 +0000
commit81356b8d1c21f2454140b6da4880d64736b6dc4f (patch)
tree531bd3f17be785ac28c49ed99b5f4975290e0d2c /Master
parentd0c805011e1d1f1233397e413776abc062d4f8b6 (diff)
twoup
git-svn-id: svn://tug.org/texlive/trunk@1412 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/tex/latex/twoup/twoup.sty187
1 files changed, 187 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/twoup/twoup.sty b/Master/texmf-dist/tex/latex/twoup/twoup.sty
new file mode 100644
index 00000000000..112958cd8de
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/twoup/twoup.sty
@@ -0,0 +1,187 @@
+%%
+%% This is file `twoup.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% twoup.dtx (with options: `package')
+%%
+%%
+%% This is the twoup package
+%% Copyright 2005 by Mogens Lemvig Hansen,
+%% mlhansen@uniserve.com
+%%
+%% Run twoup.dtx through LaTeX and read the documentation in twoup.dvi
+%%
+%% 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 2003/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% This Current Maintainer of this work is Mogens Lemvig Hansen.
+%%
+%% This work consists of the files twoup.dtx and twoup.ins
+%% and the derived file twoup.sty.
+%%
+\NeedsTeXFormat{LaTeX2e}%
+\ProvidesPackage{twoup}[2005/07/25 version 1.2]
+\DeclareOption{noheadfoot}{%
+ \setlength{\headheight}{0pt}%
+ \setlength{\headsep}{0pt}%
+ \setlength{\footskip}{0pt}%
+ \let\ps@plain\ps@empty
+ \pagestyle{empty}}
+\DeclareOption{nofoot}{%
+ \setlength{\footskip}{0pt}%
+ \let\ps@plain\ps@empty
+ \pagestyle{headings}}
+\DeclareOption{nohead}{%
+ \setlength{\headheight}{0pt}%
+ \setlength{\headsep}{0pt}%
+ \pagestyle{plain}}
+\DeclareOption{letterpaper}{%
+ \def\TwoUp@info{-pletter -W5.5in -H8.5in}%
+ \def\TwoUp@paper{letter}}%
+\DeclareOption{legalpaper}{%
+ \def\TwoUp@info{-plegal -W7in -H8.5in}%
+ \def\TwoUp@paper{legal}}%
+\DeclareOption{executivepaper}{%
+ \def\TwoUp@info{-pexecutive -W5.25in -H7.25in}%
+ \def\TwoUp@paper{executive}}%
+\DeclareOption{a4paper}{%
+ \def\TwoUp@info{-pa4 -Pa5}%
+ \def\TwoUp@paper{a4}}%
+\DeclareOption{a5paper}{%
+ \def\TwoUp@info{-pa5 -W105mm -H148mm}%
+ \def\TwoUp@paper{a5}}%
+\DeclareOption{b5paper}{%
+ \def\TwoUp@info{-pb5 -W125mm -H176mm}%
+ \def\TwoUp@paper{b5}}%
+\DeclareOption{dvips}{%
+ \def\TwoUp@special{%
+ \special{papersize=\the\paperwidth,\the\paperheight}}}
+\DeclareOption{nospecial}{%
+ \def\TwoUp@special{\relax}}
+\ExecuteOptions{dvips}
+\ProcessOptions
+\ifx\TwoUp@info\undefined
+ \setlength{\@tempdima}{8.5in}
+ \ifdim\paperwidth=\@tempdima
+ \setlength{\@tempdima}{11in}
+ \ifdim\paperheight=\@tempdima
+ \def\TwoUp@info{-pletter -W5.5in -H8.5in}
+ \fi
+ \setlength{\@tempdima}{14in}
+ \ifdim\paperheight=\@tempdima
+ \def\TwoUp@info{-plegal -W7in -H8.5in}
+ \fi
+ \fi
+ \setlength{\@tempdima}{210mm}
+ \ifdim\paperwidth=\@tempdima
+ \setlength{\@tempdima}{297mm}
+ \ifdim\paperheight=\@tempdima
+ \def\TwoUp@info{-pa4 -Pa5}
+ \fi
+ \fi
+\fi
+\ifx\TwoUp@info\undefined
+ \PackageWarningNoLine{twoup}{Unknown paper size.
+ You may want to use a \MessageBreak
+ paper size option like letterpaper}
+ \setlength{\@tempdima}{0.99627\paperwidth}
+ \@settopoint\@tempdima
+ \edef\TwoUp@info{-w\the\@tempdima}
+ \setlength{\@tempdima}{0.99627\paperheight}
+ \@settopoint\@tempdima
+ \edef\TwoUp@info{\TwoUp@info\space -h\the\@tempdima}
+ \setlength{\@tempdima}{0.5\paperheight}
+ \setlength{\@tempdima}{0.99627\@tempdima}
+ \@settopoint\@tempdima
+ \edef\TwoUp@info{\TwoUp@info\space -W\the\@tempdima}
+ \setlength{\@tempdima}{0.99627\paperwidth}
+ \@settopoint\@tempdima
+ \edef\TwoUp@info{\TwoUp@info\space -H\the\@tempdima}
+\fi
+\setlength{\@tempdima}{\paperwidth}
+\setlength{\paperwidth}{0.5\paperheight}
+\setlength{\paperheight}{\@tempdima}
+\@ifpackageloaded{2up}{%
+ \source{\magstep0}{\paperwidth}{\paperheight}%
+ \target{\magstep0}{2\paperwidth}{\paperheight}%
+}{%
+\@ifpackageloaded{booklet}{%
+ \source{\magstep0}{\paperwidth}{\paperheight}%
+ \target{\magstep0}{2\paperwidth}{\paperheight}%
+}{%
+ \TwoUp@special
+ \AtEndDocument{\typeout{^^J%
+ Package twoup Info: Use psnup with these options:^^J%
+ psnup \TwoUp@info\space -2 \jobname.ps twoup.ps^^J}}
+ \ifx\TwoUp@paper\undefined\else
+ \AtEndDocument{\typeout{^^J%
+ Package twoup Info: You may have to add these
+ three lines to your .ps file:^^J%
+ \@percentchar\@percentchar BeginPaperSize: \TwoUp@paper^^J%
+ \TwoUp@paper^^J%
+ \@percentchar\@percentchar EndPaperSize^^J}}
+ \fi%
+}}%
+\setlength{\@tempdima}{1in}
+\setlength{\textwidth}{\paperwidth}
+\addtolength{\textwidth}{-\@tempdima}
+\if@twoside
+ \setlength{\evensidemargin}{0.33\@tempdima}
+ \setlength{\oddsidemargin}{\@tempdima}
+ \addtolength{\oddsidemargin}{-\evensidemargin}
+\else
+ \setlength{\oddsidemargin}{0.5\@tempdima}
+ \setlength{\evensidemargin}{\oddsidemargin}
+\fi
+\addtolength{\oddsidemargin}{-1in}
+\addtolength{\evensidemargin}{-1in}
+\setlength{\topmargin}{0.5in}
+\setlength{\textheight}{\paperheight}
+\addtolength{\textheight}{-2\topmargin}
+\addtolength{\textheight}{-\headheight}
+\addtolength{\textheight}{-\headsep}
+\addtolength{\textheight}{-\footskip}
+\addtolength{\textheight}{-\topskip}
+\divide\textheight\baselineskip
+\@tempcnta\textheight
+\setlength{\textheight}{\@tempcnta\baselineskip}
+\addtolength{\textheight}{\topskip}
+\addtolength{\topmargin}{-1in}
+\newcommand{\cleartolastpage}{%
+ \clearpage
+ \@ifstar
+ {\def\TwoUp@blankpagestyle{\thispagestyle{empty}}\cleartolastp@ge}
+ {\let\TwoUp@blankpagestyle\relax\cleartolastp@ge}}
+\if@twoside
+ \newcommand{\cleartolastp@ge}[1][4]{%
+ \@tempcnta#1\relax
+ \cleartol@stp@ge}%
+\else
+ \newcommand{\cleartolastp@ge}[1][2]{%
+ \@tempcnta#1\relax
+ \cleartol@stp@ge}%
+\fi
+\newcommand{\cleartol@stp@ge}[1][0]{%
+ \@tempcntb\c@page
+ \divide\@tempcntb\@tempcnta
+ \multiply\@tempcntb\@tempcnta
+ \advance\@tempcntb#1\relax
+ \ifnum\@tempcntb<\c@page
+ \advance\@tempcntb\@tempcnta
+ \fi
+ \loop\ifnum\c@page<\@tempcntb
+ \hbox{}\TwoUp@blankpagestyle\newpage
+ \repeat
+}
+\endinput
+%%
+%% End of file `twoup.sty'.