2

My question

How do I wrap the frame environment in beamer to have it in a tcolorbox in \mode<article> ? (and not just the title as below)

enter image description here

Context

I use beamer and beamarticle.

I'd like to highlight the frames in a tcolorbox when I use \mode<article>. It enables me to see what is in the notes vs the shorter version that should be in the frames.

I understand I need to change the \setbeamertemplate with the right key for the frame environment. I'd like what's in the frame to be a wrapped in a tcolorbox in \mode<article> (not just the title as in MWE with an error).

I'd like also to have the Title(+Subtitle) as the title of the tcolorbox.

MWE

\documentclass[11pt]{article}
\usepackage{xcolor}
\usepackage[envcountsect]{beamerarticle}
\usepackage{tcolorbox}

\mode<article>
{
\setbeamertemplate{frame begin}{%
    \begin{tcolorbox}[
            colback=red!20,
            colframe=red!60,
            arc=4mm,
            title={\insertframetitle \emph{\insertframesubtitle}},
            coltitle=red!50!black, 
            fonttitle=\bfseries\scshape,
            detach title,
            before upper={\tcbtitle\par}
            ]
            }%
\setbeamertemplate{frame end}{\end{tcolorbox}}
}

\begin{document}

\begin{frame}
    {Title of the frame}
    {Subtitle of the frame}

    \begin{itemize}
        \item first
        \item Second
        \item third
    \end{itemize}

\end{frame}

\end{document}
  • 2
    Here is a way to add boxes around the frames. To add a tcolorbox environment seems to be more tricky. – user194703 May 31 at 18:15
  • 2
    @Schrödinger'scat merci for the link. I start playing with it and it already does not compile :/ – JeT May 31 at 18:36
  • 1
    Indeed. Sorry, I did not test it. Since it most likely did compile when it was written, an update must have broken it. (I only know one user who will most likely immediately know what is going on. You can find her here.) – user194703 May 31 at 18:50
  • 2
    Bingo. ;-) ;-) ;-) – user194703 May 31 at 19:10
  • 2
    I think "my" answer is mainly samcarter's work. – user194703 Jun 1 at 13:28
2

Here is a modified code which shows the colorbox, but not the subtitle.

\documentclass[11pt]{article}
\usepackage{xcolor}
\usepackage[envcountsect]{beamerarticle}
\usepackage{tcolorbox}

\mode<article>
{
\setbeamertemplate{frame begin}{%
    \begin{tcolorbox}[
            colback=red!20,
            colframe=red!60,
            arc=4mm,
            title={\insertframetitle \emph{\insertframesubtitle}},
            coltitle=red!50!black, 
            fonttitle=\bfseries\scshape,
            detach title,
            %before upper={aaa \tcbtitle\par}
            ]
            }%
\setbeamertemplate{frame end}{\end{tcolorbox}}
}

\begin{document}

\begin{frame}
    \frametitle{Title of the frame}
    \framesubtitle{Subtitle of the frame}
    \begin{itemize}
        \item first
        \item Second
        \item third
    \end{itemize}

\end{frame}

\end{document}

enter image description here

| improve this answer | |

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.