Question
I would like to put a minipage environment inside of a tikz node. I know this is done already with the align=left command, but if you set a minimum width of the node to \linewidth, then the text is left aligned, but surrounded by white space padding (depending on how much text you include)
Problem
When I set the width of the minipage environment to \linewidth, minipage grabs the width of the line on a page instead of the width of the node.
Sample Code
\newcommand{\warning}[1]{%
% Define box and box title style
\tikzstyle{mybox} = [align=left,draw=red, very thick,
rectangle, rounded corners, inner sep=10pt, inner ysep=10pt,maximum width=\linewidth]
\tikzstyle{fancytitle} =[fill=red, text=white,rounded corners]
\begin{tikzpicture}
\node [mybox] (box){%
\begin{minipage}{1\textwidth}
#1
\end{minipage}
};
\node[fancytitle, right=10pt] at (box.north west) {Note:};
\end{tikzpicture}
}%
Adapted code from http://www.texample.net/tikz/examples/boxes-with-text-and-math/