diff options
author | Karl Berry <karl@freefriends.org> | 2007-12-15 00:23:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-12-15 00:23:34 +0000 |
commit | 116405a01899ba783a14653896d02888e298fbb1 (patch) | |
tree | a18817a449117e864d52b1cf21f5be0eac3ed7cb /Master/texmf-dist/tex/latex/oberdiek/pdfcolparallel.sty | |
parent | 61cc3ba9dfd27cde051a486dad06940dfff0e699 (diff) |
oberdiek: luacolor1.0 luatex1.0 ... (14dec07)
git-svn-id: svn://tug.org/texlive/trunk@5785 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/pdfcolparallel.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/pdfcolparallel.sty | 341 |
1 files changed, 202 insertions, 139 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/pdfcolparallel.sty b/Master/texmf-dist/tex/latex/oberdiek/pdfcolparallel.sty index 78816fe980a..6ec6d181f7e 100644 --- a/Master/texmf-dist/tex/latex/oberdiek/pdfcolparallel.sty +++ b/Master/texmf-dist/tex/latex/oberdiek/pdfcolparallel.sty @@ -29,33 +29,46 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{pdfcolparallel}% - [2007/09/09 v1.0 Color stacks support for parallel (HO)]% + [2007/12/12 v1.1 Fixed parallel with color stacks support (HO)]% \DeclareOption*{% \PassoptionsToPackage{\CurrentOption}{parallel}% } \ProcessOptions\relax \RequirePackage{parallel}[2003/04/13] -\RequirePackage{pdfcol}[2007/09/09] -\ifpdfcolAvailable +\RequirePackage{infwarerr}[2007/09/09] +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname currentgrouplevel\endcsname\relax + \def\pcp@ColorPatch{}% \else - \PackageInfo{pdfcolparallel}{% - Loading aborted, because color stacks are not available% + \def\pcp@ColorPatch{% + \@ifundefined{set@color}{% + \gdef\pcp@ColorPatch{}% + }{% + \gdef\pcp@ColorPatch{% + \gdef\pcp@ColorResets{}% + \bgroup + \aftergroup\pcp@ColorResets + \aftergroup\egroup + \let\pcp@OrgSetColor\set@color + \let\set@color\pcp@SetColor + \edef\pcp@GroupLevel{\the\currentgrouplevel}% + }% + }% + \pcp@ColorPatch + }% + \def\pcp@SetColor{% + \ifnum\pcp@GroupLevel=\currentgrouplevel + \let\pcp@OrgAfterGroup\aftergroup + \def\aftergroup{% + \g@addto@macro\pcp@ColorResets + }% + \pcp@OrgSetColor + \let\aftergroup\pcp@OrgAfterGroup + \else + \pcp@OrgSetColor + \fi }% - \expandafter\endinput \fi -\RequirePackage{infwarerr}[2007/09/09] -\pdfcolInitStack{pcp@Left} -\pdfcolInitStack{pcp@Right} -\def\pcp@SwitchStack#1{% - \pdfcolSwitchStack{pcp@#1}% -} -\def\pcp@SetCurrent#1{% - \ifx\\#1\\% - \pdfcolSetCurrent{}% - \else - \pdfcolSetCurrent{pcp@#1}% - \fi -} \def\pcp@CmdCheckRedef#1{% \begingroup \def\pcp@cmd{#1}% @@ -77,6 +90,8 @@ \expandafter\endgroup \expandafter\def\pcp@cmd } +\def\pcp@SwitchStack#1#2{} +\def\pcp@SetCurrent#1{} \pcp@CmdCheckRedef\ParallelLText{% \everypar{}% \@restorepar @@ -93,14 +108,17 @@ }{% \everypar{}% \@restorepar + \@nobreakfalse \begingroup \hbadness=3000 % \let\footnote=\ParallelLFootnote \ParallelWhichBox=0 % \global\setbox\ParallelLBox=\vbox\bgroup \hsize=\ParallelLWidth - \pcp@SwitchStack{Left}% + \linewidth=\ParallelLWidth + \pcp@SwitchStack{Left}\ParallelLBox \aftergroup\ParallelAfterText + \pcp@ColorPatch \begingroup \afterassignment\ParallelCheckOpenBrace \let\x=% @@ -125,6 +143,7 @@ }{% \everypar{}% \@restorepar + \@nobreakfalse \begingroup \hbadness=3000 % \ifnum\ParallelFNMode=\@ne @@ -135,12 +154,174 @@ \ParallelWhichBox=\@ne \global\setbox\ParallelRBox=\vbox\bgroup \hsize=\ParallelRWidth - \pcp@SwitchStack{Right}% + \linewidth=\ParallelRWidth + \pcp@SwitchStack{Right}\ParallelRBox \aftergroup\ParallelAfterText + \pcp@ColorPatch \begingroup \afterassignment\ParallelCheckOpenBrace \let\x=% } +\pcp@CmdCheckRedef\ParallelParTwoPages{% + \ifnum\ParallelBoolVar=\@ne + \par + \begingroup + \global\ParallelWhichBox=\@ne + \newpage + \vbadness=10000 % + \vfuzz=3ex % + \splittopskip=\z@skip + \loop% + \ifnum\ParallelBoolVar=\@ne% + \ifnum\ParallelWhichBox=\@ne + \ifvoid\ParallelLBox + \mbox{} % + \newpage + \else + \global\ParallelWhichBox=\z@ + \fi + \else + \ifvoid\ParallelRBox + \mbox{} % + \newpage + \else + \global\ParallelWhichBox=\@ne + \fi + \fi + \ifnum\ParallelWhichBox=\z@ + \ifodd\thepage + \mbox{} % + \newpage + \fi + \hbox to\textwidth{% + \vbox{\vsplit\ParallelLBox to.98\textheight}% + }% + \else + \ifodd\thepage\relax + \else + \mbox{} % + \newpage + \fi + \hbox to\textwidth{% + \vbox{\vsplit\ParallelRBox to.98\textheight}% + }% + \fi + \vspace*{\fill}% + \newpage + \fi + \ifvoid\ParallelLBox + \ifvoid\ParallelRBox + \global\ParallelBoolVar=\z@ + \fi + \fi + \ifnum\ParallelBoolVar=\@ne + \repeat + \par + \endgroup + \fi +}{% + \ifnum\ParallelBoolVar=\@ne + \par + \begingroup + \global\ParallelWhichBox=\@ne + \newpage + \vbadness=10000 % + \vfuzz=3ex % + \splittopskip=\z@skip + \loop% + \ifnum\ParallelBoolVar=\@ne% + \ifnum\ParallelWhichBox=\@ne + \ifvoid\ParallelLBox + \mbox{}% + \newpage + \else + \global\ParallelWhichBox=\z@ + \fi + \else + \ifvoid\ParallelRBox + \null + \newpage + \else + \global\ParallelWhichBox=\@ne + \fi + \fi + \ifnum\ParallelWhichBox=\z@ + \ifodd\value{page}% + \null + \newpage + \fi + \hbox to\textwidth{% + \pcp@SetCurrent{Left}% + \setbox\z@=\vsplit\ParallelLBox to.98\textheight + \vbox to.98\textheight{% + \@texttop + \unvbox\z@ + \@textbottom + }% + }% + \else + \ifodd\value{page}% + \else + \mbox{}% + \newpage + \fi + \hbox to\textwidth{% + \pcp@SetCurrent{Right}% + \setbox\z@=\vsplit\ParallelRBox to.98\textheight + \vbox to.98\textheight{% + \@texttop + \unvbox\z@ + \@textbottom + }% + }% + \fi + \vspace*{\fill}% + \newpage + \fi + \ifvoid\ParallelLBox + \ifvoid\ParallelRBox + \global\ParallelBoolVar=\z@ + \fi + \fi + \ifnum\ParallelBoolVar=\@ne + \repeat + \par + \endgroup + \pcp@SetCurrent{}% + \fi +} +\RequirePackage{pdfcol}[2007/12/12] +\ifpdfcolAvailable +\else + \PackageInfo{pdfcolparallel}{% + Loading aborted, because color stacks are not available% + }% + \expandafter\endinput +\fi +\pdfcolInitStack{pcp@Left} +\pdfcolInitStack{pcp@Right} +\newbox\pcp@Box +\def\pcp@SwitchStack#1#2{% + \pdfcolSwitchStack{pcp@#1}% + \global\setbox\pcp@Box=\vbox to 0pt{% + \pdfcolSetCurrentColor + }% + \aftergroup\pcp@FixBox + \aftergroup#2% +} +\def\pcp@FixBox#1{% + \global\setbox#1=\vbox{% + \unvbox\pcp@Box + \unvbox#1% + }% +} +\def\pcp@SetCurrent#1{% + \ifx\\#1\\% + \pdfcolSetCurrent{}% + \else + \pdfcolSetCurrent{pcp@#1}% + \fi +} \pcp@CmdCheckRedef\ParallelParOnePage{% \ifnum\ParallelBoolVar=\@ne \par @@ -263,124 +444,6 @@ \pcp@SetCurrent{}% \fi } -\pcp@CmdCheckRedef\ParallelParTwoPages{% - \ifnum\ParallelBoolVar=\@ne - \par - \begingroup - \global\ParallelWhichBox=\@ne - \newpage - \vbadness=10000 % - \vfuzz=3ex % - \splittopskip=\z@skip - \loop% - \ifnum\ParallelBoolVar=\@ne% - \ifnum\ParallelWhichBox=\@ne - \ifvoid\ParallelLBox - \mbox{} % - \newpage - \else - \global\ParallelWhichBox=\z@ - \fi - \else - \ifvoid\ParallelRBox - \mbox{} % - \newpage - \else - \global\ParallelWhichBox=\@ne - \fi - \fi - \ifnum\ParallelWhichBox=\z@ - \ifodd\thepage - \mbox{} % - \newpage - \fi - \hbox to\textwidth{% - \vbox{\vsplit\ParallelLBox to.98\textheight}% - }% - \else - \ifodd\thepage\relax - \else - \mbox{} % - \newpage - \fi - \hbox to\textwidth{% - \vbox{\vsplit\ParallelRBox to.98\textheight}% - }% - \fi - \vspace*{\fill}% - \newpage - \fi - \ifvoid\ParallelLBox - \ifvoid\ParallelRBox - \global\ParallelBoolVar=\z@ - \fi - \fi - \ifnum\ParallelBoolVar=\@ne - \repeat - \par - \endgroup - \fi -}{% - \ifnum\ParallelBoolVar=\@ne - \par - \begingroup - \global\ParallelWhichBox=\@ne - \newpage - \vbadness=10000 % - \vfuzz=3ex % - \splittopskip=\z@skip - \loop% - \ifnum\ParallelBoolVar=\@ne% - \ifnum\ParallelWhichBox=\@ne - \ifvoid\ParallelLBox - \mbox{}% - \newpage - \else - \global\ParallelWhichBox=\z@ - \fi - \else - \ifvoid\ParallelRBox - \mbox{}% - \newpage - \else - \global\ParallelWhichBox=\@ne - \fi - \fi - \ifnum\ParallelWhichBox=\z@ - \ifodd\value{page}% - \mbox{}% - \newpage - \fi - \hbox to\textwidth{% - \pcp@SetCurrent{Left}% - \vbox{\vsplit\ParallelLBox to.98\textheight}% - }% - \else - \ifodd\value{page}% - \else - \mbox{}% - \newpage - \fi - \hbox to\textwidth{% - \pcp@SetCurrent{Right}% - \vbox{\vsplit\ParallelRBox to.98\textheight}% - }% - \fi - \vspace*{\fill}% - \newpage - \fi - \ifvoid\ParallelLBox - \ifvoid\ParallelRBox - \global\ParallelBoolVar=\z@ - \fi - \fi - \ifnum\ParallelBoolVar=\@ne - \repeat - \par - \endgroup - \pcp@SetCurrent{}% - \fi -} \endinput %% %% End of file `pdfcolparallel.sty'. |