Please see the following definition:
\tikzstyle{boxStyle} = [draw=blue!80, fill=blue!9, very thick,
rectangle, rounded corners=3mm, inner sep=10pt, inner ysep=15pt]
\tikzstyle{boxTitleStyle} =[fill=blue!80, rectangle, rounded corners=2mm,
text=white, inner sep=10pt, inner ysep=7pt, left=10pt]
\newcommand{\textBox}[2] {
\begin{tikzpicture}
\node [boxStyle] (box) {\begin{minipage}{0.5\textwidth}#2\end{minipage}};
\node[boxTitleStyle] at (box.north east) {#1};
\end{tikzpicture}
}
Now I want to covert it as an environment:
\newenvironment{textBox}[1]
{\begin{tikzpicture}\node [boxStyle] (box) {\begin{minipage}{0.5\textwidth}}}
{\end{minipage};\node[boxTitleStyle] at (box.north east) {#1};\end{tikzpicture}}
or,
\newenvironment{textBox}[1]
{\begin{tikzpicture}\node [boxStyle] (box) \begin{minipage}{0.5\textwidth}}
{\end{minipage};\node[boxTitleStyle] at (box.north east) {#1};\end{tikzpicture}}
are not true, any suggestions?


mdframedpackage to have similar constructs. – percusse Dec 25 '12 at 15:37