# add code on every latex beamer frame [closed]

I would like to add some lines of code at the beginning of each frame, like the code which is uncommented here. However, the addtobeamertemplate does not work in the way I expected it. Does anybody know how to do this?

\documentclass[slidestop]{beamer}

\begin{document}

\begin{frame}{Test}
%\setlength{\abovedisplayskip}{2pt}
%\setlength{\belowdisplayskip}{2pt}
%\vspace*{-10pt}

\begin{block}{Test}
\end{block}
\begin{gather*}
a=b
\end{gather*}

\end{frame}
\end{document}

-

## closed as unclear what you're asking by Joseph Wright♦Aug 5 '13 at 15:42

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

According to the documentation, frame begin is used only when beamer is in article mode. –  egreg Jan 20 '13 at 12:12
@egreg Thank you for the hint, so I search for a corresponding replacement for normal mode. Any idea? –  7asd44 Jan 20 '13 at 12:37
Maybe you could explain what you want to achieve. This would make it easier to think of alternate ways. –  bloodworks Jan 20 '13 at 12:42
I want that the three lines of code \setlength{\abovedisplayskip}{2pt} \setlength{\belowdisplayskip}{2pt} \vspace*{-10pt} are added automatically after the \begin{frame} command on every frame. For blocks this works as shown here with \addtobeamertemplate{block begin} but for a frame it does not work this way. Is it clearer now what I want to achieve? –  7asd44 Jan 20 '13 at 13:11
@7asd44 Yes but why do you what it at the beginning of a frame? You could simply set it globally and done with it... BTW using an @<name>in your comment will alert the <name> user of a new comment. –  bloodworks Jan 25 '13 at 14:55