Aligned equations inside of a TikZ node

Lukasz Lew asked on TeX.SX:

 
How can I create a tree node with aligned math equations inside?
 

\begin{align}
\end{align}

doesn’t work and

\begin{minipage}{100}
  \begin{align}
    ...
  \end{align}
\end{minipage}

gives a lot of margin and I don’t want to manually tune.

\nodepart from shapes tikz library seems to be overkill and doesn’t do the alignment.

Any ideas?

Answer:

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:

aligned equations in TikZ node
Stefan Kottwitz

08. August 2010 by stefan
Categories: Uncategorized | Leave a comment

Leave a Reply

Required fields are marked *