[Tex/LaTex] How to line up blocks in columns with full width blocks in beamer/beamerposter

beamerbeamerpostercolumnshorizontal alignment

This input to pdflatex (whatever version of texlive is on Debian/squeeze)

\documentclass{beamer}

\usepackage[orientation=portrait,size=a3,scale=0.9]{beamerposter}
\usepackage{lipsum}

\beamertemplategridbackground[0.5cm]
\setbeamertemplate{background canvas}[vertical shading][bottom=gray,top=white]

\setbeamercolor*{block body}{bg=white,fg=black}
\setbeamercolor*{block title}{fg=white,bg=blue}
\setbeamerfont{block title}{size=\Large}

\begin{document}

\begin{frame}

  \begin{block}{Introduction}
    \lipsum[1]
  \end{block}

  \begin{columns}[t]

    \begin{column}{.5\textwidth}
      \begin{block}{Problems are inevitable}
        \lipsum[2]
      \end{block}
    \end{column}

    \begin{column}{.5\textwidth}
      \begin{block}{Problems are soluble}
        \lipsum[3]
      \end{block}
    \end{column}

  \end{columns}

  \begin{block}{Conclusion}
    \lipsum[4]
  \end{block}

  \vfill

\end{frame}

\end{document}

produces this output:

Output from the code given

Now obviously putting 0.5\textwidth (or 0.5\linewidth) for each column is going to be too wide because it doesn't take account of any column spacing or margins, so it's not surprising it doesn't line up nicely with the non-column full width blocks above and below. However, it's not clear to me what I could/should specify there to achieve that result.

My current workround is to just fiddle around with the widths until it looks good enough (the grid helps), but there must be a better way.

My question is, what should I put for the column widths which will magically make the outer edges of the column blocks be in harmonious agreement with full-width non column blocks ? Is there something which can be calculated from other beamer parameters which will just work ?

Update 2012-10-06: Looked a bit more into this. Comments on this question and the answer here make me think a satisfactory solution will need a new columns environment defining, or the beamer one modifying somehow.

Best Answer

The columns environment can take quite a few optional arguments, one of which is totalwidth which I have specified as \linewidth in the solution below.

Here's the output

screenshot

I've borrowed Stefan's solution from Changing default width of blocks in beamer to define a varwidth block which allows you to specify the width of a block environment.

It does lead to an overfull hbox so perhaps this solution isn't ideal; if someone can improve on it I'll delete this answer. If your presentation is tomorrow, then this will work :)

\documentclass{beamer}

\usepackage[orientation=portrait,size=a3,scale=0.9]{beamerposter}
\usepackage{lipsum}

\beamertemplategridbackground[0.5cm]
\setbeamertemplate{background canvas}[vertical shading][bottom=gray,top=white]

\setbeamercolor*{block body}{bg=white,fg=black}
\setbeamercolor*{block title}{fg=white,bg=blue}
\setbeamerfont{block title}{size=\Large}

\newenvironment<>{varblock}[2][.9\textwidth]{%
  \setlength{\textwidth}{#1}
  \begin{actionenv}#3%
    \def\insertblocktitle{#2}%
    \par%
    \usebeamertemplate{block begin}}
  {\par%
    \usebeamertemplate{block end}%
  \end{actionenv}}

\begin{document}

\begin{frame}

  \begin{block}{Introduction}
    \lipsum[1]
  \end{block}

  \begin{columns}[t,totalwidth=\linewidth]
    \begin{column}{.5\linewidth}
      \begin{varblock}{Problems are inevitable}
        \lipsum[2]
      \end{varblock}
    \end{column}
    \begin{column}{.5\linewidth}
      \begin{varblock}[\textwidth]{Problems are soluble}
        \lipsum[3]
      \end{varblock}
    \end{column}
  \end{columns}

  \begin{block}{Conclusion}
    \lipsum[4]
  \end{block}

  \vfill

\end{frame}
\end{document}