Align environment inside TikZ

This is not just a problem with align but with almost any other non-tikz construction. You need to put tikz in to a situation where it will be expecting ordinary LaTeX commands. One of these is the label for a node. Now to protect things further from tikz's parsing, you can include the material in a minipage as below. Similar issues would be seen with e.g. the non-AMS displaymath.

Sample output

\documentclass{article}

\usepackage{amsmath}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node at (0,0) {
\begin{minipage}{0.9\linewidth}
  \begin{align}
    \notag &a_1,\ &b_1,\ &c_1,\ &d_1,\ &e_1\ \mbox{etc.}\\
    \notag &a_2,\ &b_2,\ &c_2,\ &d_2,\ &e_2\ \mbox{etc.}
  \end{align}
\end{minipage}
};
%% draw some stuff using tikz on the the aligned text.
\end{tikzpicture}

\end{document}

Inside tikzpicture you should speak tikz language. This can be put indise a node and a minipage.

\documentclass{article}
\usepackage{amsmath,tikz}
\begin{document}
  \begin{figure}
\centering
\begin{tikzpicture}
\node at (0,0) {%
\begin{minipage}{5cm}%adjust width here
\begin{align}
    \notag &a_1,\ &b_1,\ &c_1,\ &d_1,\ &e_1\ \mbox{etc.}\\
    \notag &a_2,\ &b_2,\ &c_2,\ &d_2,\ &e_2\ \mbox{etc.}
\end{align}
\end{minipage}
};
%% draw some stuff using tikz on the the aligned text.
\end{tikzpicture}
\end{figure}
\end{document}

enter image description here

Tags:

Tikz Pgf

Align