2

I have a grid on my beamer slides generated by:

\usepackage[texcoord,grid,gridunit=mm,gridcolor=black!30,subgridcolor=gray!10]{eso-pic}

I'd like to draw a rectangle in tikz with:

\draw [textpos,color=yellow,fill=yellow!25] (0,0) -- (10,0) rectangle (20,10) -- (30,10);

How can I align tikz with eso-pic?

6

1 Answer 1

3

It is straightforward to synchronize the coordinate systems of eso-pic with an overlay tikzpicture.

\documentclass{beamer}
\usepackage[texcoord,grid,gridunit=mm,gridcolor=black!30,subgridcolor=gray!10]{eso-pic}
\usepackage{tikz}
\begin{document}
\begin{frame}[t]
\frametitle{A slide}
\begin{tikzpicture}[overlay,remember picture,x=1mm,y=-1mm,shift={(current
page.north west)}]
\draw[-latex] (40,40) -- (60,60);
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

And if you are willing to append remember picture to every TikZ picture you can literally use your suggested notation.

\documentclass{beamer}
\usepackage[texcoord,grid,gridunit=mm,gridcolor=black!30,subgridcolor=gray!10]{eso-pic}
\usepackage{tikz}
\tikzset{textpos/.style={overlay,x=1mm,y=-1mm,shift={(current page.north
west)}},every picture/.append style={remember picture}}
\begin{document}
\begin{frame}[t]
\frametitle{A slide}
\begin{tikzpicture}
\draw[textpos,-latex] (40,40) -- (60,60);
\draw [textpos,color=yellow,fill=yellow!25] (0,0) -- (10,0) rectangle (20,10) -- (30,10);
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .