I am following the example here to draw an arrow from one position on a picture to another. I successfully reproduce the answer, but fail to adapt it to work with the nodes I draw over graphics.
My tikz setup is
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes}
\tikzstyle{every picture}+=[remember picture]
The images are included and the positions are specified like this (i want to also add a few rectangles and more text on top of the image, which works fine like this):
\includegraphics[width=.45\textwidth]{./white.png}
\hspace{-.45\textwidth}
\resizebox{.45\textwidth}{!}{
\tikz[baseline,remember picture]{
\useasboundingbox (0,0) rectangle (580pt,300pt);
\draw[color=black] (330pt,200pt) node[fill=green!20] (bad) {see how bad it is};
}
}
The image white.png
is 580 pixels wide and 300 pixels high. (and for this minimal example just plain white)
(which i do for two separate images on the same frame. the node in the second image is then called good
)
I try to draw the arrow between the two with
\begin{tikzpicture}[remember picture,overlay]
\path[draw=magenta,thick,->] ([yshift=2mm]bad.north) to [out=0, in=0,distance=1in] (good.east);
\end{tikzpicture}
This arrow is however not drawn. I did establish that i can draw arrows within an image
\includegraphics[width=.45\textwidth]{./white.png}
\hspace{-.45\textwidth}
\resizebox{.45\textwidth}{!}{
\tikz[baseline,remember picture]{
\useasboundingbox (0,0) rectangle (580pt,300pt);
\draw[color=black] (330pt,200pt) node[fill=green!20] (bad) {~};
\draw[color=black] (330pt,100pt) node[fill=green!20] (good) {~};
\path[draw=magenta,thick,->] ([yshift=2mm]bad.north) to [out=0, in=0,distance=1in] (good.east);
}
}
The full document is:
\documentclass[8pt,xcolor=dvipsnames,table]{beamer}
\linespread{1.1}
\xdefinecolor{darkgreen}{RGB}{000, 128, 000}
\mode<presentation>
{
\usetheme{Rochester}
\usecolortheme[named=BrickRed]{structure}
\setbeamercovered{invisible}
\setbeamertemplate{mini frames}[box]
\setbeamertemplate{navigation symbols}{}}
\usepackage{appendixnumberbeamer}
\beamertemplateshadingbackground{Red!01!White}{White}
\usepackage[absolute,overlay]{textpos}
\useinnertheme{rectangles}
\useoutertheme{infolines}
\usepackage[UKenglish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\DeclareGraphicsRule{*}{mps}{*}{}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes}
\tikzstyle{every picture}+=[remember picture]
\title{some title}
\author[pseyfert]{just me}
\date{\today}
\subject{}
\begin{document}
\begin{frame}
\frametitle{runstats}
\includegraphics[width=.45\textwidth]{./white.png}
\hspace{-.45\textwidth}
\resizebox{.45\textwidth}{!}{
\tikz[baseline,remember picture]{
\useasboundingbox (0,0) rectangle (580pt,300pt);
\draw[color=black] (330pt,200pt) node[fill=green!20] (bad) {see how bad it is};
}
}
\includegraphics[width=.45\textwidth]{./white.png}
\hspace{-.45\textwidth}
\resizebox{.45\textwidth}{!}{
\tikz[baseline,remember picture]{
\useasboundingbox (0,0) rectangle (580pt,300pt);
\draw[color=black] (320pt,200pt) node[fill=green!20] (good) {here it's much better};
}
}
\begin{tikzpicture}[remember picture,overlay]
\path[draw=magenta,thick,->] ([yshift=2mm]bad.north) to [out=0, in=0,distance=1in] (good.east);
\end{tikzpicture}
\end{frame}
\end{document}
I build the document with xelatex minimum.tex
and the result looks like this
where I would expect something with an arrow from left to right