3

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!

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

2 Answers 2

5

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}

enter image description here

0
2
\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}
1
  • @QuantumPenguin You are welcome. But if you are really using this to add a frame, you should take Ignasi's answer. Apr 12, 2016 at 16:23

You must log in to answer this question.

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