| 1 |
%% |
| 2 |
%% This is file `pdfcolparallel.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% pdfcolparallel.dtx (with options: `package') |
| 8 |
%% |
| 9 |
%% This is a generated file. |
| 10 |
%% |
| 11 |
%% Project: pdfcolparallel |
| 12 |
%% Version: 2019/12/29 v1.5 |
| 13 |
%% |
| 14 |
%% Copyright (C) |
| 15 |
%% 2007, 2008, 2010 Heiko Oberdiek |
| 16 |
%% 2016-2019 Oberdiek Package Support Group |
| 17 |
%% |
| 18 |
%% This work may be distributed and/or modified under the |
| 19 |
%% conditions of the LaTeX Project Public License, either |
| 20 |
%% version 1.3c of this license or (at your option) any later |
| 21 |
%% version. This version of this license is in |
| 22 |
%% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 23 |
%% and the latest version of this license is in |
| 24 |
%% https://www.latex-project.org/lppl.txt |
| 25 |
%% and version 1.3 or later is part of all distributions of |
| 26 |
%% LaTeX version 2005/12/01 or later. |
| 27 |
%% |
| 28 |
%% This work has the LPPL maintenance status "maintained". |
| 29 |
%% |
| 30 |
%% The Current Maintainers of this work are |
| 31 |
%% Heiko Oberdiek and the Oberdiek Package Support Group |
| 32 |
%% https://github.com/ho-tex/oberdiek/issues |
| 33 |
%% |
| 34 |
%% |
| 35 |
%% This work consists of the main source file pdfcolparallel.dtx |
| 36 |
%% and the derived files |
| 37 |
%% pdfcolparallel.sty, pdfcolparallel.pdf, pdfcolparallel.ins, |
| 38 |
%% pdfcolparallel.drv, pdfcolparallel-test1.tex. |
| 39 |
%% |
| 40 |
\NeedsTeXFormat{LaTeX2e} |
| 41 |
\ProvidesPackage{pdfcolparallel}% |
| 42 |
[2019/12/29 v1.5 Color stacks support for parallel (HO)]% |
| 43 |
\DeclareOption*{% |
| 44 |
\PassOptionsToPackage{\CurrentOption}{parallel}% |
| 45 |
} |
| 46 |
\ProcessOptions\relax |
| 47 |
\RequirePackage{parallel}[2003/04/13] |
| 48 |
\RequirePackage{infwarerr}[2007/09/09] |
| 49 |
\begingroup\expandafter\expandafter\expandafter\endgroup |
| 50 |
\expandafter\ifx\csname currentgrouplevel\endcsname\relax |
| 51 |
\def\pcp@ColorPatch{}% |
| 52 |
\else |
| 53 |
\def\pcp@ColorPatch{% |
| 54 |
\@ifundefined{set@color}{% |
| 55 |
\gdef\pcp@ColorPatch{}% |
| 56 |
}{% |
| 57 |
\gdef\pcp@ColorPatch{% |
| 58 |
\gdef\pcp@ColorResets{}% |
| 59 |
\bgroup |
| 60 |
\aftergroup\pcp@ColorResets |
| 61 |
\aftergroup\egroup |
| 62 |
\let\pcp@OrgSetColor\set@color |
| 63 |
\let\set@color\pcp@SetColor |
| 64 |
\edef\pcp@GroupLevel{\the\currentgrouplevel}% |
| 65 |
}% |
| 66 |
}% |
| 67 |
\pcp@ColorPatch |
| 68 |
}% |
| 69 |
\def\pcp@SetColor{% |
| 70 |
\ifnum\pcp@GroupLevel=\currentgrouplevel |
| 71 |
\let\pcp@OrgAfterGroup\aftergroup |
| 72 |
\def\aftergroup{% |
| 73 |
\g@addto@macro\pcp@ColorResets |
| 74 |
}% |
| 75 |
\pcp@OrgSetColor |
| 76 |
\let\aftergroup\pcp@OrgAfterGroup |
| 77 |
\else |
| 78 |
\pcp@OrgSetColor |
| 79 |
\fi |
| 80 |
}% |
| 81 |
\fi |
| 82 |
\def\pcp@CmdCheckRedef#1{% |
| 83 |
\begingroup |
| 84 |
\def\pcp@cmd{#1}% |
| 85 |
\afterassignment\pcp@CmdDo |
| 86 |
\long\def\reserved@a |
| 87 |
} |
| 88 |
\def\pcp@CmdDo{% |
| 89 |
\expandafter\ifx\pcp@cmd\reserved@a |
| 90 |
\else |
| 91 |
\edef\x*{\expandafter\string\pcp@cmd}% |
| 92 |
\@PackageWarningNoLine{pdfcolparallel}{% |
| 93 |
Command \x* has changed.\MessageBreak |
| 94 |
Supported versions of package `parallel':\MessageBreak |
| 95 |
\space\space 2003/04/13\MessageBreak |
| 96 |
The redefinition of \x* may\MessageBreak |
| 97 |
not behave correctly depending on the changes% |
| 98 |
}% |
| 99 |
\fi |
| 100 |
\expandafter\endgroup |
| 101 |
\expandafter\def\pcp@cmd |
| 102 |
} |
| 103 |
\def\pcp@SwitchStack#1#2{} |
| 104 |
\def\pcp@SetCurrent#1{} |
| 105 |
\pcp@CmdCheckRedef\ParallelLText{% |
| 106 |
\everypar{}% |
| 107 |
\@restorepar |
| 108 |
\begingroup |
| 109 |
\hbadness=3000 % |
| 110 |
\let\footnote=\ParallelLFootnote |
| 111 |
\ParallelWhichBox=0 % |
| 112 |
\global\setbox\ParallelLBox=\vbox\bgroup |
| 113 |
\hsize=\ParallelLWidth |
| 114 |
\aftergroup\ParallelAfterText |
| 115 |
\begingroup |
| 116 |
\afterassignment\ParallelCheckOpenBrace |
| 117 |
\let\x=% |
| 118 |
}{% |
| 119 |
\everypar{}% |
| 120 |
\@restorepar |
| 121 |
\@nobreakfalse |
| 122 |
\begingroup |
| 123 |
\hbadness=3000 % |
| 124 |
\let\footnote=\ParallelLFootnote |
| 125 |
\ParallelWhichBox=0 % |
| 126 |
\global\setbox\ParallelLBox=\vbox\bgroup |
| 127 |
\hsize=\ParallelLWidth |
| 128 |
\linewidth=\ParallelLWidth |
| 129 |
\pcp@SwitchStack{Left}\ParallelLBox |
| 130 |
\aftergroup\ParallelAfterText |
| 131 |
\pcp@ColorPatch |
| 132 |
\begingroup |
| 133 |
\afterassignment\ParallelCheckOpenBrace |
| 134 |
\let\x=% |
| 135 |
} |
| 136 |
\pcp@CmdCheckRedef\ParallelRText{% |
| 137 |
\everypar{}% |
| 138 |
\@restorepar |
| 139 |
\begingroup |
| 140 |
\hbadness=3000 % |
| 141 |
\ifnum\ParallelFNMode=\@ne |
| 142 |
\let\footnote=\ParallelRFootnote |
| 143 |
\else |
| 144 |
\let\footnote=\ParallelLFootnote |
| 145 |
\fi |
| 146 |
\ParallelWhichBox=\@ne |
| 147 |
\global\setbox\ParallelRBox=\vbox\bgroup |
| 148 |
\hsize=\ParallelRWidth |
| 149 |
\aftergroup\ParallelAfterText |
| 150 |
\begingroup |
| 151 |
\afterassignment\ParallelCheckOpenBrace |
| 152 |
\let\x=% |
| 153 |
}{% |
| 154 |
\everypar{}% |
| 155 |
\@restorepar |
| 156 |
\@nobreakfalse |
| 157 |
\begingroup |
| 158 |
\hbadness=3000 % |
| 159 |
\ifnum\ParallelFNMode=\@ne |
| 160 |
\let\footnote=\ParallelRFootnote |
| 161 |
\else |
| 162 |
\let\footnote=\ParallelLFootnote |
| 163 |
\fi |
| 164 |
\ParallelWhichBox=\@ne |
| 165 |
\global\setbox\ParallelRBox=\vbox\bgroup |
| 166 |
\hsize=\ParallelRWidth |
| 167 |
\linewidth=\ParallelRWidth |
| 168 |
\pcp@SwitchStack{Right}\ParallelRBox |
| 169 |
\aftergroup\ParallelAfterText |
| 170 |
\pcp@ColorPatch |
| 171 |
\begingroup |
| 172 |
\afterassignment\ParallelCheckOpenBrace |
| 173 |
\let\x=% |
| 174 |
} |
| 175 |
\pcp@CmdCheckRedef\ParallelParTwoPages{% |
| 176 |
\ifnum\ParallelBoolVar=\@ne |
| 177 |
\par |
| 178 |
\begingroup |
| 179 |
\global\ParallelWhichBox=\@ne |
| 180 |
\newpage |
| 181 |
\vbadness=10000 % |
| 182 |
\vfuzz=3ex % |
| 183 |
\splittopskip=\z@skip |
| 184 |
\loop% |
| 185 |
\ifnum\ParallelBoolVar=\@ne% |
| 186 |
\ifnum\ParallelWhichBox=\@ne |
| 187 |
\ifvoid\ParallelLBox |
| 188 |
\mbox{} % |
| 189 |
\newpage |
| 190 |
\else |
| 191 |
\global\ParallelWhichBox=\z@ |
| 192 |
\fi |
| 193 |
\else |
| 194 |
\ifvoid\ParallelRBox |
| 195 |
\mbox{} % |
| 196 |
\newpage |
| 197 |
\else |
| 198 |
\global\ParallelWhichBox=\@ne |
| 199 |
\fi |
| 200 |
\fi |
| 201 |
\ifnum\ParallelWhichBox=\z@ |
| 202 |
\ifodd\thepage |
| 203 |
\mbox{} % |
| 204 |
\newpage |
| 205 |
\fi |
| 206 |
\hbox to\textwidth{% |
| 207 |
\vbox{\vsplit\ParallelLBox to.98\textheight}% |
| 208 |
}% |
| 209 |
\else |
| 210 |
\ifodd\thepage\relax |
| 211 |
\else |
| 212 |
\mbox{} % |
| 213 |
\newpage |
| 214 |
\fi |
| 215 |
\hbox to\textwidth{% |
| 216 |
\vbox{\vsplit\ParallelRBox to.98\textheight}% |
| 217 |
}% |
| 218 |
\fi |
| 219 |
\vspace*{\fill}% |
| 220 |
\newpage |
| 221 |
\fi |
| 222 |
\ifvoid\ParallelLBox |
| 223 |
\ifvoid\ParallelRBox |
| 224 |
\global\ParallelBoolVar=\z@ |
| 225 |
\fi |
| 226 |
\fi |
| 227 |
\ifnum\ParallelBoolVar=\@ne |
| 228 |
\repeat |
| 229 |
\par |
| 230 |
\endgroup |
| 231 |
\fi |
| 232 |
}{% |
| 233 |
\ifnum\ParallelBoolVar=\@ne |
| 234 |
\par |
| 235 |
\begingroup |
| 236 |
\global\ParallelWhichBox=\@ne |
| 237 |
\newpage |
| 238 |
\vbadness=10000 % |
| 239 |
\vfuzz=3ex % |
| 240 |
\splittopskip=\z@skip |
| 241 |
\loop% |
| 242 |
\ifnum\ParallelBoolVar=\@ne% |
| 243 |
\ifnum\ParallelWhichBox=\@ne |
| 244 |
\ifvoid\ParallelLBox |
| 245 |
\mbox{}% |
| 246 |
\newpage |
| 247 |
\else |
| 248 |
\global\ParallelWhichBox=\z@ |
| 249 |
\fi |
| 250 |
\else |
| 251 |
\ifvoid\ParallelRBox |
| 252 |
\null |
| 253 |
\newpage |
| 254 |
\else |
| 255 |
\global\ParallelWhichBox=\@ne |
| 256 |
\fi |
| 257 |
\fi |
| 258 |
\ifnum\ParallelWhichBox=\z@ |
| 259 |
\ifodd\value{page}% |
| 260 |
\null |
| 261 |
\newpage |
| 262 |
\fi |
| 263 |
\hbox to\textwidth{% |
| 264 |
\pcp@SetCurrent{Left}% |
| 265 |
\setbox\z@=\vsplit\ParallelLBox to.98\textheight |
| 266 |
\vbox to.98\textheight{% |
| 267 |
\@texttop |
| 268 |
\unvbox\z@ |
| 269 |
\@textbottom |
| 270 |
}% |
| 271 |
}% |
| 272 |
\else |
| 273 |
\ifodd\value{page}% |
| 274 |
\else |
| 275 |
\mbox{}% |
| 276 |
\newpage |
| 277 |
\fi |
| 278 |
\hbox to\textwidth{% |
| 279 |
\pcp@SetCurrent{Right}% |
| 280 |
\setbox\z@=\vsplit\ParallelRBox to.98\textheight |
| 281 |
\vbox to.98\textheight{% |
| 282 |
\@texttop |
| 283 |
\unvbox\z@ |
| 284 |
\@textbottom |
| 285 |
}% |
| 286 |
}% |
| 287 |
\fi |
| 288 |
\vspace*{\fill}% |
| 289 |
\newpage |
| 290 |
\fi |
| 291 |
\ifvoid\ParallelLBox |
| 292 |
\ifvoid\ParallelRBox |
| 293 |
\global\ParallelBoolVar=\z@ |
| 294 |
\fi |
| 295 |
\fi |
| 296 |
\ifnum\ParallelBoolVar=\@ne |
| 297 |
\repeat |
| 298 |
\par |
| 299 |
\endgroup |
| 300 |
\pcp@SetCurrent{}% |
| 301 |
\fi |
| 302 |
} |
| 303 |
\RequirePackage{pdfcol}[2007/12/12] |
| 304 |
\ifpdfcolAvailable |
| 305 |
\else |
| 306 |
\PackageInfo{pdfcolparallel}{% |
| 307 |
Loading aborted, because color stacks are not available% |
| 308 |
}% |
| 309 |
\expandafter\endinput |
| 310 |
\fi |
| 311 |
\pdfcolInitStack{pcp@Left} |
| 312 |
\pdfcolInitStack{pcp@Right} |
| 313 |
\newbox\pcp@Box |
| 314 |
\def\pcp@SwitchStack#1#2{% |
| 315 |
\pdfcolSwitchStack{pcp@#1}% |
| 316 |
\global\setbox\pcp@Box=\vbox to 0pt{% |
| 317 |
\pdfcolSetCurrentColor |
| 318 |
}% |
| 319 |
\aftergroup\pcp@FixBox |
| 320 |
\aftergroup#2% |
| 321 |
} |
| 322 |
\def\pcp@FixBox#1{% |
| 323 |
\global\setbox#1=\vbox{% |
| 324 |
\unvbox\pcp@Box |
| 325 |
\unvbox#1% |
| 326 |
}% |
| 327 |
} |
| 328 |
\def\pcp@SetCurrent#1{% |
| 329 |
\ifx\\#1\\% |
| 330 |
\pdfcolSetCurrent{}% |
| 331 |
\else |
| 332 |
\pdfcolSetCurrent{pcp@#1}% |
| 333 |
\fi |
| 334 |
} |
| 335 |
\pcp@CmdCheckRedef\ParallelParOnePage{% |
| 336 |
\ifnum\ParallelBoolVar=\@ne |
| 337 |
\par |
| 338 |
\begingroup |
| 339 |
\leftmargin=\z@ |
| 340 |
\rightmargin=\z@ |
| 341 |
\parskip=\z@skip |
| 342 |
\parindent=\z@ |
| 343 |
\vbadness=10000 % |
| 344 |
\vfuzz=3ex % |
| 345 |
\splittopskip=\z@skip |
| 346 |
\loop |
| 347 |
\ifnum\ParallelBoolVar=\@ne |
| 348 |
\noindent |
| 349 |
\hbox to\textwidth{% |
| 350 |
\hskip\ParallelLeftMargin |
| 351 |
\hbox to\ParallelTextWidth{% |
| 352 |
\ifvoid\ParallelLBox |
| 353 |
\hskip\ParallelLWidth |
| 354 |
\else |
| 355 |
\ParallelWhichBox=\z@ |
| 356 |
\vbox{% |
| 357 |
\setbox\ParallelBoxVar |
| 358 |
=\vsplit\ParallelLBox to\dp\strutbox |
| 359 |
\unvbox\ParallelBoxVar |
| 360 |
}% |
| 361 |
\fi |
| 362 |
\strut |
| 363 |
\ifnum\ParallelBoolMid=\@ne |
| 364 |
\hskip\ParallelMainMidSkip |
| 365 |
\vrule |
| 366 |
\else |
| 367 |
\hss |
| 368 |
\fi |
| 369 |
\hss |
| 370 |
\ifvoid\ParallelRBox |
| 371 |
\hskip\ParallelRWidth |
| 372 |
\else |
| 373 |
\ParallelWhichBox=\@ne |
| 374 |
\vbox{% |
| 375 |
\setbox\ParallelBoxVar |
| 376 |
=\vsplit\ParallelRBox to\dp\strutbox |
| 377 |
\unvbox\ParallelBoxVar |
| 378 |
}% |
| 379 |
\fi |
| 380 |
}% |
| 381 |
}% |
| 382 |
\ifvoid\ParallelLBox |
| 383 |
\ifvoid\ParallelRBox |
| 384 |
\global\ParallelBoolVar=\z@ |
| 385 |
\fi |
| 386 |
\fi% |
| 387 |
\fi% |
| 388 |
\ifnum\ParallelBoolVar=\@ne |
| 389 |
\penalty\interlinepenalty |
| 390 |
\repeat |
| 391 |
\par |
| 392 |
\endgroup |
| 393 |
\fi |
| 394 |
}{% |
| 395 |
\ifnum\ParallelBoolVar=\@ne |
| 396 |
\par |
| 397 |
\begingroup |
| 398 |
\leftmargin=\z@ |
| 399 |
\rightmargin=\z@ |
| 400 |
\parskip=\z@skip |
| 401 |
\parindent=\z@ |
| 402 |
\vbadness=10000 % |
| 403 |
\vfuzz=3ex % |
| 404 |
\splittopskip=\z@skip |
| 405 |
\loop |
| 406 |
\ifnum\ParallelBoolVar=\@ne |
| 407 |
\noindent |
| 408 |
\hbox to\textwidth{% |
| 409 |
\hskip\ParallelLeftMargin |
| 410 |
\hbox to\ParallelTextWidth{% |
| 411 |
\ifvoid\ParallelLBox |
| 412 |
\hskip\ParallelLWidth |
| 413 |
\else |
| 414 |
\pcp@SetCurrent{Left}% |
| 415 |
\ParallelWhichBox=\z@ |
| 416 |
\vbox{% |
| 417 |
\setbox\ParallelBoxVar |
| 418 |
=\vsplit\ParallelLBox to\dp\strutbox |
| 419 |
\unvbox\ParallelBoxVar |
| 420 |
}% |
| 421 |
\fi |
| 422 |
\strut |
| 423 |
\ifnum\ParallelBoolMid=\@ne |
| 424 |
\hskip\ParallelMainMidSkip |
| 425 |
\begingroup |
| 426 |
\pcp@RuleBetweenColor |
| 427 |
\vrule |
| 428 |
\endgroup |
| 429 |
\else |
| 430 |
\hss |
| 431 |
\fi |
| 432 |
\hss |
| 433 |
\ifvoid\ParallelRBox |
| 434 |
\hskip\ParallelRWidth |
| 435 |
\else |
| 436 |
\pcp@SetCurrent{Right}% |
| 437 |
\ParallelWhichBox=\@ne |
| 438 |
\vbox{% |
| 439 |
\setbox\ParallelBoxVar |
| 440 |
=\vsplit\ParallelRBox to\dp\strutbox |
| 441 |
\unvbox\ParallelBoxVar |
| 442 |
}% |
| 443 |
\fi |
| 444 |
}% |
| 445 |
}% |
| 446 |
\ifvoid\ParallelLBox |
| 447 |
\ifvoid\ParallelRBox |
| 448 |
\global\ParallelBoolVar=\z@ |
| 449 |
\fi |
| 450 |
\fi% |
| 451 |
\fi% |
| 452 |
\ifnum\ParallelBoolVar=\@ne |
| 453 |
\penalty\interlinepenalty |
| 454 |
\repeat |
| 455 |
\par |
| 456 |
\endgroup |
| 457 |
\pcp@SetCurrent{}% |
| 458 |
\fi |
| 459 |
} |
| 460 |
\def\pcp@RuleBetweenColorDefault{% |
| 461 |
\normalcolor |
| 462 |
} |
| 463 |
\let\pcp@RuleBetweenColor\pcp@RuleBetweenColorDefault |
| 464 |
\RequirePackage{keyval} |
| 465 |
\define@key{parallel}{rulebetweencolor}{% |
| 466 |
\edef\pcp@temp{#1}% |
| 467 |
\ifx\pcp@temp\@empty |
| 468 |
\let\pcp@RuleBetweenColor\pcp@RuleBetweenColorDefault |
| 469 |
\else |
| 470 |
\edef\pcp@temp{% |
| 471 |
\noexpand\@ifnextchar[{% |
| 472 |
\def\noexpand\pcp@RuleBetweenColor{% |
| 473 |
\noexpand\color\pcp@temp |
| 474 |
}% |
| 475 |
\noexpand\pcp@GobbleNil |
| 476 |
}{% |
| 477 |
\def\noexpand\pcp@RuleBetweenColor{% |
| 478 |
\noexpand\color{\pcp@temp}% |
| 479 |
}% |
| 480 |
\noexpand\pcp@GobbleNil |
| 481 |
}% |
| 482 |
\pcp@temp\noexpand\@nil |
| 483 |
}% |
| 484 |
\pcp@temp |
| 485 |
\fi |
| 486 |
} |
| 487 |
\long\def\pcp@GobbleNil#1\@nil{} |
| 488 |
%% \section{Installation} |
| 489 |
\endinput |
| 490 |
%% |
| 491 |
%% End of file `pdfcolparallel.sty'. |