自定义 beamerposter alertblocks

自定义 beamerposter alertblocks

我正在使用该包编写海报beamerposter,并使用朋友给我的模板。在他的模板中,以下代码更改了默认块模板:

\setbeamertemplate{block begin}{
  \vskip1ex
  \begin{beamercolorbox}[rounded=true,shadow=true,leftskip=1cm,colsep*=.75ex]{block title}%
    \usebeamerfont*{block title}\insertblocktitle
  \end{beamercolorbox}%
  {\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}%
  \usebeamerfont{block body}%
  \begin{beamercolorbox}[rounded=true,shadow=true,colsep*=.75ex,sep=.75ex,vmode]{block body}%
    \ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
  }
  \setbeamertemplate{block end}{
  \end{beamercolorbox}
}

这给出了不错的结果。但是,我还想突出显示块,当我使用alertblockexampleblock时,它们会出现非圆角和无阴影。我该如何将上述设计应用于所有块?

答案1

请在将来提供一个最小工作示例。在本例中,我基本上借用了 beamerposter 的 example.tex 来进行工作。我删除了一些无关的细节,但这基本上使用了相同的设置、主题和框架内容,并进行了修改以演示各种块类型。

\documentclass[final]{beamer}
\usetheme{Berlin}
\usepackage[orientation=portrait,size=a0,scale=1.4]{beamerposter}

\newenvironment{mybeamerboxtitle}[1]{%
  \vskip1ex
  \usebeamerfont{#1}%
  \begin{beamercolorbox}[rounded=true,shadow=true,leftskip=1cm,colsep*=.75ex]{#1}}{%
  \end{beamercolorbox}}
\newenvironment{mybeamerboxbody}[1]{%
  {\ifbeamercolorempty[bg]{#1}{}{\nointerlineskip\vskip-0.5pt}}%
  \usebeamerfont{#1}%
  \begin{beamercolorbox}[rounded=true,shadow=true,colsep*=.75ex,sep=.75ex,vmode]{#1}%
    \ifbeamercolorempty[bg]{#1}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
    }{%
  \end{beamercolorbox}}

\setbeamertemplate{block begin}{%
  \begin{mybeamerboxtitle}{block title}%
    \usebeamerfont*{block title}\insertblocktitle
  \end{mybeamerboxtitle}%
  \begin{mybeamerboxbody}{block body}%
  }
\setbeamertemplate{block end}{%
  \end{mybeamerboxbody}}

\setbeamertemplate{block alerted begin}{%
  \begin{mybeamerboxtitle}{block title alerted}%
    \usebeamerfont*{block title alerted}\insertblocktitle
  \end{mybeamerboxtitle}%
  \begin{mybeamerboxbody}{block body alerted}%
  }
\setbeamertemplate{block alerted end}{%
  \end{mybeamerboxbody}}

\setbeamertemplate{block example begin}{%
  \begin{mybeamerboxtitle}{block title example}%
    \usebeamerfont*{block title example}\insertblocktitle
  \end{mybeamerboxtitle}%
  \begin{mybeamerboxbody}{block body example}%
  }
\setbeamertemplate{block example end}{%
  \end{mybeamerboxbody}}


\begin{document}
  \begin{frame}{}
    \vfill
    \begin{block}{\large Fontsizes}
      \centering
      {\tiny tiny}\par
      {\scriptsize scriptsize}\par
      {\footnotesize footnotesize}\par
      {\normalsize normalsize}\par
      {\large large}\par
      {\Large Large}\par
      {\LARGE LARGE}\par
      {\veryHuge VeryHuge}\par
      {\VeryHuge VeryHuge}\par
      {\VERYHuge VERYHuge}\par
    \end{block}
    \vfill
    \vfill
    \begin{alertblock}{\large Fontsizes}
      \centering
      {\tiny tiny}\par
      {\scriptsize scriptsize}\par
      {\footnotesize footnotesize}\par
      {\normalsize normalsize}\par
      {\large large}\par
      {\Large Large}\par
      {\LARGE LARGE}\par
      {\veryHuge VeryHuge}\par
      {\VeryHuge VeryHuge}\par
      {\VERYHuge VERYHuge}\par
    \end{alertblock}
    \vfill
    \begin{columns}[t]
      \begin{column}{.48\linewidth}
        \begin{block}{Introduction}

          \begin{itemize}
          \item[]
            \begin{enumerate}
            \item some items
            \item some items
            \item some items
            \item some items
            \end{enumerate}
          \end{itemize}
        \end{block}
      \end{column}
      \begin{column}{.48\linewidth}
        \begin{block}{Introduction}
          \begin{itemize}
          \item some items and $\alpha=\gamma, \sum_{i}$
          \item some items
          \item some items
          \item some items
          \end{itemize}
          $$\alpha=\gamma, \sum_{i}$$
        \end{block}

        \begin{block}{Introduction}
          \begin{itemize}
          \item some items
          \item some items
          \item some items
          \item some items
          \end{itemize}
        \end{block}

        \begin{exampleblock}{Introduction}
          \begin{itemize}
          \item some items and $\alpha=\gamma, \sum_{i}$
          \item some items
          \item some items
          \item some items
          \end{itemize}
          $$\alpha=\gamma, \sum_{i}$$
        \end{exampleblock}
      \end{column}
    \end{columns}
  \end{frame}
\end{document}

生成:

在此处输入图片描述

请注意,灰色背景不是文档本身的一部分,但我需要超越它以确保捕获所有内容,因为投影仪使用零边距。

相关内容