summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/metapost
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-07-29 20:44:49 +0000
committerKarl Berry <karl@freefriends.org>2015-07-29 20:44:49 +0000
commit476e23fc645b7f0eb1ffcaae59622b9f62bf198b (patch)
treef61dc390a811accf13cdadebde8d84fcfb089c44 /Master/texmf-dist/source/metapost
parent9a477aa1877f9f798c26d3bee9d239db61fc7838 (diff)
roundrect (29jul15)
git-svn-id: svn://tug.org/texlive/trunk@37994 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/metapost')
-rw-r--r--Master/texmf-dist/source/metapost/roundrect/roundrect.dtx591
-rw-r--r--Master/texmf-dist/source/metapost/roundrect/roundrect.ins69
2 files changed, 660 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/metapost/roundrect/roundrect.dtx b/Master/texmf-dist/source/metapost/roundrect/roundrect.dtx
new file mode 100644
index 00000000000..4a00a6a33b5
--- /dev/null
+++ b/Master/texmf-dist/source/metapost/roundrect/roundrect.dtx
@@ -0,0 +1,591 @@
+% \iffalse
+% +AMDG This document was begun on 1E June 11EE, the vigil
+% of the Nativity of St. John the Baptist, and it is humbly
+% dedicated to him and to the Immaculate Heart of Mary, for
+% their prayers, and to the Sacred Heart of Jesus, for His
+% mercy.
+%
+% This document is copyright 2015 by Donald P. Goodman, and is
+% released publicly under the LaTeX Project Public License. The
+% distribution and modification of this work is constrained by the
+% conditions of that license. See
+% http://www.latex-project.org/lppl.txt
+% for the text of the license. This document is released
+% under version 1.3 of that license, and this work may be distributed
+% or modified under the terms of that license or, at your option, any
+% later version.
+%
+% This work has the LPPL maintenance status 'maintained'.
+%
+% The Current Maintainer of this work is Donald P. Goodman
+% (dgoodmaniii@gmail.com).
+%
+% This work consists of the files roundrect.dtx and
+% roundrect.ins, along with the generated file roundrect.mp
+% and roundrect.pdf, and the README.
+% \fi
+
+% \iffalse
+%<*driver>
+
+\documentclass{ltxdoc}
+\usepackage{docmfp}
+\usepackage{url}
+\usepackage[typeone]{dozenal}
+\usepackage{verbatim}
+\usepackage{mflogo}
+\usepackage[everymp={input roundrect;},latex]{gmp}
+\usepackage{makeidx}
+\makeindex
+\long\def\demonstrate#1#2{%
+ \bigskip%
+ \hrule%
+ \hbox to\linewidth{%
+ \hbox to0.5\linewidth{%
+ \vbox to2in{\vfil#1\vfil}%
+ }\hbox to0.5\linewidth{%
+ \vbox to2in{\vfil#2\vfil}%
+ }%
+ }%
+ \hrule%
+ \bigskip%
+}
+
+\begin{document}
+\DocInput{roundrect.dtx}
+\end{document}
+%</driver>
+% \fi
+% \title{The \texttt{roundrect} Macros, v1.0}
+% \author{Donald P.\ Goodman III}
+% \date{\today}
+%
+% \maketitle
+% \begin{abstract}\noindent
+% The |roundrect| macros for \MP\ provide extremely
+% configurable, extremely versatile rectangles (including
+% rounded corners), intended primarily for inclusion in
+% documents produced by \TeX\ and friends. The idea was to
+% provide a \MP-based replacement for the incredibly
+% versatile |tcolorbox| package; the macros are far from
+% achieving that goal. But they are nevertheless extremely
+% useful.
+% \end{abstract}
+%
+% \tableofcontents
+%
+% \section{Introduction}
+%
+% While Ti\textit{k}Z and its many accompanying packages,
+% particularly |tcolorbox|, are wonderful and powerful
+% tools, whenever using them I inevitably feel completely
+% lost, and I exert great effort doing comparatively simple
+% things. Contrariwise, thanks to my experience with the
+% |drm| and |dozenal| packages, writing in \MP\ is quite
+% straightforward for me. So I decided to try to write some
+% generalized macros to provide functionality similar to
+% that of |tcolorbox|. It's not even close to that kind of
+% flexibility or power, but it's still quite useful and
+% versatile, so I make it available for anyone who might be
+% interested.
+%
+% This document was typeset in accordance with the
+% |docstrip| utility, which allows the automatic extraction
+% of code and documentation from the same document.
+%
+% \section{Prerequisites and Conventions}
+%
+% Some prerequesites for using this package are \MP\ itself
+% (obviously). If you're using the package with \LaTeX, the
+% |gmp| package would probably be helpful; be sure to use
+% the |latex| package option. Finally, the
+% package internally calls |TEX.mp|, so that is also
+% required. All of these should be packaged in any
+% reasonably modern \LaTeX\ system, such as \TeX Live or
+% Mik\TeX.
+%
+% This documentation assumes nothing about your personal
+% \TeX\ or \MP\ environment. Con\TeX t and the various
+% forms of Lua\TeX\ have \MP\ built-in; with pdf\LaTeX, the
+% author's choice, one can use the |gmp| package to
+% include the source directly in one's document (that's
+% what's been done in this documentation) or develop a
+% simple script to compile them afterwards and include them
+% in the source via |\includegraphics| (probably the
+% quickest option, since compilation is done in advance).
+% Here, we simply post the plain vanilla \MP\ code, and let
+% you work out those details however you prefer.
+%
+% \section{Basic Usage}
+%
+% The core of all the action is the |roundrect| macro; this
+% will set up your rounded rectangle in the plainest
+% way possible. The first argument is the box's height, the
+% second its width, and the third its name, by which you
+% will draw it later:
+%
+% \demonstrate{%
+% \hbox{|roundrect(1in,2in)(rectangle);|}
+% \hbox{|draw rectangle;|}
+% }{%
+% \begin{mpost}
+% roundrect(1in,2in)(rectangle);
+% draw rectangle;
+% \end{mpost}
+% }%
+%
+% We have some options with this. If you want a title bar
+% in your box, say
+% \DescribeMacro{rrtitlebar}|rrtitlebar := true;|:
+%
+% \demonstrate{%
+% \hbox{|rrtitlebar := true;|}
+% \hbox{|roundrect(1in,2in)(rectangle);|}
+% \hbox{|draw rectangle;|}
+% }{%
+% \begin{mpost}
+% rrtitlebar := true;
+% roundrect(1in,2in)(rectangle);
+% draw rectangle;
+% \end{mpost}
+% }%
+%
+% By default, |roundrect| displays a lower border for the
+% title bar; if you don't like this, say
+% \DescribeMacro{rrtitlebotborder}
+% |rrtitlebotborder := false;|:
+%
+% \demonstrate{%
+% \hbox{|rrtitlebar := true;|}
+% \hbox{|rrtitlebotborder := false;|}
+% \hbox{|roundrect(1in,2in)(rectangle);|}
+% \hbox{|draw rectangle;|}
+% }{%
+% \begin{mpost}
+% rrtitlebotborder := false;
+% rrtitlebar := true;
+% roundrect(1in,2in)(rectangle);
+% draw rectangle;
+% \end{mpost}
+% }%
+%
+% The command is called |rrtitlebotborder| because it's
+% usually on the bottom of the title bar; however, it
+% retains this name even when the title bar is elsewhere.
+%
+% Although it's impossible to tell whether this box still
+% has a title bar, we can verify it (if we don't believe it)
+% by changing the background color with
+% \DescribeMacro{rrtitlebgcolor}|rrtitlebgcolor|:
+%
+% \demonstrate{%
+% \hbox{|rrtitlebar := true;|}
+% \hbox{|rrtitlebotborder := false;|}
+% \hbox{|rrtitlebgcolor := green;|}
+% \hbox{|roundrect(1in,2in)(rectangle);|}
+% \hbox{|draw rectangle;|}
+% }{%
+% \begin{mpost}
+% rrtitlebotborder := false;
+% rrtitlebar := true;
+% rrtitlebgcolor := green;
+% roundrect(1in,2in)(rectangle);
+% draw rectangle;
+% \end{mpost}
+% }%
+%
+% And while we're at it, we may as well color the background
+% of the main part of the box with
+% \DescribeMacro{rrinnercolor}|rrinnercolor|:
+%
+% \demonstrate{%
+% \hbox{|rrtitlebar := true;|}
+% \hbox{|rrtitlebotborder := false;|}
+% \hbox{|rrinnercolor := blue;|}
+% \hbox{|rrtitlebgcolor := green;|}
+% \hbox{|roundrect(1in,2in)(rectangle);|}
+% \hbox{|draw rectangle;|}
+% }{%
+% \begin{mpost}
+% rrtitlebar := true;
+% rrtitlebotborder := false;
+% rrinnercolor := blue;
+% rrtitlebgcolor := green;
+% roundrect(1in,2in)(rectangle);
+% draw rectangle;
+% \end{mpost}
+% }%
+%
+% We can also change the colors of the border around the box
+% (\DescribeMacro{rrbordercolor}|rrbordercolor|), the colors
+% of the title bar's border
+% (\DescribeMacro{rrtitlebordercolor}|rrtitlebordercolor|),
+% and the line between the title bar and the body, if any
+% (\DescribeMacro{rrtitlebotbordercolor}|rrtitlebotbordercolor|):
+%
+% \demonstrate{%
+% \hbox{|rrtitlebar := true;|}
+% \hbox{|rrtitlebotborder := false;|}
+% \hbox{|rrinnercolor := blue;|}
+% \hbox{|rrbordercolor := (0,1,1);|}
+% \hbox{|rrtitlebordercolor := (1,1,0);|}
+% \hbox{|rrtitlebotbordercolor := red;|}
+% \hbox{|rrtitlebotbordercolor := red;|}
+% \hbox{|rrtitlebgcolor := green;|}
+% \hbox{|roundrect(1in,2in)(rectangle);|}
+% \hbox{|draw rectangle;|}
+% }{%
+% \begin{mpost}
+% rrtitlebar := true;
+% rrtitlebotborder := true;
+% rrinnercolor := blue;
+% rrbordercolor := (0,1,1);
+% rrtitlebordercolor := (1,1,0);
+% rrtitlebotbordercolor := red;
+% rrtitlebgcolor := green;
+% roundrect(1in,2in)(rectangle);
+% draw rectangle;
+% \end{mpost}
+% }%
+%
+% If there is no title bar, then |rrinnercolor| and
+% |rrbordercolor| will affect the entire box:
+%
+% \demonstrate{%
+% \hbox{|rrinnercolor := red;|}
+% \hbox{|rrbordercolor := blue;|}
+% \hbox{|roundrect(1in,2in)(rectangle);|}
+% \hbox{|draw rectangle;|}
+% }{%
+% \begin{mpost}
+% rrinnercolor := red;
+% rrbordercolor := blue;
+% roundrect(1in,2in)(rectangle);
+% draw rectangle;
+% \end{mpost}
+% }%
+%
+% We can put text in the title bar with
+% \DescribeMacro{rrtitletext}|rrtitletext| (which is colored
+% by \DescribeMacro{rrtitlecolor}|rrtitlecolor|) and
+% \DescribeMacro{rrbodytext}|rrbodytext| (which is colored
+% by \DescribeMacro{rrtextcolor}|rrbodytextcolor|):
+%
+% \demonstrate{%
+% \hbox{|rrinnercolor := red;|}
+% \hbox{|rrtitlebgcolor := blue;|}
+% \hbox{|rrtitlecolor := black;|}
+% \hbox{|rrtextcolor := white;|}
+% \hbox{|rrbodytext := "Checking to see what happens when lines wrap";|}
+% \hbox{|rrtitletext := "TITLE";|}
+% \hbox{|roundrect(1in,2in)(rectangle);|}
+% \hbox{|draw rectangle;|}
+% }{%
+% \begin{mpost}
+% rrtitlebar := true;
+% rrinnercolor := red;
+% rrtitlebgcolor := blue;
+% rrtitlecolor := black;
+% rrtextcolor := white;
+% rrbodytext := "Checking to see what happens when lines wrap";
+% rrtitletext := "TITLE";
+% roundrect(1in,2in)(rectangle);
+% draw rectangle;
+% \end{mpost}
+% }%
+%
+% We see we should raise the title text; the default value
+% is $\frac{1}{6}$ of the box's height, which is too large
+% for this small box. So we adjust it with
+% \DescribeMacro{rrtitleht}|rrtitleht|; this is expressed as
+% a distance up from the bottom border of the title bar:
+%
+% \demonstrate{%
+% \hbox{|rrinnercolor := red;|}
+% \hbox{|rrtitlebgcolor := blue;|}
+% \hbox{|rrtitlecolor := black;|}
+% \hbox{|rrtextcolor := white;|}
+% \hbox{|rrbodytext := "Checking to see what happens when lines wrap";|}
+% \hbox{|rrtitletext := "TITLE";|}
+% \hbox{|rrtitleht := 0.3in;|}
+% \hbox{|roundrect(1in,2in)(rectangle);|}
+% \hbox{|draw rectangle;|}
+% }{%
+% \begin{mpost}
+% rrtitlebar := true;
+% rrinnercolor := red;
+% rrtitlebgcolor := blue;
+% rrtitlecolor := black;
+% rrtextcolor := white;
+% rrbodytext := "Checking to see what happens when lines wrap";
+% rrtitletext := "TITLE";
+% rrtitleht := 0.3in;
+% roundrect(1in,2in)(rectangle);
+% draw rectangle;
+% \end{mpost}
+% }%
+%
+% Plainly, this is terrible style; but the principles are
+% accurately shown here.
+%
+% We can easily change the font separately for both title
+% and body with \DescribeMacro{rrtitlefont}|rrtitlefont| and
+% \DescribeMacro{rrtextfont}, with the usual font-changing
+% commands that we would use in our text. We've also been
+% using rectangles with extremely rounded borders; this
+% reflects the default ``border radius'' of |roundrect|,
+% which is |40pt|. We can change how rounded our corners
+% are with \DescribeMacro{rrborderrad}|rrborderrad|, and how
+% wide our border is with
+% \DescribeMacro{rrborderwd}|rrborderwd|:
+%
+% \demonstrate{%
+% \hbox{|rrtitlebar := true;|}
+% \hbox{|rrborderrad := 20pt;|}
+% \hbox{|rrborderwd := 5pt;|}
+% \hbox{|rrbodytext := "Checking to see what happens when lines wrap";|}
+% \hbox{|rrtitletext := "TITLE";|}
+% \hbox{|rrtitlefont := "$\backslash$fontsize\{14pt\}\{17pt\}$\backslash$selectfont$\backslash$ bfseries$\backslash$ sffamily";|}
+% \hbox{|rrtextfont := "$\backslash$fontsize\{14pt\}\{17pt\}$\backslash$selectfont$\backslash$itshape";|}
+% \hbox{|rrtitleht := 0.3in;|}
+% \hbox{|roundrect(1in,2in)(rectangle);|}
+% \hbox{|draw rectangle;|}
+% }{%
+% \begin{mpost}
+% rrtitlebar := true;
+% rrborderrad := 20pt;
+% rrborderwd := 5pt;
+% rrbodytext := "Checking to see what happens when lines wrap";
+% rrtitletext := "TITLE";
+% rrtitlefont := "\unexpanded{\fontsize{14pt}{17pt}\selectfont\bfseries\sffamily} ";
+% rrtextfont := "\unexpanded{\fontsize{14pt}{17pt}\selectfont\itshape} ";
+% rrtitleht := 0.3in;
+% roundrect(1in,2in)(rectangle);
+% draw rectangle;
+% \end{mpost}
+% }%
+%
+% Be sure, if you are calling \MP\ from \LaTeX\ via |gmp| or
+% some similar package, that you wrap any \LaTeX\ commands
+% in an |\unexpanded| environment; otherwise \LaTeX\ will
+% expand them in a way that \MP\ won't be able to process.
+%
+% We can even tell |roundrect| that we want our title bar on
+% the bottom, with \DescribeMacro{rrtitleside}|rrtitleside|,
+% or aligned right or left rather than centered, with
+% \DescribeMacro{rrtitlepos}|rrtitlepos|:
+%
+% \demonstrate{%
+% \hbox{|rrtitlebar := true;|}
+% \hbox{|rrbodytext := "Checking to see what happens when lines wrap a lot; will it overlap the title bar or not";|}
+% \hbox{|rrtitletext := "TITLE";|}
+% \hbox{|rrtitletext := "TITLE";|}
+% \hbox{|rrtitleht := 0.3in;|}
+% \hbox{|rrtitleside := "bot";|}
+% \hbox{|rrtitlepos := "right";|}
+% \hbox{|roundrect(1in,2in)(rectangle);|}
+% \hbox{|draw rectangle;|}
+% }{%
+% \begin{mpost}
+% rrtitlebar := true;
+% rrbodytext := "Checking to see what happens when lines wrap a lot; will it overlap the title bar or not";
+% rrtitletext := "TITLE";
+% rrtitleht := 0.3in;
+% rrtitleside := "bot";
+% rrtitlepos := "right";
+% roundrect(1in,2in)(rectangle);
+% draw rectangle;
+% \end{mpost}
+% }
+%
+% At present, the only options for |rrtitleside| are ``top''
+% and ``bot''; ``right'' and ``left'' should be added soon,
+% once the code is refactored to make it easier. The
+% options for |rrtitlepos| are, predictably, ``left'',
+% ``right'', and ``center''.
+%
+% To restore all these values to the defaults, simply issue
+% the directive
+% \DescribeMacro{rrrestorevals}|rrrestorevals;|; this macro
+% does nothing but replace the default values in all these
+% parameters.
+%
+% And those are the |roundrect| macros; I hope they are useful
+% for someone. Happy \MP ing!
+%
+% \section{Further Work Needed}
+%
+% This really boils down to just one thing: code
+% refactoring. There's too much duplication here; that's
+% what made it hard to add in different values for
+% |rrtitleside|, where it should have been quite easy. At
+% the moment, I don't really have time, so I just put this
+% together as it was and sent it out; but once I move some
+% other projects off my plate, this will get done. But for
+% those who look at the code here and are disgusted by the
+% unnecessary duplication: I know, and I want to fix it.
+
+% \section{Implementation}
+%
+% \begin{macrocode}
+input TEX;
+color rrinnercolor; rrinnercolor := white;
+color rrbordercolor; rrbordercolor := black;
+numeric rrborderwd; rrborderwd := 2pt;
+numeric rrborderrad; rrborderrad := 40pt;
+string rrtitlefont; rrtitlefont := "\fontsize{14pt}{17pt}\selectfont ";
+string rrtextfont; rrtextfont := "\fontsize{10pt}{12pt}\selectfont ";
+color rrtitlecolor; rrtitlecolor := black;
+color rrtextcolor; rrtextcolor := black;
+color rrtitlebgcolor; rrtitlebgcolor := white;
+color rrtitlebordercolor; rrtitlebordercolor := black;
+boolean rrtitlebar; rrtitlebar := false;
+string rrtitleside; rrtitleside := "top";
+numeric rrtitleht; rrtitleht := 0pt;
+string rrtitlepos; rrtitlepos := "center";
+boolean rrtitlebotborder; rrtitlebotborder := true;
+color rrtitlebotbordercolor; rrtitlebotbordercolor := black;
+string rrtitletext; rrtitletext := "";
+string rrbodytext; rrbodytext := "";
+string rrbodyalign; rrbodyalign := "justify";
+string rrbodyaligncom; rrbodyaligncom := "";
+def rrrestorevals =
+ rrinnercolor := white;
+ rrbordercolor := black;
+ rrborderwd := 2pt;
+ rrborderrad := 40pt;
+ rrtitlefont := "\fontsize{14pt}{17pt}\selectfont ";
+ rrtextfont := "\fontsize{10pt}{12pt}\selectfont ";
+ rrtitlecolor := black;
+ rrtextcolor := black;
+ rrtitlebgcolor := white;
+ rrtitlebordercolor := black;
+ rrtitlebar := false;
+ rrtitleside := "top";
+ rrtitleht := 0pt;
+ rrtitlepos := "center";
+ rrtitlebotborder := true;
+ rrtitlebotbordercolor := black;
+ rrtitletext := "";
+ rrbodytext := "";
+ rrbodyalign := "justify";
+ rrbodyaligncom := "";
+enddef;
+def roundrect(expr rrht, rrwd)(suffix name) =
+ TEXPRE("%&latex" & char(10) & "\documentclass{article}\begin{document}");
+ TEXPOST("\end{document}");
+ if (rrtitleht = 0pt):
+ rrtitleht := rrht/6;
+ fi
+ path rra; path rrb; path rrc; path rrd;
+ pair a; pair b; pair c; pair d;
+ a := (0,0) shifted (-rrwd/2,-rrht/2);
+ b := (0,0) shifted (rrwd/2,-rrht/2);
+ c := (0,0) shifted (rrwd/2,rrht/2);
+ d := (0,0) shifted (-rrwd/2,rrht/2);
+ rra := fullcircle scaled rrborderrad shifted (xpart a +
+ (rrborderrad/2),ypart a + (rrborderrad/2));
+ rrb := fullcircle scaled rrborderrad shifted (xpart b -
+ (rrborderrad/2),ypart b + (rrborderrad/2));
+ rrd := fullcircle scaled rrborderrad shifted (xpart d +
+ (rrborderrad/2),ypart d - (rrborderrad/2));
+ rrc := fullcircle scaled rrborderrad shifted (xpart c -
+ (rrborderrad/2),ypart c - (rrborderrad/2));
+ pair f; f := (a--b) intersectionpoint rra;
+ pair g; g := (a--b) intersectionpoint rrb;
+ pair h; h := (b--c) intersectionpoint rrb;
+ pair i; i := (b--c) intersectionpoint rrc;
+ pair j; j := (c--d) intersectionpoint rrc;
+ pair k; k := (c--d) intersectionpoint rrd;
+ pair l; l := (d--a) intersectionpoint rrd;
+ pair m; m := (d--a) intersectionpoint rra;
+ picture name;
+ picture border;
+ pair n; pair o; path rrtitlepath; path rrfinalline;
+ name := image(fill f--g{right}..{up}h--i{up}..{left}j--
+ k{left}..{down}l--m{down}..{right}f--cycle
+ withcolor rrinnercolor);
+ border := image(pickup pencircle scaled rrborderwd;
+ draw f--g{right}..{up}h--i{up}..{left}j--
+ k{left}..{down}l--m{down}..{right}f--cycle
+ withcolor rrbordercolor);
+ addto name also border;
+ pair rrtitlestation;
+ picture rrtitlelabel;
+ if (rrtitlebar):
+ if (rrtitleside = "top"):
+ n := (xpart m,ypart k - (rrtitleht));
+ o := (xpart i,ypart k - (rrtitleht));
+ defaultscale := 4;
+ if (ypart n > ypart l):
+ n := (xpart n,ypart l);
+ o := (xpart o,ypart l);
+ fi
+ rrtitlepath := o--i{up}..{left}j--k{left}..{down}l--n;
+ if (rrtitlepos = "center"):
+ rrtitlestation := 0.5[n,o] shifted (0,rrtitleht/2);
+ elseif (rrtitlepos = "left"):
+ rrtitlestation := n shifted (rrborderrad/4,rrtitleht/2);
+ elseif (rrtitlepos = "right"):
+ rrtitlestation := o shifted (-rrborderrad/4,rrtitleht/2);
+ fi
+ elseif (rrtitleside = "bot"):
+ n := (xpart m,ypart f + (rrtitleht));
+ o := (xpart i,ypart f + (rrtitleht));
+ if (ypart n < ypart m):
+ n := (xpart n,ypart m);
+ o := (xpart o,ypart m);
+ fi
+ rrtitlepath := o--h{down}..{left}g--f{left}..{up}m--n;
+ if (rrtitlepos = "center"):
+ rrtitlestation := 0.5[n,o] shifted (0,-rrtitleht/2);
+ elseif (rrtitlepos = "left"):
+ rrtitlestation := n shifted (rrborderrad/4,-rrtitleht/2);
+ elseif (rrtitlepos = "right"):
+ rrtitlestation := o shifted (-rrborderrad/4,-rrtitleht/2);
+ fi
+ fi
+ rrfinalline = n--o;
+ picture rrtitlepic;
+ picture rrtitlepicb;
+ picture rrtitlebotborderpic;
+ rrtitlebotborderpic := image (draw rrfinalline
+ withcolor rrtitlebotbordercolor);
+ rrtitlepicb := image(draw rrtitlepath withcolor rrtitlebordercolor);
+ if (rrtitlebotborder = true):
+ addto rrtitlepicb also rrtitlebotborderpic;
+ fi
+ rrtitlepath := buildcycle(rrtitlepath,rrfinalline);
+ rrtitlepic := image(fill rrtitlepath withcolor rrtitlebgcolor);
+ if (rrtitlepos = "center"):
+ rrtitlelabel := image(label(TEX(rrtitlefont&" "&rrtitletext),
+ rrtitlestation) withcolor rrtitlecolor);
+ elseif (rrtitlepos = "left"):
+ rrtitlelabel := image(label.rt(TEX(rrtitlefont&" "&rrtitletext),
+ rrtitlestation) withcolor rrtitlecolor);
+ elseif (rrtitlepos = "right"):
+ rrtitlelabel := image(label.lft(TEX(rrtitlefont&" "&rrtitletext),
+ rrtitlestation) withcolor rrtitlecolor);
+ fi
+ if (rrbodyalign = "center"):
+ rrbodyaligncom := "\centering ";
+ elseif (rrbodyalign = "left"):
+ rrbodyaligncom := "\flushleft\vskip-\baselineskip ";
+ elseif (rrbodyalign = "right"):
+ rrbodyaligncom := "\flushright\vskip-\baselineskip ";
+ fi
+ picture rrbodytextpic;
+ if (rrtitleside = "top"):
+ rrbodytextpic :=
+ image(label.lrt(TEX("\parbox{"&decimal(rrwd-2rrborderwd-rrborderrad/2)&"bp}{"&rrbodyaligncom&rrtextfont&rrbodytext&"}"),n) withcolor rrtextcolor) shifted (rrborderrad/4,0);
+ elseif (rrtitleside = "bot"):
+ rrbodytextpic :=
+ image(label.urt(TEX("\parbox{"&decimal(rrwd-2rrborderwd-rrborderrad/2)&"bp}{"&rrbodyaligncom&rrtextfont&rrbodytext&"}"),n) withcolor rrtextcolor) shifted (rrborderrad/4,0);
+ fi
+ addto name also rrtitlepic;
+ addto name also rrtitlepicb;
+ addto name also rrtitlelabel;
+ addto name also rrbodytextpic;
+ fi
+enddef;
+% \end{macrocode}
diff --git a/Master/texmf-dist/source/metapost/roundrect/roundrect.ins b/Master/texmf-dist/source/metapost/roundrect/roundrect.ins
new file mode 100644
index 00000000000..df936f03838
--- /dev/null
+++ b/Master/texmf-dist/source/metapost/roundrect/roundrect.ins
@@ -0,0 +1,69 @@
+% +AMDG This document was begun on 1E June 11EE, the vigil
+% of the Nativity of St. John the Baptist, and it is humbly
+% dedicated to him and to the Immaculate Heart of Mary, for
+% their prayers, and to the Sacred Heart of Jesus, for His
+% mercy.
+%
+% This document is copyright 2015 by Donald P. Goodman, and is
+% released publicly under the LaTeX Project Public License. The
+% distribution and modification of this work is constrained by the
+% conditions of that license. See
+% http://www.latex-project.org/lppl.txt
+% for the text of the license. This document is released
+% under version 1.3 of that license, and this work may be distributed
+% or modified under the terms of that license or, at your option, any
+% later version.
+%
+% This work has the LPPL maintenance status 'maintained'.
+%
+% The Current Maintainer of this work is Donald P. Goodman
+% (dgoodmaniii@gmail.com).
+%
+% This work consists of the files roundrect.dtx and
+% roundrect.ins, along with the generated file roundrect.mp
+% and roundrect.pdf, and the README.
+
+\def\batchfile{roundrect.ins}
+\input docstrip.tex
+
+\preamble
+This is a generated file.
+
+This document is copyright 2015 by Donald P. Goodman, and is
+released publicly under the LaTeX Project Public License. The
+distribution and modification of this work is constrained by the
+conditions of that license. See
+ http://www.latex-project.org/lppl.txt
+for the text of the license. This document is released
+under version 1.3 of that license, and this work may be distributed
+or modified under the terms of that license or, at your option, any
+later version.
+
+This work has the LPPL maintenance status 'maintained'.
+
+The Current Maintainer of this work is Donald P. Goodman
+(dgoodmaniii@gmail.com).
+
+This work consists of the files roundrect.dtx and
+roundrect.ins, along with the generated file roundrect.mp
+and roundrect.pdf, and the README.
+\endpreamble
+
+\keepsilent
+\generate{\file{roundrect.mp}{\from{roundrect.dtx}{package}}}
+
+\Msg{******************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the}
+\Msg{* following file into a directory searched by Metapost:}
+\Msg{*}
+\Msg{* \space\space roundrect.mp}
+\Msg{*}
+\Msg{* To produce the documentation run the file roundrect.dtx}
+\Msg{* through LaTeX.}
+\Msg{*}
+\Msg{* Happy Metaposting!}
+\Msg{******************************************************}
+
+\endbatchfile
+\endinput