| 1 |
\input ptb-utils |
| 2 |
\input pdfGraphics/ptb-colors |
| 3 |
|
| 4 |
\_checkloaded{colorboxes} |
| 5 |
|
| 6 |
\newbox\_contentbox |
| 7 |
\newbox\_splitbox |
| 8 |
|
| 9 |
\def\_spaceleft{% |
| 10 |
\ifdim\pagetotal=\z@% |
| 11 |
\dimexpr\vsize - \topskip\relax% |
| 12 |
\else% |
| 13 |
\dimexpr \pagegoal - \pagetotal - \topskip\relax% |
| 14 |
\fi% |
| 15 |
} |
| 16 |
|
| 17 |
\newif\if_recheck |
| 18 |
\newif\if_lastbox |
| 19 |
\newif\if_firstbox |
| 20 |
\def\_getsplitdim#1{% |
| 21 |
\ifdim\dimexpr\_spaceleft-#1\relax>\ht\_contentbox% |
| 22 |
\edef\_splitdim{\the\ht\_contentbox}% |
| 23 |
\_recheckfalse% |
| 24 |
\_lastboxtrue% |
| 25 |
\else% |
| 26 |
\_lastboxfalse% |
| 27 |
\ifdim\dimexpr\_spaceleft-#1\relax>\z@% |
| 28 |
\edef\_splitdim{\the\dimexpr\_spaceleft-#1\relax}% |
| 29 |
\_recheckfalse% |
| 30 |
\else |
| 31 |
\if_recheck% |
| 32 |
\vfil\break\vfilneg% |
| 33 |
\_recheckfalse% |
| 34 |
\else% |
| 35 |
\null\par% |
| 36 |
\_rechecktrue% |
| 37 |
\fi% |
| 38 |
\_getsplitdim{#1}% |
| 39 |
\fi% |
| 40 |
\fi% |
| 41 |
} |
| 42 |
|
| 43 |
% Splits the content box to fit into pages. |
| 44 |
% #1: Total vertical buffer |
| 45 |
% #2: Output routine for new box |
| 46 |
\def\__splitcontentbox#1#2#3#4#5{ |
| 47 |
\unless\ifvoid\_contentbox% |
| 48 |
\_getsplitdim{#1}% |
| 49 |
\setbox\_splitbox = \vsplit\_contentbox to\_splitdim\relax% |
| 50 |
\setbox0=\vbox{% |
| 51 |
\if_firstbox% |
| 52 |
\if_lastbox% |
| 53 |
#2% |
| 54 |
\else% |
| 55 |
#3% |
| 56 |
\fi% |
| 57 |
\else% |
| 58 |
\if_lastbox% |
| 59 |
#5% |
| 60 |
\else% |
| 61 |
#4% |
| 62 |
\fi% |
| 63 |
\fi% |
| 64 |
}% |
| 65 |
\vbox to\z@{\copy0\vss}% |
| 66 |
\kern\ht0\relax\penalty\z@% |
| 67 |
\_firstboxfalse% |
| 68 |
\__splitcontentbox{#1}{#2}{#3}{#4}{#5}% |
| 69 |
\fi% |
| 70 |
} |
| 71 |
\def\_splitcontentbox#1#2#3#4#5{{% |
| 72 |
\splittopskip=\z@% |
| 73 |
\boxmaxdepth=\z@% |
| 74 |
\offinterlineskip% |
| 75 |
\_firstboxtrue% |
| 76 |
\__splitcontentbox{#1}{#2}{#3}{#4}{#5}% |
| 77 |
}} |
| 78 |
|
| 79 |
\def\_ppbuf{0pt} |
| 80 |
\def\_bppbox#1#2#3[#4]{% |
| 81 |
\_getdotsnlines#4\_nul% |
| 82 |
\def\_colorcontentboxT{% |
| 83 |
\hbox{\curvedcolorbox{#2}{#1}{\_setcolor{}{#3}\box\_splitbox}{#4}}% |
| 84 |
}% |
| 85 |
\def\_colorcontentboxS{% |
| 86 |
\hbox{\curvedcolorbox{#2}{#1}{\_setcolor{}{#3}\box\_splitbox}% |
| 87 |
{_X\_linel\_dottl\_linet\_dottr\_liner X}% |
| 88 |
}% |
| 89 |
}% |
| 90 |
\def\_colorcontentboxM{% |
| 91 |
\hbox{\curvedcolorbox{#2}{#1}{\_setcolor{}{#3}\box\_splitbox}% |
| 92 |
{_X\_linel X_X\_liner X}% |
| 93 |
}% |
| 94 |
}% |
| 95 |
\def\_colorcontentboxE{% |
| 96 |
\hbox{\curvedcolorbox{#2}{#1}{\_setcolor{}{#3}\box\_splitbox}% |
| 97 |
{\_lineb\_dotbl\_linel X_X\_liner\_dotbr}% |
| 98 |
}% |
| 99 |
}% |
| 100 |
\par% |
| 101 |
\kern\_ppbuf\relax% |
| 102 |
\null\par% Move the kern from recent contributions to MVL |
| 103 |
\setbox\_contentbox=\vbox\bgroup% |
| 104 |
\hsize=\dimexpr\hsize-\_actual_curve_buf * 2\relax% |
| 105 |
} |
| 106 |
|
| 107 |
\def\bppbox#1#2#3{% |
| 108 |
\_ifnextchar[ {\_bppbox{#1}{#2}{#3}}{\_bppbox{#1}{#2}{#3}[-.-.-.-.]}% |
| 109 |
} |
| 110 |
|
| 111 |
\def\eppbox{% |
| 112 |
\egroup% |
| 113 |
\_splitcontentbox{2\_actual_curve_buf}% |
| 114 |
\_colorcontentboxT\_colorcontentboxS\_colorcontentboxM\_colorcontentboxE% |
| 115 |
\vskip\_ppbuf\relax% |
| 116 |
} |
| 117 |
|
| 118 |
\def\pprulewd{2.5pt} |
| 119 |
\def\pprulevbuf{5pt} |
| 120 |
\def\pprulehbuf{7pt} |
| 121 |
|
| 122 |
\def\blinedppbox#1#2#3{% |
| 123 |
\def\_colorcontentbox{{% |
| 124 |
\setbox0=\hbox{{\_setcolor{}{#2}\vrule width\pprulewd\relax}\kern\pprulehbuf\vbox{\kern\pprulevbuf\_setcolor{}{#3}\box\_splitbox\kern\pprulevbuf}\kern\pprulehbuf}% |
| 125 |
\hbox{{\_setcolor{}{#1}\vrule height\ht0 width\wd0 depth\dp0}\kern-\wd0\box0}% |
| 126 |
}}% |
| 127 |
\par\kern\_ppbuf\relax% |
| 128 |
\null\par% |
| 129 |
\setbox\_contentbox=\vbox\bgroup% |
| 130 |
\hsize=\dimexpr\hsize-\pprulewd - \pprulehbuf * 2\relax% |
| 131 |
} |
| 132 |
\def\elinedppbox{% |
| 133 |
\egroup% |
| 134 |
\_splitcontentbox{2\dimexpr\pprulevbuf\relax}% |
| 135 |
\_colorcontentbox\_colorcontentbox\_colorcontentbox\_colorcontentbox% |
| 136 |
\vskip\_ppbuf\relax% |
| 137 |
} |
| 138 |
|