I am looking for a way to simplify the painstaking process of positioning different kind of elements in beamer.
I read this thread and obtained a nice grid using the command \setbeamertemplate{background} and also read this other thread and obtained an even nicer grid using the package eso-pic with the following options \usepackage[texcoord,grid,gridunit=mm,gridcolor=red!20,subgridcolor=green!40]
{eso-pic}.
However, even if I have some reference now of what is where, by means of the grid coordinates, if I try to draw a simple line between two points
\begin{tikzpicture}
\draw[solid,red,line width= 1.5pt,-stealth] (7,-5) -- (9,-4);
\end{tikzpicture}
the line is drawn between two coordinates that do not match the grid coordinates. Any idea why?
Here's an MWE. I left both the grids, just to double check that they matched.
\documentclass{beamer}
\usepackage{tikz} %inline graphics
\usetikzlibrary{hobby,backgrounds,trees,snakes,shapes.callouts,positioning,pgfplots.groupplots}
\usetikzlibrary{positioning}
\usepackage[texcoord,grid,gridunit=mm,gridcolor=red!20,subgridcolor=green!40]
{eso-pic}
\setbeamertemplate{background}{\tikz[overlay]{
\foreach \x in {0,...,15} \node at (\x ,-0.25) {\small$\x$};
\foreach \y in {-15,...,0} \node at (12.5 ,\y) {\small$\y$};
\foreach \x in {0,0.5,...,15} \draw (\x ,-15) -- (\x ,0);
\foreach \y in {-15,-14.5,...,0} \draw (0,\y) -- (15,\y);}
}
\begin{document}
\begin{frame}
%
\begin{tikzpicture}
\draw[on grid,solid,red,line width= 1.5pt,-stealth] (0,0) -- (2,2);
\end{tikzpicture}
%
\end{frame}
\end{document}
Cheers

\usetikzlibraryline. – gbernardi Sep 28 '15 at 07:32