I have two figures (.pdf) side-by-side and would like to draw an arrow from the right
one to the left one, with the arrow head ending at a specific location in the
left figure. Here is a MWE:
\documentclass{scrartcl}
\usepackage{tikz}
\begin{document}
\begin{figure}[htbp]
\tikz[remember picture]{\node(figleft){\framebox{\parbox[c][3cm]{0.4\textwidth}{\hspace{3.5cm}\raisebox{2cm}{Figure 1}}}};}%
\hfill
\raisebox{10mm}{\tikz[remember picture]{\node(figright){\framebox[0.4\textwidth]{Figure 2}};}}%
\tikz[overlay, remember picture]{\draw[thick, stealth-] (figleft-|figleft.north) -- (figright-|figright.west);}
\end{figure}
\end{document}
The arrow head should end at a specific location inside Figure 1 (say, where
the text "Figure 1" appears). I assume I'd need to somehow specify the
location of the node figleft
. A crude idea was to place a node at the
location of "Figure 1" and then have the arrow drawn to that location. I
tried with \tikz[remember picture]{\node at (-1cm,3cm) (anchor) {Anchor};}
but the placement (-1cm, 3cm)
didn't seem to be respected.
Best Answer
It seems odd to put
\framebox
inside a node when almost the exact same thing is achieved by[draw]
. The only difference is[inner sep]
vs.\fboxsep
. Also(figleft-|figleft.north)
is equivalent to simply(figleft.north)
etc.More importantly,
\raisebox
raises the text by lowering the baseline. So[baseline=-10mm]
is equivalent to\rasiebox{10mm){...}
. Similarly, Figure 1 is 2cm above(figleft.base)
.