
Sou novo no TikZ e estou tentando usar o align
ambiente para alinhar algum texto e desenhar algo nele usando algumas linhas do TikZ.
Mas o problema é que o pdfLaTeX está gerando um erro sempre que tento colocar o alignment
ambiente dentro de uma imagem TikZ.
Aqui está meu código:
\begin{figure}
\centering
\begin{tikzpicture}
\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}
%% draw some stuff using tikz on the the aligned text.
\end{tikzpicture}
\end{figure}
mas estou sempre recebendo este erro:
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.358 \end{align}
PS Se eu colocar align
fora do ambiente TikZ, tudo funciona normalmente.
Responder1
Este não é apenas um problema com, align
mas com quase qualquer outra não- tikz
construção. Você precisa se colocar tikz
em uma situação em que esperará comandos comuns do LaTeX. Um deles é o rótulo de um nó. Agora, para proteger ainda mais as coisas da tikz
análise de , você pode incluir o material como minipage
abaixo. Problemas semelhantes seriam observados, por exemplo, com os não-AMS displaymath
.
\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}
Responder2
Dentro tikzpicture
você deve falar tikz
a linguagem. Isso pode ser colocado entre a node
e 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}