[Tex/LaTex] beamer: column background color

beamercolorcolumns

How do I change the background color of a column in Beamer? (the entire column)

(This is a simple question, but for the life of me, I cannot not find an answer.)

Example:

\documentclass[t]{beamer}
\setbeamersize{text margin left=1em, text margin right=1em}
\begin{document}

\begin{frame}{Test}
\begin{columns}[t,onlytextwidth]
\begin{column}{0.5\textwidth}
Some text.
\end{column}
\begin{column}{0.5\textwidth}
Some question.
\[1+1=2\]
\end{column}
\end{columns}
\end{frame}

\end{document}

What I would like:

example desired result

Best Answer

Two options.

  1. Since minipage lets you control its height, instead of columns I'd rather use two side-by-side minipages, enclosing one of them in a \colorbox:

    enter image description here

    The code:

    \documentclass[t]{beamer}
    \setbeamersize{text margin left=1em, text margin right=1em}
    \begin{document}
    
    \begin{frame}
    \frametitle{Test}
    
    \colorbox{blue!20}{\begin{minipage}[t][0.8\textheight][t]
    {\dimexpr0.5\textwidth-2\fboxsep-2\fboxrule-5pt\relax}
    Some text.
    \end{minipage}}\hfill
    \begin{minipage}[t][0.8\textheight][t]
    {\dimexpr0.5\textwidth-5pt\relax}
    Some question.
    \[1+1=2\]
    \end{minipage}
    \end{frame}
    
    \end{document}
    
  2. Using a tabular and \columncolor; an invidible \rule of appropriate depth allows you to vertically extend the colorized colum:

    enter image description here

    \documentclass[table]{beamer}
    \setbeamersize{text margin left=1em, text margin right=1em}
    \begin{document}
    
    \begin{frame}[t]
    \frametitle{Test}
    
    \begin{tabular}[t]{@{}>{\columncolor{blue!20}\rule[-.8\textheight]{0pt}{0pt}}p{\dimexpr.5\textwidth-\tabcolsep\relax}p{\dimexpr.5\textwidth-\tabcolsep\relax}@{}}
    Some text. & 
    Some question.
    \[1+1=2\]
    \end{tabular}
    \end{frame}
    
    \end{document}