| 1 |
%% |
| 2 |
%% This is file `lroundrect.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% lroundrect.dtx (with options: `package') |
| 8 |
%% This is a generated file. |
| 9 |
%% |
| 10 |
%% This document is copyright 2015 by Donald P. Goodman, and is |
| 11 |
%% released publicly under the LaTeX Project Public License. The |
| 12 |
%% distribution and modification of this work is constrained by the |
| 13 |
%% conditions of that license. See |
| 14 |
%% http://www.latex-project.org/lppl.txt |
| 15 |
%% for the text of the license. This document is released |
| 16 |
%% under version 1.3 of that license, and this work may be distributed |
| 17 |
%% or modified under the terms of that license or, at your option, any |
| 18 |
%% later version. |
| 19 |
%% |
| 20 |
%% This work has the LPPL maintenance status 'maintained'. |
| 21 |
%% |
| 22 |
%% The Current Maintainer of this work is Donald P. Goodman |
| 23 |
%% ([email protected]). |
| 24 |
%% |
| 25 |
%% This work consists of the files lroundrect.dtx and |
| 26 |
%% lroundrect.ins, along with the generated file lroundrect.mp |
| 27 |
%% and lroundrect.pdf, and the README. |
| 28 |
|
| 29 |
\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
| 30 |
\ProvidesPackage{lroundrect}[2015/09/01 v1.0 LaTeX macros utilizing the Metapost roundrect code] |
| 31 |
\def\rralertbox#1{% |
| 32 |
\begin{mpost} |
| 33 |
rrborderpen(pencircle scaled 3); |
| 34 |
rrbodytext := "#1"; |
| 35 |
rrbordercolor(0.8red); |
| 36 |
rrtextcolor := 0.8red; |
| 37 |
rrinnercolor := 0.5[red,white]; |
| 38 |
roundrect(1in,2in)(alertbox); |
| 39 |
draw alertbox; |
| 40 |
\end{mpost} |
| 41 |
}% |
| 42 |
\newlength{\rrorangewid} |
| 43 |
\newdimen\rrblueht |
| 44 |
\newdimen\rrorangeht |
| 45 |
\newbox\rrbluebox |
| 46 |
\newbox\rrorangebox |
| 47 |
\def\rrorangebluebox#1#2{% |
| 48 |
\settowidth{\rrorangewid}{\ \scshape #1\ } |
| 49 |
\savebox\rrbluebox{\parbox{\linewidth}{#2}} |
| 50 |
\advance\rrorangewid by6pt |
| 51 |
\savebox\rrorangebox{\parbox{\rrorangewid}{#1}} |
| 52 |
\rrorangeht=\ht\rrorangebox |
| 53 |
\advance\rrorangeht by\dp\rrorangebox |
| 54 |
\advance\rrorangeht by\baselineskip |
| 55 |
\rrblueht=\ht\rrbluebox |
| 56 |
\advance\rrblueht by\dp\rrbluebox |
| 57 |
\advance\rrblueht by\baselineskip |
| 58 |
\begin{mpost} |
| 59 |
input mpcolornames; |
| 60 |
rrborderrad(10pt); |
| 61 |
rrbotlftborderrad := 0pt; |
| 62 |
rrbotrtborderrad := 0pt; |
| 63 |
rrbordercolor(DarkGoldenrod1); |
| 64 |
rrinnercolor := DarkGoldenrod1; |
| 65 |
rrtextalign := "\unexpanded{\raggedright}"; |
| 66 |
rrtextfont := "\unexpanded{\scshape}"; |
| 67 |
rrbodytext := "#1"; |
| 68 |
roundrect(\mpdim{\rrorangeht})(\mpdim{\rrorangewid})(orangebluebox); |
| 69 |
rrrestorevals; |
| 70 |
rrborderrad(10pt); |
| 71 |
rrbordercolor(blue); |
| 72 |
rrinnercolor := blue; |
| 73 |
rrbodytext := "#2"; |
| 74 |
rrtextcolor := white; |
| 75 |
rrtextfont := "\unexpanded{\bfseries}"; |
| 76 |
rrtextalign := ""; |
| 77 |
roundrect(\mpdim{\rrblueht})(\mpdim{\linewidth})(mainbox); |
| 78 |
draw orangebluebox shifted (-\mpdim{0.3\linewidth},0); |
| 79 |
draw mainbox shifted (0,-\mpdim{\rrblueht}/2-\mpdim{\rrorangeht}/2); |
| 80 |
\end{mpost} |
| 81 |
}% |
| 82 |
\newlength{\rrtitlewid} |
| 83 |
\newlength{\rrtitleht} |
| 84 |
\newlength{\rrmainht} |
| 85 |
\newbox\rrtitlebox\newbox\rrmainbox |
| 86 |
\def\rrdefaultbox#1#2{% |
| 87 |
\settowidth{\rrtitlewid}{\ \scshape #1\ } |
| 88 |
\savebox\rrmainbox{\parbox{\linewidth}{#2}} |
| 89 |
\advance\rrtitlewid by6pt |
| 90 |
\savebox\rrtitlebox{\parbox{\rrtitlewid}{#1}} |
| 91 |
\rrtitleht=\ht\rrtitlebox |
| 92 |
\advance\rrtitleht by\dp\rrtitlebox |
| 93 |
\advance\rrtitleht by\baselineskip |
| 94 |
\rrmainht=\ht\rrmainbox |
| 95 |
\advance\rrmainht by\dp\rrmainbox |
| 96 |
\advance\rrmainht by\baselineskip |
| 97 |
\begin{mpost} |
| 98 |
input mpcolornames; |
| 99 |
rrborderrad(10pt); |
| 100 |
rrbotlftborderrad := 0pt; |
| 101 |
rrbotrtborderrad := 0pt; |
| 102 |
rrbodytext := "#1"; |
| 103 |
roundrect(\mpdim{\rrtitleht})(\mpdim{\linewidth})(titlebox); |
| 104 |
rrrestorevals; |
| 105 |
rrborderrad(10pt); |
| 106 |
rrtoplftborderrad := 0pt; |
| 107 |
rrtoprtborderrad := 0pt; |
| 108 |
rrtopborderpen := pencircle scaled 1; |
| 109 |
rrbodytext := "#2"; |
| 110 |
rrtextalign := ""; |
| 111 |
roundrect(\mpdim{\rrmainht})(\mpdim{\linewidth})(mainbox); |
| 112 |
draw titlebox; |
| 113 |
draw mainbox shifted (0,-\mpdim{\rrmainht}/2-\mpdim{\rrtitleht}/2); |
| 114 |
\end{mpost} |
| 115 |
} |
| 116 |
\def\rrtcolorex#1{% |
| 117 |
\begin{mpost} |
| 118 |
rrborderrad(10pt); |
| 119 |
rrbordercolor(blue); |
| 120 |
rrtopbordercolor := 0.5[green,black]; |
| 121 |
rrinnercolor := 0.8[blue,white]; |
| 122 |
rrbodytext := "#1"; |
| 123 |
roundrect(2\mpdim{\baselineskip},\mpdim{\linewidth})(rrexampbox); |
| 124 |
draw rrexampbox; |
| 125 |
\end{mpost} |
| 126 |
}% |
| 127 |
\newdimen\rrtcoltagwd |
| 128 |
\newbox\rrtcoltagbox |
| 129 |
\def\rrtcoltag#1#2{% |
| 130 |
\settowidth{\rrtcoltagwd}{#2} |
| 131 |
\advance\rrtcoltagwd by12pt |
| 132 |
\begin{mpost} |
| 133 |
input mpcolornames; |
| 134 |
rrborderrad(5pt); |
| 135 |
rrbotlftborderrad := 0pt; |
| 136 |
rrbotrtborderrad := 0pt; |
| 137 |
rrnobot := true; |
| 138 |
rrinnercolor := 0.5[green,white]; |
| 139 |
rrbodytext := "#1"; |
| 140 |
rrtextfont := "\unexpanded{\sffamily}"; |
| 141 |
rrtextcolor := Khaki1; |
| 142 |
roundrect(\mpdim{1.5em},2.5\mpdim{\baselineskip})(rrtaglabel); |
| 143 |
rrrestorevals; |
| 144 |
rrborderrad(5pt); |
| 145 |
rrtoplftborderrad := 0pt; |
| 146 |
rrbotlftborderrad := 0pt; |
| 147 |
rrinnercolor := 0.7[green,white]; |
| 148 |
rrnolft := true; |
| 149 |
rrbodytext := "#2"; |
| 150 |
roundrect(2.5\mpdim{\baselineskip},\mpdim{\rrtcoltagwd})(rrtextlabel); |
| 151 |
draw rrtaglabel rotatedaround((0,0),90); |
| 152 |
draw rrtextlabel shifted (\mpdim{\rrtcoltagwd}/2+0.625\mpdim{\baselineskip},0); |
| 153 |
\end{mpost} |
| 154 |
}% |
| 155 |
\def\rrtransbox#1{% |
| 156 |
\begin{mpost}[mpmem=metafun] |
| 157 |
rrbodytext := "#1"; |
| 158 |
rrdropshadow := true; |
| 159 |
rrborderrad(20pt); |
| 160 |
rrinnercolor := transparent(0.5,0.5,0.5red); |
| 161 |
rrshadowcolor := transparent(0.5,0.5,0.625blue); |
| 162 |
rrshadowx := rrbotlftborderrad/4; |
| 163 |
rrshadowy := -rrbotlftborderrad/4; |
| 164 |
roundrect(1in,2in)(rectangle); |
| 165 |
draw rectangle; |
| 166 |
\end{mpost} |
| 167 |
}% |
| 168 |
\def\rrincludepdf{% |
| 169 |
\long\def\gmp@innermpost##1\end##2{% |
| 170 |
\ifgmp@nowrite\else |
| 171 |
\gmp@write\gmp@out{% |
| 172 |
##1^^Jendfig;^^Jend.% |
| 173 |
\gmp@doiflatex{^^Jverbatimtex^^J\string\end{document}^^Jetex}}% |
| 174 |
\gmp@closeout\gmp@out |
| 175 |
\count@=\gmp@runs |
| 176 |
\loop\ifnum\count@>\z@ |
| 177 |
\gmp@shellcommand{\gmp@command\space |
| 178 |
-tex=\gmp@mpxprogram\space\gmp@jobname\gmp@ext |
| 179 |
\gmp@fourdigits{\gmp@number}}% |
| 180 |
\advance\count@\m@ne |
| 181 |
\repeat |
| 182 |
\ifxetex |
| 183 |
\gmp@shellcommand{epstopdf --hires |
| 184 |
\gmp@jobname\gmp@ext |
| 185 |
\gmp@fourdigits{\gmp@number}.mps}% |
| 186 |
\fi |
| 187 |
\gmp@shellcommand{mptopdf |
| 188 |
--result=\gmp@jobname\gmp@ext |
| 189 |
\gmp@fourdigits{\gmp@number}.pdf |
| 190 |
\gmp@jobname\gmp@ext |
| 191 |
\gmp@fourdigits{\gmp@number}.mps}% |
| 192 |
\gmp@shellcommand{mv |
| 193 |
\gmp@jobname\gmp@ext |
| 194 |
\gmp@fourdigits{\gmp@number}-mps.pdf |
| 195 |
\gmp@jobname\gmp@ext |
| 196 |
\gmp@fourdigits{\gmp@number}.pdf}% |
| 197 |
\egroup |
| 198 |
\end{##2}\ifgmp@use |
| 199 |
\gmp@usempost{\thegmp@count}\fi} |
| 200 |
\def\gmp@usempost##1{% |
| 201 |
\edef\gmp@thempsfile{\gmp@jobname\gmp@ext\gmp@fourdigits{##1}}% |
| 202 |
\IfFileExists{\[email protected]}% |
| 203 |
{\includegraphics{\[email protected]}}% |
| 204 |
{\gmp@nemessage\gmp@box}} |
| 205 |
\renewcommand\usempost[2][]{% |
| 206 |
\IfFileExists{\gmp@jobname\gmp@ext\csname gmp@fig##2\endcsname.pdf}% |
| 207 |
{\includegraphics[##1] |
| 208 |
{\gmp@jobname\gmp@ext\csname gmp@fig##2\endcsname.pdf}}% |
| 209 |
{\gmp@nemessage\gmp@box}} |
| 210 |
}% |
| 211 |
\def\rrincludemps{% |
| 212 |
\long\def\gmp@innermpost##1\end##2{% |
| 213 |
\ifgmp@nowrite\else |
| 214 |
\gmp@write\gmp@out{% |
| 215 |
##1^^Jendfig;^^Jend.% |
| 216 |
\gmp@doiflatex{^^Jverbatimtex^^J\string\end{document}^^Jetex}}% |
| 217 |
\gmp@closeout\gmp@out |
| 218 |
\count@=\gmp@runs |
| 219 |
\loop\ifnum\count@>\z@ |
| 220 |
\gmp@shellcommand{\gmp@command\space |
| 221 |
-tex=\gmp@mpxprogram\space\gmp@jobname\gmp@ext |
| 222 |
\gmp@fourdigits{\gmp@number}}% |
| 223 |
\advance\count@\m@ne |
| 224 |
\repeat |
| 225 |
\ifxetex |
| 226 |
\gmp@shellcommand{epstopdf --hires \gmp@jobname\gmp@ext |
| 227 |
\gmp@fourdigits{\gmp@number}.mps}% |
| 228 |
\fi |
| 229 |
\fi |
| 230 |
\egroup |
| 231 |
\end{##2}\ifgmp@use |
| 232 |
\gmp@usempost{\thegmp@count}\fi} |
| 233 |
\ifxetex |
| 234 |
\def\gmp@usempost##1{% |
| 235 |
\edef\gmp@thempsfile{\gmp@jobname\gmp@ext\gmp@fourdigits{##1}}% |
| 236 |
\IfFileExists{\[email protected]}% |
| 237 |
{\includegraphics{\[email protected]}}% |
| 238 |
{\gmp@nemessage\gmp@box}} |
| 239 |
\renewcommand\usempost[2][]{% |
| 240 |
\IfFileExists{\gmp@jobname\gmp@ext\csname gmp@fig##2\endcsname.pdf}% |
| 241 |
{\includegraphics[##1] |
| 242 |
{\gmp@jobname\gmp@ext\csname gmp@fig##2\endcsname.pdf}}% |
| 243 |
{\gmp@nemessage\gmp@box}} |
| 244 |
\else |
| 245 |
\def\gmp@usempost##1{% |
| 246 |
\edef\gmp@thempsfile{\gmp@jobname\gmp@ext\gmp@fourdigits{##1}}% |
| 247 |
\IfFileExists{\[email protected]}% |
| 248 |
{\includegraphics[hiresbb]{\[email protected]}}% |
| 249 |
{\gmp@nemessage\gmp@box}} |
| 250 |
\renewcommand\usempost[2][]{% |
| 251 |
\IfFileExists{\gmp@jobname\gmp@ext\csname gmp@fig##2\endcsname.mps}% |
| 252 |
{\includegraphics[hiresbb,##1] |
| 253 |
{\gmp@jobname\gmp@ext\csname gmp@fig##2\endcsname.mps}}% |
| 254 |
{\gmp@nemessage\gmp@box}} |
| 255 |
\fi |
| 256 |
}% |
| 257 |
\endinput |
| 258 |
%% |
| 259 |
%% End of file `lroundrect.sty'. |