[Tex/LaTex] An arrow between two tikzpictures

arrowstikz-pgfvertical alignment

How can I display an arrow between two tikzpictures (of the same size) so that the arrow is alligned with the centre of the pictures?

\documentclass{article}
\usepackage{tikz}
\begin{document}


\begin{tikzpicture}[
  tlabel/.style={pos=0.4,right=-1pt},
]
\node{$\Rightarrow$}
child {node {$\wedge$}
child {node {$p$}}
child {node {$q$}}}
child {node {$r$}}
;
\end{tikzpicture}

 $\rightarrow$ % the arrow between the pictures

\begin{tikzpicture}[
  tlabel/.style={pos=0.4,right=-1pt},
]
\node{$\Rightarrow$}
child {node {$\wedge$}
child {node {$p$}}
child {node {$q$}}}
child {node {$r$}}
;
\end{tikzpicture}

\end{document}

Best Answer

Do you want something like this?

arrow between

This uses the baseline key with the value (current bounding box.center) to align the centres of the pictures with the current baseline.

\documentclass{article}
\usepackage{tikz}
\begin{document}
  \begin{tikzpicture}[
    tlabel/.style={pos=0.4,right=-1pt},
    baseline=(current bounding box.center)
    ]
    \node{$\Rightarrow$}
    child {node {$\wedge$}
      child {node {$p$}}
      child {node {$q$}}}
    child {node {$r$}}
    ;
  \end{tikzpicture}
  $\rightarrow$ % the arrow between the pictures
  \begin{tikzpicture}[
    tlabel/.style={pos=0.4,right=-1pt},
    baseline=(current bounding box.center)
    ]
    \node{$\Rightarrow$}
    child {node {$\wedge$}
      child {node {$p$}}
      child {node {$q$}}}
    child {node {$r$}}
    ;
  \end{tikzpicture}
\end{document}

If you are drawing trees, you should consider one of the specialised libraries or packages as they offer greater power and flexibility and, in many cases, a syntax which allows you to specify a tree much more concisely.

Packages include forest (based on TikZ), tikz-qtree (obviously TikZ-based), qtree (non-TikZ) and the TikZ library trees (much less powerful and does not support specialised syntax).