1

I need to prepare a beamer presentation in which I shall have multiple kinds of frames (Discussing frame, Formalizing frame, Problems Frame, etc.). They are simple frames, essencialy, a white frame with the words "Discussing", "Formalizing", etc. in a rectangle in the right top of the frame, but this rectangle, in each kind of frame shall be in a color (discussing is blue, problems are green, etc.).

I tried to addapt this but I was not able to change colors or write in the rectangle :(

1
  • The linked item has been deleted, so there is no useful information there. Please incorporate the actual content from that link (which was posted by you). Jul 25 '19 at 15:08
2

In the following code, I have added an optional argument to \begin{frame}. If no argument is given, the resultign slide is just white, if one of the arguments Discussing, Problems or Formalizing is given, the respective word is added in a colored rectangle:

enter image description here

\documentclass{beamer}
\usepackage{etoolbox}

\setbeamercolor{mydiscussingcolor}{fg=white,bg=blue}
\setbeamercolor{myproblemscolor}{fg=black,bg=green}
\setbeamercolor{myformalizingcolor}{fg=white,bg=red}


\BeforeBeginEnvironment{frame}{%
\setbeamertemplate{headline}{}}


\makeatletter
\define@key{beamerframe}{Discussing}[true]{%
\setbeamertemplate{headline}{\hfill%
  \begin{beamercolorbox}[wd=.25\paperwidth,ht=20pt,dp=3ex,center]{mydiscussingcolor}%
  \Large Discussing %
  \end{beamercolorbox}%
}}
\define@key{beamerframe}{Problems}[true]{%
\setbeamertemplate{headline}{\hfill%
  \begin{beamercolorbox}[wd=.25\paperwidth,ht=20pt,dp=3ex,center]{myproblemscolor}%
  \Large Problems %
  \end{beamercolorbox}%
}}
\define@key{beamerframe}{Formalizing}[true]{%
\setbeamertemplate{headline}{\hfill%
  \begin{beamercolorbox}[wd=.25\paperwidth,ht=20pt,dp=3ex,center]{myformalizingcolor}%
  \Large Formalizing %
  \end{beamercolorbox}%
}}
\makeatother




\begin{document}

\begin{frame}[Discussing]
\frametitle{title}
\end{frame}

\begin{frame}[Problems]
\end{frame}

\begin{frame}
\frametitle{another title}
\end{frame}

\begin{frame}[Formalizing]
\end{frame}

\end{document}
1
  • PERFECT!!!! Thank you very much!!!
    – Michelle
    Jul 25 '19 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.