Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

\begin{align}
\end{align}

doesn't work

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

Gives a lot of margin and I don't want to manually tune 100.

\nodepart from shapes tikz library seems to be overkill and doesnt do the alignment.

Any ideas?

share|improve this question

1 Answer 1

up vote 20 down vote accepted

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:

alt text

share|improve this answer
    
Great! it works. But why align doesn't? –  Łukasz Lew Aug 8 '10 at 14:26
1  
align is displayed, set off normal text and centered. Here it requires a minipage environment or \parbox, so it needs specifying a width. At least for the centering. –  Stefan Kottwitz Aug 8 '10 at 14:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.