# Adding a tikz picture to every slide in a beamer presenation

I have a tikz drawing I would like to add to every slide in my beamer presentation. Presenly I have to add it manually to every slide - a bit tedious! Is there a way of using a \newcommand to do this automatically?

The code for the tikz image is :

\begin{tikzpicture}[remember picture,overlay]
\draw [line width=2mm,MyColor] (current page.south east) rectangle (current page.north west);
\end{tikzpicture}


Cheers!

• You could define your picture as a logo and see in the Beamer manual or in examples how logos are used. – DRi Apr 12 '16 at 12:47
• @DRi I tried that. I added a \logo in front of the above code, but it just failed to compile. – QuantumPenguin Apr 12 '16 at 12:48
• Besides, you should use a beamer theme which requires a logo. – DRi Apr 12 '16 at 13:25

If you don't mind if it's covered by other text, you can place the picture into the background template.

\documentclass{beamer}
\usepackage{tikz}

\usebackgroundtemplate{
\tikz \draw[line width=2mm, red] ([shift={(1mm,1mm)}]current page.south west) rectangle ([shift={(-1mm,-1mm)}]current page.north east);}

\begin{document}
\begin{frame}
Test
\end{frame}
\end{document}


\documentclass{beamer}

\usepackage{tikz}

\logo{%
\begin{tikzpicture}[remember picture,overlay]
\draw [line width=2mm,black] (current page.south east) rectangle (current page.north west);
\end{tikzpicture}
}

\begin{document}

\begin{frame}
abc
\end{frame}

\end{document}

• @QuantumPenguin You are welcome. But if you are really using this to add a frame, you should take Ignasi's answer. – user36296 Apr 12 '16 at 16:23