我想在每一帧的开头添加几行代码,就像这里未注释的代码一样。但是,它addtobeamertemplate
并没有按照我预期的方式工作。有人知道怎么做吗?
\documentclass[slidestop]{beamer}
\usetheme{Madrid}
\begin{document}
\addtobeamertemplate{frame begin}{\setlength{\abovedisplayskip}{2pt}}{\setlength{\abovedisplayskip}{2pt}{0pt}}
\addtobeamertemplate{frame begin}{\setlength{\belowdisplayskip}{2pt}}{\setlength{\belowdisplayskip}{2pt}{0pt}}
\addtobeamertemplate{frame begin}{\vspace*{-10pt}}{\vspace*{-10pt}}
\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}