# Tikz nested nodes position [closed]

(Edited as suggested)

I have following code involving connected nodes:

\documentclass{article}
\usepackage{tikz}
\tikzstyle{every picture}+=[remember picture]
\begin{document}
$$P(t) = \tikz[baseline]{\node[fill=blue!50, anchor=base] (t1) { \epsilon_{0}\chi^{(1)}E(t) };} + \tikz[baseline]{\node[fill=red!50, anchor=base] (t2) { \tikz[baseline]{\node[fill=green!25, anchor=base] (t21) { \epsilon_{0}\chi^{(2)}E^{2}(t) };} + \tikz[baseline]{\node[fill=yellow!25, anchor=base] (t22) { \epsilon_{0}\chi^{(3)}E^{3}(t) };} + \cdots };}$$
\begin{itemize}
\item \tikz[baseline]{\node[anchor=base] (n1) {Linear};}
\item \tikz[baseline]{\node[anchor=base] (n2) {Nonlinear};}
\begin{itemize}
\item \tikz[baseline]{\node[anchor=base] (n21) {2. order};}
\item \tikz[baseline]{\node[anchor=base] (n22) {3. order};}
\end{itemize}
\end{itemize}
\begin{tikzpicture}[overlay]
\path[blue, ->, line width=1pt] (n1.north east) edge[out=45, in=-90]     (t1.south);
\path[red, ->, line width=1pt] (n2.north east) edge[out=45, in=-90] (t2.south);
\path[red, ->, dashed, line width=0.75pt] (n21.east) edge[out=0, in=-90] (t21.south);
\path[red, ->, dashed, line width=0.75pt] (n22.east) edge[out=0, in=-90] (t22.south);
\end{tikzpicture}
\end{document}


This code gives me following output, where is some offset in x coordinate inside of node t2:

If I comment out the creation of this node (t2), the dashed arrows now pointing in correct locations:

What I want is the first figure (red solid line and red fill) with dashed arrows pointing at positions as shown in the second figure. Is there a way how to do this?

Thanks a lot for any suggestions

## closed as off-topic by Qrrbrbirlbel, Werner, Thorsten, Claudio Fiandrino, Heiko OberdiekSep 11 '13 at 17:37

• This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• Welcome to TeX.SX! Please make your code compilable, starting with \documentclass{...} and ending with \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to help you. Help them help you: remove that one hurdle between you and a solution to your problem. – jub0bs Jul 29 '13 at 19:27
• Nesting TikZ pictures = bad idea. Options are inherited. Please make your code compilable as @Jubobs explained or add a picture of how your output should look like. If you want to fill the area behind a node you can use the backgrounds library and/or the pgfonlayer environment. – Qrrbrbirlbel Jul 29 '13 at 19:46
• I updated the post little bit, sorry about that. Hope it is better now. – Radek Jul 29 '13 at 21:37
• Have you compiled twice? It looks good to me. You might be interested in the hf-tikz package. – Qrrbrbirlbel Jul 29 '13 at 21:45
• This question appears to be off-topic because it is about a problem that does not exist if correctly compiled with pdf(La)TeX. – Qrrbrbirlbel Sep 11 '13 at 16:43