I need to draw some diagrams in tikz for which the labels have trees as indices. I render these trees as tikz diagrams, too. Even with simple diagrams, such as an arrow between two nodes, if a tree is inserted as label of the arrow, then the result is very unpleasant.
Here is a MWE.
\documentclass{standalone}
\usepackage{tikz}
\newcommand{\TreeW}
{
\tikz
{
\draw[-] (-.1,.2) -- (0,0) -- (.1,.2); \draw[-] (0,0) -- (0,.2);
}
}
\newcommand{\TreeV}
{%
{%
\mathchoice%
{\tikz \draw[-] (-.1,.2) -- (0,0) -- (.1,.2);}%
{\tikz \draw[-] (-.1,.2) -- (0,0) -- (.1,.2);}%
{\tikz \draw[-] [thin, scale=.75] (-.1,.2) -- (0,0) -- (.1,.2);}%
{\tikz \draw[-] [thin, scale= .5] (-.1,.2) -- (0,0) -- (.1,.2);}%
}
}
\begin{document}
\begin{tikzpicture}[scale=1.5]
\node (s0) at (180:2) {$\TreeW_{\TreeV}$};
\node (s1) at (0,0) {$\TreeV$};
\draw[->] [shorten >=10pt, shorten <=10pt] (s0) --
node [above, near start] {$\TreeW$} node [below, near end] {\hbox{$\TreeV$}} (s1);
\end{tikzpicture}
\end{document}
This gives me the following result.
I tried to search a bit for similar problems, but I haven't encountered any; although it is most likely a well-known issue.
pic
. See TikZ manual 3.1.4 on page 259. – AndréC Aug 19 at 16:13