summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/oberdiek/atbegshi.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-02 21:50:45 +0000
committerKarl Berry <karl@freefriends.org>2012-05-02 21:50:45 +0000
commitaa1776c78dfdb456e2228fbceaa886e64e36174c (patch)
tree7967af7f0f2079a632809a813221918af16ba8cc /Master/texmf-dist/tex/generic/oberdiek/atbegshi.sty
parenta86d14742b305868a1c2b1f33f1263a6b7d0e03d (diff)
oberdiek (1may12)
git-svn-id: svn://tug.org/texlive/trunk@26177 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/oberdiek/atbegshi.sty')
-rw-r--r--Master/texmf-dist/tex/generic/oberdiek/atbegshi.sty321
1 files changed, 242 insertions, 79 deletions
diff --git a/Master/texmf-dist/tex/generic/oberdiek/atbegshi.sty b/Master/texmf-dist/tex/generic/oberdiek/atbegshi.sty
index 120d3b1f319..35436d226c0 100644
--- a/Master/texmf-dist/tex/generic/oberdiek/atbegshi.sty
+++ b/Master/texmf-dist/tex/generic/oberdiek/atbegshi.sty
@@ -9,7 +9,7 @@
%% This is a generated file.
%%
%% Project: atbegshi
-%% Version: 2011/01/30 v1.15
+%% Version: 2011/10/05 v1.16
%%
%% Copyright (C) 2007-2011 by
%% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
@@ -103,7 +103,7 @@
\fi
\expandafter\x\csname ver@atbegshi.sty\endcsname
\ProvidesPackage{atbegshi}%
- [2011/01/30 v1.15 At begin shipout hook (HO)]%
+ [2011/10/05 v1.16 At begin shipout hook (HO)]%
\begingroup\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
\endlinechar=13 %
@@ -237,36 +237,32 @@ X \endgroup
\else
\AtBegShi@First
\let\protect\AtBegShi@OrgProtect
+ \AtBegShi@GetBoxSize\AtBeginShipoutBox
+ \ltx@ifundefined{AtNextShipout}{%
+ }{%
+ \AtNextShipout{\AtBegShi@GetBoxSize\@cclv}%
+ }%
\AtBeginShipoutOriginalShipout\box\AtBeginShipoutBox
\fi
\fi
}
+\def\AtBegShi@GetBoxSize#1{%
+ \xdef\AtBeginShipoutBoxWidth{\the\wd#1}%
+ \xdef\AtBeginShipoutBoxHeight{\the\ht#1}%
+ \xdef\AtBeginShipoutBoxDepth{\the\dp#1}%
+}
+\def\AtBeginShipoutBoxWidth{0pt}
+\def\AtBeginShipoutBoxHeight{0pt}
+\def\AtBeginShipoutBoxDepth{0pt}
\catcode`\X=11 %
\catcode`\E=11 %
\def\AtBegShi@First{%
- \begingroup
- \def\@empty{}%
- \ifx\AtBegShi@HookFirst\@empty
- \else
- \setbox\ltx@zero=\vbox{%
- \begingroup
- \AtBegShi@HookFirst
- \endgroup
- }%
- \wd\ltx@zero=0pt %
- \ht\ltx@zero=0pt %
- \dp\ltx@zero=0pt %
- \global\setbox\AtBeginShipoutBox=\vbox{%
- \baselineskip 0pt\relax
- \lineskip 0pt\relax
- \lineskiplimit 0pt\relax
- \copy\ltx@zero
- \copy\AtBeginShipoutBox
- }%
- \fi
- \global\let\AtBegShi@First\@empty
- \global\let\AtBeginShipoutFirst\AtBegShi@FirstDisabled
- \endgroup
+ \ifx\AtBegShi@HookFirst\ltx@empty
+ \else
+ \AtBeginShipoutAddToBox{\AtBegShi@HookFirst}%
+ \fi
+ \global\let\AtBegShi@First\ltx@empty
+ \global\let\AtBeginShipoutFirst\AtBegShi@FirstDisabled
}
\gdef\AtBegShi@Hook{}
\gdef\AtBegShi@HookNext{}
@@ -340,11 +336,138 @@ X \endgroup
\else
\AtBeginDocument{\AtBeginShipoutInit}%
\fi
+\def\AtBeginShipoutAddToBox#1{%
+ \ifhbox\AtBeginShipoutBox
+ \edef\AtBegShi@restore{%
+ \hfuzz=\the\hfuzz\relax
+ \hbadness=\the\hbadness\relax
+ }%
+ \hfuzz=1073741823sp\relax
+ \hbadness=2147483647\relax
+ \setbox\AtBeginShipoutBox=\hbox to \wd\AtBeginShipoutBox{%
+ \setbox\ltx@zero=\hbox{%
+ \begingroup
+ \AtBegShi@restore
+ #1%
+ \endgroup
+ }%
+ \wd\ltx@zero=0pt\relax
+ \ht\ltx@zero=0pt\relax
+ \dp\ltx@zero=0pt\relax
+ \raise\ht\AtBeginShipoutBox\copy\ltx@zero
+ \unhcopy\AtBeginShipoutBox
+ }%
+ \AtBegShi@restore
+ \else
+ \ifvbox\AtBeginShipoutBox
+ \edef\AtBegShi@restore{%
+ \vfuzz=\the\vfuzz\relax
+ \vbadness=\the\vbadness\relax
+ \dimen\ltx@zero=\the\dimen\ltx@zero\relax
+ }%
+ \edef\AtBegShi@restorebox{%
+ \ht\AtBeginShipoutBox=\the\ht\AtBeginShipoutBox\relax
+ \dp\AtBeginShipoutBox=\the\dp\AtBeginShipoutBox\relax
+ }%
+ \vfuzz=1073741823sp\relax
+ \vbadness=2147483647\relax
+ \dimen\ltx@zero=\ht\AtBeginShipoutBox
+ \advance\dimen\ltx@zero by \dp\AtBeginShipoutBox
+ \setbox\AtBeginShipoutBox=\vbox to \dimen\ltx@zero{%
+ \setbox\ltx@zero=\hbox{%
+ \begingroup
+ \AtBegShi@restore
+ #1%
+ \endgroup
+ }%
+ \wd\ltx@zero=0pt\relax
+ \ht\ltx@zero=0pt\relax
+ \dp\ltx@zero=0pt\relax
+ \baselineskip=0pt\relax
+ \lineskip=0pt\relax
+ \lineskiplimit=0pt\relax
+ \copy\ltx@zero
+ \unvbox\AtBeginShipoutBox
+ \kern0pt%
+ }%
+ \AtBegShi@restore
+ \AtBegShi@restorebox
+ \fi
+ \fi
+}
+\def\AtBeginShipoutAddToBoxForeground#1{%
+ \ifhbox\AtBeginShipoutBox
+ \edef\AtBegShi@restore{%
+ \hfuzz=\the\hfuzz\relax
+ \hbadness=\the\hbadness\relax
+ }%
+ \hfuzz=1073741823sp\relax
+ \hbadness=2147483647\relax
+ \setbox\AtBeginShipoutBox=\hbox to \wd\AtBeginShipoutBox{%
+ \unhcopy\AtBeginShipoutBox
+ \kern-\wd\AtBeginShipoutBox
+ \setbox\ltx@zero=\hbox{%
+ \begingroup
+ \AtBegShi@restore
+ #1%
+ \endgroup
+ }%
+ \wd\ltx@zero=0pt\relax
+ \ht\ltx@zero=0pt\relax
+ \dp\ltx@zero=0pt\relax
+ \raise\ht\AtBeginShipoutBox\copy\ltx@zero
+ \kern\wd\AtBeginShipoutBox
+ }%
+ \AtBegShi@restore
+ \else
+ \ifvbox\AtBeginShipoutBox
+ \edef\AtBegShi@restore{%
+ \vfuzz=\the\vfuzz\relax
+ \vbadness=\the\vbadness\relax
+ \dimen\ltx@zero=\the\dimen\ltx@zero\relax
+ }%
+ \edef\AtBegShi@restorebox{%
+ \ht\AtBeginShipoutBox=\the\ht\AtBeginShipoutBox\relax
+ \dp\AtBeginShipoutBox=\the\dp\AtBeginShipoutBox\relax
+ }%
+ \vfuzz=1073741823sp\relax
+ \vbadness=2147483647\relax
+ \dimen\ltx@zero=\ht\AtBeginShipoutBox
+ \advance\dimen\ltx@zero by \dp\AtBeginShipoutBox
+ \setbox\AtBeginShipoutBox=\vbox to \dimen\ltx@zero{%
+ \setbox\ltx@zero=\hbox{%
+ \begingroup
+ \AtBegShi@restore
+ #1%
+ \endgroup
+ }%
+ \wd\ltx@zero=0pt\relax
+ \ht\ltx@zero=0pt\relax
+ \dp\ltx@zero=0pt\relax
+ \baselineskip=0pt\relax
+ \lineskip=0pt\relax
+ \lineskiplimit=0pt\relax
+ \unvbox\AtBeginShipoutBox
+ \kern-\dimen\ltx@zero
+ \copy\ltx@zero
+ \kern\dimen\ltx@zero
+ }%
+ \AtBegShi@restore
+ \AtBegShi@restorebox
+ \fi
+ \fi
+}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname RequirePackage\endcsname\relax
- \input ifpdf.sty\relax
+ \def\TMP@RequirePackage#1[#2]{%
+ \begingroup\expandafter\expandafter\expandafter\endgroup
+ \expandafter\ifx\csname ver@#1.sty\endcsname\relax
+ \input #1.sty\relax
+ \fi
+ }%
+ \TMP@RequirePackage{ifpdf}[2011/01/30]%
\else
- \RequirePackage{ifpdf}\relax
+ \RequirePackage{ifpdf}[2011/01/30]%
\fi
\ifpdf
\def\AtBegShi@horigin{\pdfhorigin}%
@@ -395,38 +518,27 @@ X \endgroup
}%
\fi
\def\AtBeginShipoutUpperLeft#1{%
- \global\setbox\AtBeginShipoutBox=\hbox{%
- \rlap{%
- \kern-\AtBegShi@horigin\relax
- \vbox to 0pt{%
- \kern-\AtBegShi@vorigin\relax
- \kern-\ht\AtBeginShipoutBox
- \AtBegShi@BeginPicture
- #1%
- \AtBegShi@EndPicture
- \vss
- }%
+ \AtBeginShipoutAddToBox{%
+ \kern-\AtBegShi@horigin\relax
+ \vbox to 0pt{%
+ \kern-\AtBegShi@vorigin\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
}%
- \box\AtBeginShipoutBox
}%
}
\def\AtBeginShipoutUpperLeftForeground#1{%
- \global\setbox\AtBeginShipoutBox=\hbox to \wd\AtBeginShipoutBox{%
- \rlap{%
- \copy\AtBeginShipoutBox
+ \AtBeginShipoutAddToBoxForeground{%
+ \kern-\AtBegShi@horigin\relax
+ \vbox to 0pt{%
+ \kern-\AtBegShi@vorigin\relax
+ \AtBegShi@BeginPicture
+ #1%
+ \AtBegShi@EndPicture
+ \vss
}%
- \rlap{%
- \kern-\AtBegShi@horigin\relax
- \vbox to 0pt{%
- \kern-\AtBegShi@vorigin\relax
- \kern-\ht\AtBeginShipoutBox
- \AtBegShi@BeginPicture
- #1%
- \AtBegShi@EndPicture
- \vss
- }%
- }%
- \hss
}%
}
\def\AtBegShi@AbortIfUndefined#1{%
@@ -508,6 +620,7 @@ X \endgroup
\setbox\AtBeginShipoutBox=\vbox{%
\CROP@shiplist
}%
+ \AtBegShi@GetBoxSize\AtBeginShipoutBox
\expandafter\CROP@shipout
\expandafter\box
\expandafter\AtBeginShipoutBox
@@ -624,16 +737,81 @@ X \endgroup
}%
\fi
}%
+ \def\AtBegShi@Memoir@PatchAB{%
+ \ifvoid\AtBeginShipoutBox
+ \else
+ \setbox\AtBeginShipoutBox=\vbox{%
+ \trimmarks
+ \ifvbox\AtBeginShipoutBox
+ \unvbox\AtBeginShipoutBox
+ \else
+ \box\AtBeginShipoutBox
+ \fi
+ }%
+ \AtBegShi@GetBoxSize\AtBeginShipoutBox
+ \expandafter\mem@oldshipout
+ \expandafter\box
+ \expandafter\AtBeginShipoutBox
+ \fi
+ }%
+ \def\AtBegShi@Memoir@shipiiC{% 2008/08/07 v1.6180339a
+ \ifvoid\@cclv
+ \mem@oldshipout\box\@cclv
+ \else
+ \ifshowtrims
+ \mem@oldshipout\vbox{\trimmarks\unvbox\@cclv}%
+ \else
+ \mem@oldshipout\box\@cclv
+ \fi
+ \fi
+ }%
+ \def\AtBegShi@Memoir@shipiiD{% 2011/03/06 v3.6j
+ \ifvoid\@cclv
+ \mem@oldshipout\box\@cclv
+ \else
+ \ifshowtrims
+ \mem@oldshipout\vbox{%
+ \trimmarks
+ \nointerlineskip
+ \box\@cclv
+ }%
+ \else
+ \mem@oldshipout\box\@cclv
+ \fi
+ \fi
+ }%
+ \def\AtBegShi@Memoir@PatchCD{%
+ \ifvoid\AtBeginShipoutBox
+ \else
+ \ifshowtrims
+ \setbox\AtBeginShipoutBox=\vbox{%
+ \trimmarks
+ \nointerlineskip
+ \box\AtBeginShipoutBox
+ }%
+ \fi
+ \AtBegShi@GetBoxSize\AtBeginShipoutBox
+ \expandafter\mem@oldshipout
+ \expandafter\box
+ \expandafter\AtBeginShipoutBox
+ \fi
+ }%
\ifx\AtBegShi@Memoir@shipi\mem@shipi
- \ifcase\ifx\AtBegShi@Memoir@shipiiA\mem@shipii
- \ltx@zero
- \else
- \ifx\AtBegShi@Memoir@shipiiB\mem@shipii
- \ltx@zero
- \else
- \ltx@one
- \fi
- \fi
+ \let\AtBegShi@found\ltx@one
+ \ifx\AtBegShi@Memoir@shipiiA\mem@shipii
+ \let\AtBegShi@found\ltx@zero
+ \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchAB
+ \else\ifx\AtBegShi@Memoir@shipiiB\mem@shipii
+ \let\AtBegShi@found\ltx@zero
+ \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchAB
+ \else\ifx\AtBegShi@Memoir@shipiiC\mem@shipii
+ \let\AtBegShi@found\ltx@zero
+ \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchCD
+ \else\ifx\AtBegShi@Memoir@shipiiD\mem@shipii
+ \let\AtBegShi@found\ltx@zero
+ \global\let\AtBegShi@Memoir@PatchX\AtBegShi@Memoir@PatchCD
+ \fi\fi\fi\fi
+ \ifcase\AtBegShi@found
\let\AtBegShi@found\relax
\ifx\shipout\AtBegShi@Memoir@shipout
\def\AtBegShi@found{\shipout}%
@@ -663,22 +841,7 @@ X \endgroup
\fi
\mem@shipii
}%
- \def\mem@shipii{%
- \ifvoid\AtBeginShipoutBox
- \else
- \setbox\AtBeginShipoutBox=\vbox{%
- \trimmarks
- \ifvbox\AtBeginShipoutBox
- \unvbox\AtBeginShipoutBox
- \else
- \box\AtBeginShipoutBox
- \fi
- }%
- \expandafter\mem@oldshipout
- \expandafter\box
- \expandafter\AtBeginShipoutBox
- \fi
- }%
+ \let\mem@shipii\AtBegShi@Memoir@PatchX
\@PackageInfoNoLine{atbegshi}{Class `memoir' patched}%
\begingroup
\fi