Aligned equations inside of TikZ node.
You could use an aligned
environment with inline math inside nodes, their size is automatically calculated. Here's a small example with such a node in a tree:
\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}[every node/.style={rectangle,draw}]
\node {Example:}
child {node {%
$\begin{aligned}
a &= bx + c\\
a+b &= d +1
\end{aligned}$}};
\end{tikzpicture}
\end{document}
Output:
EDIT
As pointed out by Zarko in the comments, the text width
option to the node already defines a minipage. Thus, the minipage
environment is superfluous unless you want the minipage width different than the node width.
I know this is old, but, for future reference, if you want to number your equations or really want to use an align
environment, you may place it inside a minipage
and specify both the node text width
and minipage width properties to whatever works for you.
\documentclass[border=0.5cm]{standalone}
\usepackage{tikz}
\usepackage{amsmath}
\begin{document}
\begin{tikzpicture}
% These are needed to remove the vertical space around above and below
% the align and flalign environments
\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\node [rectangle, draw] (example) {Examples:};
\node [rectangle, draw, right=1cm, text width=4cm] (eq1) at (example.east) {
\begin{minipage}{\textwidth}
\begin{align}
x + y &= 1 \\
x - 2y &= 1
\end{align}
\end{minipage}
};
\node [rectangle, draw, below=0.5cm, text width=4cm] (eq2) at (eq1.south) {
\begin{minipage}{\textwidth}
\begin{flalign}
x + y &= 2& \\
x - 2y &= 2&
\end{flalign}
\end{minipage}
};
\draw [->, line width=1pt] (example) -- (eq1);
\draw [->, line width=1pt] (example) |- (eq2);
\end{tikzpicture}
\end{document}
This example also includes flalign
, since I believe it looks better than align
when the node has borders.