Inspired by this question and answer I was looking to create a convenient command for a titled sidebar of variable width.
Thus far I have solved half the problem. The following code gives a title, but I haven't yet got the variable width worked out...
\documentclass{article}
\usepackage{wrapfig}
\usepackage{tcolorbox}
\usepackage{lipsum}
\newenvironment{SideBox}[1]
{\wrapfigure{#1}{0.5\textwidth} \tcolorbox[title=#1]}
{\endtcolorbox\endwrapfigure}
\begin{document}
\begin{SideBox}{A fancy title}
text inside the box
\end{SideBox}
\lipsum[2]
\end{document}
Any suggestions on how to improve the code to get variable width via a command like:
\begin{SideBox}{0.3}{A fancy title}
text inside the box
\end{SideBox}
Thanks for any help.

\newenvironment{SideBox}[2]. What was the value of extending this to 3 input params? Is that to facilitate other options (like being yellow) when calling sidebox? – Mark_Anderson Mar 13 '17 at 19:17tcolorboxoptions, which are given as first optional argument, i.e.\SideBox[options for tcolorbox]{width}{Title}– Mar 13 '17 at 19:20wrapfigurewrong, however – Mar 13 '17 at 19:23