summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-05-18 21:10:33 +0000
committerKarl Berry <karl@freefriends.org>2018-05-18 21:10:33 +0000
commit9424a02f7752bcd23d3fee2b2d7562c9673dd0b7 (patch)
tree07539f8dc0df715b3ee55742268918765094d02d /Master/texmf-dist/tex/latex
parentba6a7f3dac02de9bf3c4f3aaccff1ae255114de7 (diff)
paracol (18may18)
git-svn-id: svn://tug.org/texlive/trunk@47750 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/paracol/paracol.sty360
1 files changed, 191 insertions, 169 deletions
diff --git a/Master/texmf-dist/tex/latex/paracol/paracol.sty b/Master/texmf-dist/tex/latex/paracol/paracol.sty
index 17a55ec5a2e..16f777532c7 100644
--- a/Master/texmf-dist/tex/latex/paracol/paracol.sty
+++ b/Master/texmf-dist/tex/latex/paracol/paracol.sty
@@ -1,5 +1,5 @@
%% Style file `paracol'.
-%% Copyright (C) 2005-2015
+%% Copyright (C) 2005-2018
%% Hiroshi Nakashima <h.nakashima@DOMAIN; DOMAIN=media.kyoto-u.ac.jp>
%% (Kyoto University)
%% This program can be redistributed and/or modified under the terms
@@ -9,7 +9,7 @@
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{paracol}
-[2015/10/10 v1.32 ]
+[2018/05/07 v1.34 ]
%% Register Declaration
@@ -58,13 +58,22 @@
\newbox\pcol@topfnotes
\newbox\pcol@prespan \setbox\pcol@prespan\box\voidb@x
\newbox\pcol@rightpage \global\setbox\pcol@rightpage\box\voidb@x
-\newbox\pcol@tempbox
+\newbox\pcol@colorstack@saved
+\newbox\pcol@tempboxa
+\newbox\pcol@tempboxb
+\newinsert\pcol@colorins
+\count\pcol@colorins\z@ \skip\pcol@colorins\z@ \dimen\pcol@colorins\maxdimen
\newtoks\pcol@everyvbox
%% Logging Tools
-\def\pcol@ShowBox#1{\message{(\the\ht#1+\the\dp#1)x(\the\wd#1)}%
- {\showboxdepth\@M \showboxbreadth\@M \setbox\z@\vbox to\z@{\copy#1}}}
+\def\pcol@ShowBox#1{%
+ \ifvoid#1\message{(VOID)}%
+ \else
+ \message{(\the\ht#1+\the\dp#1)x(\the\wd#1)}%
+ {\vfuzz\z@ \showboxdepth\@M \showboxbreadth\@M
+ \setbox\z@\vbox to\z@{\ifdim\ht#1=\z@ \vskip1\p@\fi \copy#1}}%
+ \fi}
\def\pcol@LogLevel#1#2#3{%
\pcol@iLogLevel{#1}{pcol@Log}%
\pcol@iLogLevel{#2}{pcol@Logstart}%
@@ -126,7 +135,7 @@
\@makecol
\@opcol
\@startcolumn
- \@whilesw\if@fcolmade\fi{\@opcol\@startcolumn}%
+ \@whilesw\if@fcolmade\fi{\@opcol \@startcolumn}%
\fi\fi
\global\maxdepth\@maxdepth
\ifnum\outputpenalty>-\@Miv
@@ -157,7 +166,6 @@
\def\pcol@makecol{\let\pcol@textbottom\@textbottom
\ifdim\pcol@textfloatsep=\maxdimen\else
\def\@textbottom{\vskip\z@\@plus.0001fil\@minus.0001fil}\fi
- \def\pcol@currfoot{\voidb@x}%
\ifpcol@sptext \ifnum\pcol@currcol=\z@
\pcol@getcurrpinfo\@tempcnta\@tempdima\@tempskipa
\setbox\@tempboxa\vbox{\unvcopy\@cclv}%
@@ -172,6 +180,7 @@
\setbox\@cclv\vbox{\unvbox\pcol@prespan \pcol@shiftspanning\@cclv
\unvbox\@cclv}%
\fi\fi
+ \def\pcol@currfoot{\voidb@x}%
\ifpcol@scfnote \ifvoid\footins\else
\pcol@shrinkcolbyfn\@colht\footins\relax
\setbox\@cclv\vbox{\pcol@unvbox@cclv\footins}%
@@ -212,7 +221,7 @@
\let\@elt\@comflelt
\setbox\@tempboxa\vbox{}%
\@toplist
- \setbox\@outputbox\vbox{
+ \setbox\@outputbox\vbox{%
\boxmaxdepth\@maxdepth
\box\@tempboxa
\vskip-\floatsep
@@ -231,7 +240,7 @@
\def\pcol@opcol{%
\pcol@Fb
- \@next\@currbox\@freelist{\global\setbox\@currbox\vbox to\@colht{
+ \@next\@currbox\@freelist{\global\setbox\@currbox\vbox to\@colht{%
\boxmaxdepth\@maxdepth
\pcol@clearcst@unvbox\@outputbox}}\pcol@ovf
\pcol@Fe{opcol}%
@@ -247,7 +256,7 @@
\def\pcol@setpageno{\begingroup
\@tempcnta\pcol@page \advance\@tempcnta-\pcol@basepage
- \edef\reserved@a{\pcol@pages\pcol@currpage}%
+ \let\@elt\relax \edef\reserved@a{\pcol@pages\pcol@currpage}%
\global\let\pcol@pages\@empty \global\let\pcol@currpage\@empty
\let\@elt\pcol@setpnoelt \reserved@a
\endgroup}
@@ -475,12 +484,12 @@
\def\pcol@buildcolseprule#1#2#3#4{%
\@tempdima#1\relax \dimen@#4\relax
\let\pcol@bg@from#2\relax \let\pcol@bg@to#3\relax
- \setbox\pcol@tempbox\vbox{}\setbox\@tempboxa\vbox{}%
+ \setbox\pcol@tempboxa\vbox{}\setbox\@tempboxa\vbox{}%
\let\@elt\pcol@buildcselt@S \pcol@sptextlist
\@tempdimb\z@ \let\@elt\pcol@buildcselt \pcol@sptextlist
\let\@elt\relax \advance\@tempdima-\@tempdimb
\ifdim\@tempdima>\z@
- \setbox\pcol@tempbox\vbox{\unvbox\pcol@tempbox
+ \setbox\pcol@tempboxa\vbox{\unvbox\pcol@tempboxa
\hrule\@height\@tempdima\@width\columnseprule}%
\setbox\@tempboxa\vbox{\unvbox\@tempboxa
\let\@elt\relax
@@ -500,7 +509,7 @@
\pcol@bg@paintbox{S}}}
\def\pcol@buildcselt#1#2{%
\@tempdimc#1sp \advance\@tempdimc-\@tempdimb
- \setbox\pcol@tempbox\vbox{\unvbox\pcol@tempbox
+ \setbox\pcol@tempboxa\vbox{\unvbox\pcol@tempboxa
\ifdim\@tempdimc>\z@ \hrule\@height\@tempdimc\@width\columnseprule \fi
\vskip#2sp}%
\setbox\@tempboxa\vbox{\unvbox\@tempboxa
@@ -523,7 +532,7 @@
\hskip-.5\columnseprule
\@ifundefined{pcol@colseprulecolor#1}%
{\pcol@colseprulecolor}{\@nameuse{pcol@colseprulecolor#1}}%
- \copy\pcol@tempbox \hskip-.5\columnseprule
+ \copy\pcol@tempboxa \hskip-.5\columnseprule
\hskip.5\@tempdima\@plus1fil\relax
\else \hskip\@tempdima\@plus1fil\relax
\fi}}
@@ -532,7 +541,7 @@
\def\@outputpage{\begingroup
\@tempdima\topmargin \advance\@tempdima\headheight \advance\@tempdima\headsep
\ifpcol@output
- \setbox\pcol@tempbox\vtop{\vskip\@tempdima \global\pcol@bg@paintedfalse
+ \setbox\pcol@tempboxa\vtop{\vskip\@tempdima \global\pcol@bg@paintedfalse
\let\pcol@bg@from\z@ \let\pcol@bg@to\pcol@ncolleft
\pcol@bg@paintpage}%
\ifpcol@bg@painted \@tempswatrue \else \@tempswafalse \fi
@@ -545,7 +554,7 @@
\ifpcol@havelastpage \ifx\set@color\relax\else
\pcol@bg@@paintpage \pcol@bg@@paintbox{Pp}%
\fi\fi}%
- \setbox\pcol@tempbox\vbox{%
+ \setbox\pcol@tempboxa\vbox{%
\let\pcol@bg@preposttop\pcol@bg@preposttop@left
\let\pcol@bg@from\z@ \let\pcol@bg@to\pcol@ncolleft \reserved@a}%
\ifpcol@bg@painted \@tempswatrue \else \@tempswafalse \fi
@@ -559,7 +568,7 @@
\pcol@Logend{\@outputpage{rightset}}%
\fi
\fi
- \ht\pcol@tempbox\z@ \dp\pcol@tempbox\z@
+ \ht\pcol@tempboxa\z@ \dp\pcol@tempboxa\z@
\ht\@tempboxa\z@ \dp\@tempboxa\z@
\ifodd\c@page \pcol@swapcolumnfalse \fi
\ifnum\pcol@ncolleft<\pcol@ncol\else \pcol@swapcolumnfalse \fi
@@ -579,7 +588,7 @@
\global\c@page#1\relax
\let\@themargin\oddsidemargin
\if@twoside\ifodd\c@page\else \let\@themargin\evensidemargin \fi\fi
- \if@tempswa \everyvbox{\pcol@outputpage@ev\pcol@tempbox}\fi
+ \if@tempswa \everyvbox{\pcol@outputpage@ev\pcol@tempboxa}\fi
\pcol@@outputpage
\pcol@Logend{\@outputpage{left}}}
\def\pcol@outputpage@r#1{%
@@ -825,18 +834,6 @@
\def\pcol@op@flush{-10012}
\def\pcol@op@clear{-10013}
\def\pcol@op@end{-10014}
-\def\pcol@op@cpush{-10015}
-\def\pcol@op@cpop{-10016}
-\def\pcol@op@cset{-10017}
-
-\def\pcol@mcpushlimit{100}
-\@tempcnta\@M
-\advance\@tempcnta\pcol@mcpushlimit
-\edef\pcol@op@mcpush{\number\@tempcnta}\advance\@tempcnta\m@ne
-\edef\pcol@op@mcpush@pone{\number-\@tempcnta}\advance\@tempcnta\@ne
-\advance\@tempcnta\pcol@mcpushlimit
-\edef\pcol@op@mcpop{\number\@tempcnta}\advance\@tempcnta\m@ne
-\edef\pcol@op@mcpop@pone{\number-\@tempcnta}\advance\@tempcnta\@ne
\def\pcol@specialoutput{%
\ifnum\outputpenalty=\pcol@op@start\relax
@@ -849,20 +846,8 @@
\let\reserved@a\pcol@output@clear
\else\ifnum\outputpenalty=\pcol@op@end\relax
\let\reserved@a\pcol@output@end
- \else\ifnum\outputpenalty=\pcol@op@cpush\relax
- \let\reserved@a\pcol@output@cpush
- \else\ifnum\outputpenalty=\pcol@op@cpop\relax
- \let\reserved@a\pcol@output@cpop
- \else\ifnum\outputpenalty=\pcol@op@cset\relax
- \let\reserved@a\pcol@output@cset
- \else\ifnum\outputpenalty<\pcol@op@mcpop@pone\relax
- \advance\outputpenalty\pcol@op@mcpop\relax \@tempcnta-\outputpenalty
- \let\reserved@a\pcol@output@mcpop
- \else\ifnum\outputpenalty<\pcol@op@mcpush@pone\relax
- \advance\outputpenalty\pcol@op@mcpush\relax \@tempcnta-\outputpenalty
- \let\reserved@a\pcol@output@mcpush
\else \let\reserved@a\@specialoutput
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \fi\fi\fi\fi\fi
\ifnum\outputpenalty=-\@Miv\relax
\ifvoid\footins\else \pcol@Log\dummy{dummy}\footins \fi
\fi
@@ -935,6 +920,12 @@
\global\count\@currbox\z@
\global\dimen\@currbox\@colroom
\expandafter\gdef\csname pcol@shipped\number\pcol@currcol\endcsname{}%
+ \pcol@ifccdefined
+ {\@next\@currbox\@freelist{\global\setbox\@currbox\vbox{%
+ \def\current@color{\pcol@ccuse{}}\let\aftergroup\@gobble
+ \pcol@set@color}}\pcol@ovf}%
+ {\def\@currbox{\voidb@x}}%
+ \pcol@ccxdef{\@currbox}%
\advance\pcol@currcol\@ne}%
\global\pcol@currcol\z@
\pcol@getcurrcol
@@ -972,10 +963,11 @@
\def\pcol@output@switch{%
\ifpcol@sptext\ifnum\pcol@currcol=\z@
- \ifvoid\pcol@prespan\else \global\advance\@colroom\ht\pcol@prespan \fi
+ \ifvoid\pcol@prespan \dimen@\z@ \else \dimen@\ht\pcol@prespan \fi
+ \global\advance\@colroom\dimen@
+ \pcol@addflhd\@toplist\pcol@textfloatsep
\pcol@getcurrpinfo\@tempcnta\@tempdima\@tempskipa
\@tempdimb\ht\@holdpg \advance\@tempdimb\dp\@holdpg
- \dimen@\ht\pcol@prespan \pcol@addflhd\@toplist\pcol@textfloatsep
\@cons\pcol@sptextlist{{\number\dimen@}{\number\@tempdimb}}%
\pcol@defcurrpage{\number\@tempcnta}\pcol@spanning\pcol@footins
{\pcol@sptextlist}{\pcol@mparbottom}%
@@ -1127,9 +1119,9 @@
\pcol@ifempty\@currbox
{\pcol@savecolorstack
\ifpcol@sptextstart \global\setbox\pcol@prespan\box\voidb@x \fi}%
- {\gdef\pcol@colorstack@saved{}%
+ {\global\setbox\pcol@colorstack@saved\box\voidb@x
\ifpcol@sptextstart
- \global\setbox\pcol@prespan\vbox{
+ \global\setbox\pcol@prespan\vbox{%
\unvbox\@currbox \pcol@restorecolorstack}%
\global\advance\@colroom-\ht\pcol@prespan
\global\topskip\z@ \hrule\@height\z@\@width\z@
@@ -1139,52 +1131,6 @@
%% Special Output Routines: Color Management
-\def\pcol@output@cpush{%
- \expandafter\pcol@output@icpush\pcol@colorstack@buf\@nil
- \pcol@return@from@color}
-\def\pcol@output@icpush\@elt#1#2\@nil{%
- \@cons\pcol@colorstack{{#1}}\gdef\pcol@colorstack@buf{#2}}
-\def\pcol@output@mcpush{\begingroup
- \let\pcol@reset@color@mpop\pcol@output@imcpush
- \@nameuse{pcol@reset@color@mpop@\number\@tempcnta}%
- \endgroup
- \pcol@return@from@color}
-\def\pcol@output@imcpush#1#2{%
- \@cons\pcol@colorstack{{#2}}%
- \@cons\pcol@colorstack@mpushed{{#1}}}
-
-\def\pcol@output@cpop{\begingroup
- \let\reserved@a\pcol@colorstack
- \gdef\pcol@colorstack{}\let\@elt\pcol@reset@color@elt
- \reserved@a\@elt\@nil
- \endgroup
- \pcol@return@from@color}
-\def\pcol@reset@color@elt#1\@elt#2{\def\reserved@b{#2}%
- \ifx\reserved@b\@nnil \let\reserved@b\relax
- \else \@cons\pcol@colorstack{{#1}}\def\reserved@b{\@elt{#2}}%
- \fi
- \reserved@b}
-\def\pcol@output@mcpop{\begingroup
- \let\@elt\pcol@output@mcpop@elt \@tempswafalse
- \pcol@colorstack@mpushed
- \if@tempswa \global\let\@gtempa\pcol@output@cpop
- \else \global\let\@gtempa\pcol@return@from@color
- \fi
- \endgroup
- \@gtempa}
-\def\pcol@output@mcpop@elt#1{\ifnum#1=\@tempcnta \@tempswatrue \fi}
-
-\def\pcol@output@cset{%
- \expandafter\pcol@output@icset\pcol@colorstack@buf\@nil
- \pcol@return@from@color}
-\def\pcol@output@icset\@elt#1#2\@nil{{\let\@elt\relax
- \expandafter\xdef\csname pcol@columncolor\number\pcol@currcol\endcsname{%
- \@elt{#1}}%
- \gdef\pcol@colorstack@buf{#2}}}
-
-\def\pcol@return@from@color{\unvbox\@holdpg \@reinserts
- \if@nobreak\nobreak \else\addpenalty\interlinepenalty \fi}
-
\def\pcol@magicpenalty{12345}
\def\pcol@ifempty#1#2#3{%
\setbox\@tempboxa\vbox{\penalty\pcol@magicpenalty
@@ -1196,23 +1142,89 @@
\def\pcol@clearcst@unvbox#1{%
\pcol@ifempty#1\relax
- {\pcol@restorecst\pcol@colorstack@saved
- \unvbox#1\pcol@clearcolorstack}}
-\def\pcol@clearcolorstack{{\def\@elt##1{\reset@color}%
- \pcol@colorstack@full}}
-
-\def\pcol@restorecolorstack{\pcol@restorecst\pcol@colorstack@full}
-\def\pcol@restorecst#1{{\let\@elt\pcol@set@color@elt#1}}
-\def\pcol@set@color@elt#1{\def\current@color{#1}\let\aftergroup\@gobble
- \pcol@set@color}
-
-\def\pcol@savecolorstack{{\let\@elt\relax
- \xdef\pcol@colorstack@saved{\pcol@colorstack@full}}}
-\def\pcol@colorstack@full{%
+ {\pcol@restorecst\pcol@colorstack@saved \unvbox#1\pcol@clearcolorstack}}
+\def\pcol@clearcolorstack{%
+ \def\reserved@a##1{\reset@color}\def\reserved@b##1{\reset@color}%
+ \pcol@scancst\pcol@colorins}
+
+\def\pcol@restorecolorstack{\pcol@restorecst\pcol@colorins}
+\def\pcol@restorecst{%
+ \def\reserved@a##1{\unvbox##1}\def\reserved@b##1{\unvcopy##1}%
+ \pcol@scancst}
+
+\def\pcol@scancst#1{%
+ \@tempcnta#1\relax
+ \ifnum\@tempcnta=\pcol@colorins
+ \ifvoid\pcol@ccuse{@box}\else
+ \reserved@b{\pcol@ccuse{@box}}\fi
+ \fi
+ \ifvoid\@tempcnta\else
+ \setbox\@tempboxa\vbox{}\setbox\pcol@tempboxa\vbox{}\@tempcntb\z@
+ \def\reserved@b{}\let\@elt\relax \@tempswatrue \pcol@iscancst
+ \global\setbox\@tempcnta\box\@tempboxa \unvbox\pcol@tempboxa
+ \fi}
+\def\pcol@iscancst{%
+ \setbox\@tempcnta\vbox{%
+ \unvbox\@tempcnta \global\setbox\pcol@tempboxb\lastbox}%
+ \ifvoid\pcol@tempboxb \let\reserved@c\relax
+ \else
+ \let\reserved@c\pcol@iscancst
+ \ifdim\ht\pcol@tempboxb=\z@
+ \ifdim\wd\pcol@tempboxb=\z@ \advance\@tempcntb\@ne
+ \else \edef\reserved@b{\@elt{\number\wd\pcol@tempboxb}\reserved@b}%
+ \fi
+ \else\ifdim\dp\pcol@tempboxb=\z@
+ \ifdim\wd\pcol@tempboxb=\z@
+ \ifnum\@tempcntb>\z@ \advance\@tempcntb\m@ne
+ \else
+ \setbox\@tempboxa\vbox{\copy\pcol@tempboxb \unvbox\@tempboxa}%
+ \setbox\pcol@tempboxa\vbox{%
+ \reserved@a\pcol@tempboxb \unvbox\pcol@tempboxa}%
+ \fi
+ \else
+ \count@\wd\pcol@tempboxb \chardef\reserved@d\z@
+ \def\@elt##1{\ifnum##1=\count@ \chardef\reserved@d\@ne \fi}%
+ \reserved@b \let\@elt\relax
+ \ifnum\reserved@d=\z@
+ \setbox\@tempboxa\vbox{\copy\pcol@tempboxb \unvbox\@tempboxa}%
+ \setbox\pcol@tempboxa\vbox{%
+ \reserved@a\pcol@tempboxb \unvbox\pcol@tempboxa}%
+ \fi
+ \fi
+ \else\if@tempswa
+ \ifvoid\pcol@ccuse{@box}%
+ \@next\@currbox\@freelist{\global\setbox\@currbox\vbox{}}\pcol@ovf
+ \pcol@ccxdef{\@currbox}\reset@color
+ \fi
+ \global\setbox\pcol@ccuse{@box}\vbox{\unvbox\pcol@tempboxb}%
+ \@tempswafalse
+ \fi\fi\fi
+ \fi
+ \reserved@c}
+
+\def\pcol@savecolorstack{%
+ \ifvoid\pcol@colorins \@tempswafalse \else \@tempswatrue \fi
+ \ifvoid\pcol@ccuse{@box}%
+ \setbox\@tempboxa\box\voidb@x
+ \else
+ \setbox\@tempboxa\vbox{\unvcopy\pcol@ccuse{@box}}%
+ \ht\@tempboxa1sp \dp\@tempboxa\z@ \wd\@tempboxa\z@
+ \@tempswatrue
+ \fi
+ \if@tempswa
+ \global\setbox\pcol@colorstack@saved\vbox{%
+ \ifvoid\@tempboxa\else \box\@tempboxa \fi
+ \ifvoid\pcol@colorins\else \unvcopy\pcol@colorins \fi}
+ \else \global\setbox\pcol@colorstack@saved\box\voidb@x
+ \fi}
+
+\def\pcol@ccuse#1{\@nameuse{pcol@columncolor#1\number\pcol@currcol}}
+\def\pcol@ifccdefined#1#2{%
\expandafter\ifx\csname pcol@columncolor\number\pcol@currcol\endcsname\relax
- \@empty
- \else \@nameuse{pcol@columncolor\number\pcol@currcol}\fi
- \pcol@colorstack}
+ #2\else#1\fi}
+\def\pcol@ccxdef#1{%
+ \expandafter\xdef
+ \csname pcol@columncolor@box\number\pcol@currcol\endcsname{#1}}
%% Special Output Routines: Footnote Handling
@@ -1339,6 +1351,7 @@
\def\pcol@getmpbelt#1#2{%
\ifdim#1sp<\@tempdima
\global\@mparbottom#2sp\relax \@cons\pcol@mpblist{{#1}{#2}}%
+ \ifdim\@tempdima<#2sp\relax \@tempdima#2sp\relax \fi
\else
\@tempdimc\@tempdima \advance\@tempdimc\@tempdimb
\ifdim#1sp<\@tempdimc
@@ -1539,7 +1552,7 @@
\ifpcol@lastpage \ifx\@deferlist\@empty \ifdim\@colroom<\@fpmin
\@tempswafalse \global\@toproom\maxdimen
\fi\fi\fi
- \if@tempswa \global\setbox\@currbox\vbox{\pcol@makefcolpage} \fi
+ \if@tempswa \global\setbox\@currbox\vbox{\pcol@makefcolpage}\fi
\fi}
\def\pcol@makefcolelt#1{%
\@tempdimb\ht#1{}\advance\@tempdimb\dp#1{}\advance\@tempdimb\@tempdimc
@@ -1548,7 +1561,7 @@
\else \@cons\@toplist#1\relax
\advance\@tempdima-\@tempdimb \global\advance\@colroom\@tempdimb
\fi}
-\def\pcol@makefcolpage{\vbox to\@colht{
+\def\pcol@makefcolpage{\vbox to\@colht{%
\vskip\@fptop \vskip-\@fpsep
\def\@elt##1{\vskip\@fpsep\box##1}\@toplist \vskip\@fpbot}%
\pcol@Fb
@@ -1624,7 +1637,7 @@
\textfloatsep\z@ \floatsep\z@ \let\topfigrule\relax
\fi
\pcol@Fb
- \@next\pcol@float\@freelist{\global\setbox\pcol@float\vbox to\z@{
+ \@next\pcol@float\@freelist{\global\setbox\pcol@float\vbox to\z@{%
\vskip-\floatsep \topfigrule \vskip\textfloatsep
\unvbox\@currbox \vss}}\pcol@ovf
\pcol@Fe{synccolumn(topfloat)}%
@@ -1638,12 +1651,12 @@
\global\pcol@prevdepth\@tempdimc
\ifdim\pcol@textfloatsep=\maxdimen
\global\pcol@textfloatsep\textfloatsep \fi
- \global\setbox\@currbox\vbox{
+ \global\setbox\@currbox\vbox{%
\ifdim\@tempdimb<\topskip
- \vbox to\topskip{\unvbox\@currbox \vskip\z@\@plus.0001fil}
+ \vbox to\topskip{\unvbox\@currbox \vskip\z@\@plus.0001fil}%
\vskip-\topskip \vskip\@tempdimb
\else
- \vbox to\@tempdimb{\unvbox\@currbox \vskip\z@\@plus.0001fil}
+ \vbox to\@tempdimb{\unvbox\@currbox \vskip\z@\@plus.0001fil}%
\fi}%
\fi
\fi
@@ -1922,13 +1935,17 @@
\pcol@Fe{output@end(pagefn)}%
\fi
\ifvoid\pcol@topfnotes\else \insert\footins{\unvbox\pcol@topfnotes}\fi
- \expandafter\let\csname pcol@columncolor\number\z@\endcsname\relax
- \pcol@currcol\z@ \pcol@restorecolorstack
- \@whilenum\pcol@currcol<\pcol@ncol\do{%
+ \pcol@currcol\z@ \@whilenum\pcol@currcol<\pcol@ncol\do{%
\pcol@Fb
\pcol@getcurrcol \@cons\@freelist\@currbox
+ \ifvoid\pcol@ccuse{@box}\else
+ \@cons\@freelist{\pcol@ccuse{@box}}%
+ \pcol@ccxdef{\voidb@x}%
+ \fi
\pcol@Fe{output@end(col)}%
\advance\pcol@currcol\@ne}%
+ \pcol@currcol\z@ \pcol@restorecolorstack
+ \global\setbox\pcol@colorins\box\voidb@x
\pcol@currcol\pcol@lastcol\relax \pcol@getcurrcol
\global\pcol@prevdepth\@pagedp
\global\@colht\textheight
@@ -2013,8 +2030,7 @@
\let\pcol@bg@paintbox\pcol@bg@@paintbox
\let\pcol@bg@paintcolumns\pcol@bg@@paintcolumns
\fi
- \gdef\pcol@colorstack{}%
- \gdef\pcol@colorstack@buf{}\gdef\pcol@colorstack@shadow{}%
+ \gdef\pcol@colorstack@shadow{}%
\pcol@footnotebase\c@footnote \global\pcol@nfootnotes\z@
\let\footnote\pcol@footnote
\let\footnotemark\pcol@footnotemark
@@ -2636,72 +2652,78 @@
\begingroup
\let\@elt\relax
\ifx\pcol@paracol\paracol
- \pcol@iicolumncolor{#1}{pcol@columncolor#2}{}%
- \pcol@iicolumncolor{#1}{pcol@columncolor@shadow#2}{}%
+ \pcol@iicolumncolor{#1}{#2}%
\else\ifnum#2=\pcol@currcol
- \begingroup
- \pcol@getshadowcc{#2}\let\pcol@colorstack\pcol@colorstack@shadow
- \pcol@clearcolorstack
- \pcol@iicolumncolor{#1}{pcol@colorstack@buf}{\pcol@colorstack@buf}%
- \pcol@iicolumncolor{#1}{pcol@columncolor@shadow#2}{}%
- \pcol@getshadowcc{#2}\pcol@restorecolorstack
- \endgroup
- \pcol@color@invokeoutput\pcol@op@cset\relax
+ \def\@elt##1{\reset@color}\pcol@scancst@shadow
+ \pcol@iicolumncolor{#1}{#2}%
+ \def\@elt##1{\def\current@color{##1}\let\aftergroup\@gobble
+ \pcol@set@color}%
+ \pcol@scancst@shadow
+ \setbox\@tempboxa\vbox{\let\set@color\pcol@set@color
+ \let\aftergroup\@gobble #1}%
+ \ht\@tempboxa1sp \dp\@tempboxa1sp \wd\@tempboxa\z@\relax
+ \insert\pcol@colorins{\box\@tempboxa}%
+ \ifvmode\if@nobreak \nobreak \fi\fi
\else
- \pcol@iicolumncolor{#1}{pcol@columncolor#2}{}%
- \pcol@iicolumncolor{#1}{pcol@columncolor@shadow#2}{}%
+ \pcol@iicolumncolor{#1}{#2}%
+ \pcol@currcol#2\relax
+ \ifvoid\pcol@ccuse{@box}%
+ \@next\@currbox\@freelist{}\pcol@ovf
+ \pcol@ccxdef{\@currbox}%
+ \fi
+ \global\setbox\pcol@ccuse{@box}\vbox{\let\set@color\pcol@set@color
+ \let\aftergroup\@gobble #1}%
\fi\fi
\endgroup
\fi\fi
\ignorespaces}
-\def\pcol@iicolumncolor#1#2#3{\let\set@color\relax #1%
- \expandafter\xdef\csname#2\endcsname{#3\@elt{\current@color}}}
-\def\pcol@getshadowcc#1{%
- \expandafter\let\expandafter\reserved@a
- \csname pcol@columncolor@shadow#1\endcsname
- \expandafter\let\csname pcol@columncolor#1\endcsname\reserved@a}
+\def\pcol@iicolumncolor#1#2{{\let\set@color\relax #1%
+ \expandafter\xdef\csname pcol@columncolor#2\endcsname{\current@color}}}
+\def\pcol@scancst@shadow{%
+ \pcol@ifccdefined{\@elt{\pcol@ccuse{}}}\relax
+ \pcol@colorstack@shadow}
+\def\pcol@mcpushlimit{1000}
\def\pcol@set@color@push{\pcol@set@color
- \ifmmode\ifpcol@inner\else
- \ifnum\pcol@mcid=\z@ \gdef\pcol@colorstack@mpushed{}\fi
- \ifnum\pcol@mcid<\pcol@mcpushlimit\relax
+ \ifmmode\else\ifinner \pcol@innertrue \fi\fi
+ \ifpcol@inner\else
+ \ifmmode
+ \global\advance\pcol@mcid\@ne
+ \ifnum \pcol@mcid>\pcol@mcpushlimit\relax
+ \PackageError{paracol}{Too many coloring commands in math mode}\@ehb
+ \global\pcol@mdid\@ne
+ \fi
+ \@tempdima\pcol@mcid sp\relax
\expandafter\aftergroup
\csname pcol@reset@color@mpop@\number\pcol@mcid\endcsname
\expandafter\xdef
\csname pcol@reset@color@mpop@\number\pcol@mcid\endcsname
- {\noexpand\pcol@reset@color@mpop
- {\number\pcol@mcid}{\current@color}}%
- \@tempcnta-\pcol@op@mcpush\relax \advance\@tempcnta-\pcol@mcid
- \pcol@color@invokeoutput\@tempcnta\relax
- \global\advance\pcol@mcid\@ne
+ {\noexpand\pcol@reset@color@mpop{\number\pcol@mcid}}%
\else
- \PackageError{paracol}{Too many coloring commands in math mode}\@ehb
- \fi\fi
- \else
- \ifinner \pcol@innertrue \fi
- \ifpcol@inner\else
- \aftergroup\pcol@reset@color@pop
- \let\pcol@elt@save\@elt \let\@elt\relax
- \edef\pcol@colorstack@shadow{\pcol@colorstack@shadow
- \@elt{\current@color}}%
- \let\@elt\pcol@elt@save
- \@cons\pcol@colorstack@buf{{\current@color}}%
- \pcol@color@invokeoutput\pcol@op@cpush\pcol@fcwhyphenate
+ \aftergroup\pcol@reset@color@pop \@tempdima\z@
\fi
+ \let\pcol@elt@save\@elt \let\@elt\relax
+ \edef\pcol@colorstack@shadow{\pcol@colorstack@shadow\@elt{\current@color}}%
+ \let\@elt\pcol@elt@save
+ \setbox\@tempboxa\vbox{\let\aftergroup\@gobble \pcol@set@color}%
+ \ht\@tempboxa1sp \dp\@tempboxa\z@ \wd\@tempboxa\@tempdima
+ \insert\pcol@colorins{\box\@tempboxa}\ifhmode \pcol@fcwhyphenate \fi
+ \ifvmode\if@nobreak \nobreak \fi\fi
\fi}
-\def\pcol@reset@color@pop{\ifpcol@output
- \pcol@color@invokeoutput\pcol@op@cpop\relax \fi}
-\def\pcol@reset@color@mpop#1#2{\@tempcnta-\pcol@op@mcpop\relax
- \advance\@tempcnta-#1\relax
- \pcol@color@invokeoutput\@tempcnta\relax}
-
-\def\pcol@color@invokeoutput#1#2{%
- \ifvmode \pcol@color@invokeoutput@v{#1}%
- \else \vadjust{\pcol@color@invokeoutput@v{#1}}\ifhmode #2\fi
+\def\pcol@reset@color@pop{%
+ \ifpcol@output
+ \setbox\@tempboxa\vbox{\reset@color}%
+ \ht\@tempboxa\z@ \dp\@tempboxa\z@ \wd\@tempboxa\z@
+ \insert\pcol@colorins{\box\@tempboxa}%
+ \ifvmode\if@nobreak \nobreak \fi\fi
\fi}
-\def\pcol@color@invokeoutput@v#1{\penalty-\@Miv \@tempdima\prevdepth
- \vbox{}\prevdepth\@tempdima \penalty#1\relax}
+\def\pcol@reset@color@mpop#1{%
+ \setbox\@tempboxa\vbox{\reset@color}%
+ \ht\@tempboxa\z@ \dp\@tempboxa\z@ \wd\@tempboxa#1sp\relax
+ \insert\pcol@colorins{\box\@tempboxa}%
+ \ifvmode\if@nobreak \nobreak \fi\fi
+}
\def\coloredwordhyphenated{\def\pcol@fcwhyphenate{\hskip\z@}}
\def\nocoloredwordhyphenated{\let\pcol@fcwhyphenate\relax}