[Tex/LaTex] How to implicitly specify column width (in a columns-like environment)

beamercalculationscolumns

I am using the columns environment in Beamer-documents like this:

\begin{columns}
    \begin{column}{0.8\textwidth}
       %%
    \end{column}
    \begin{column}{0.2\textwidth}
       %%
    \end{column}
\end{columns}

I am getting tired of having to change the width of the second column each time I adjust the first one.

Basically I am searching for a columns environment where the column-width-argument is optional – if you don't specify it is computed like this:

 max(0, (complete_width - sum_of_explicitly_specified_width) / number_of_implicit_cols)

How can setup something like this with LaTeX?

Best Answer

For two columns this is fairly straight forward. Define a length to hold the first column's width and use this length in a calculation of the second column:

% In preamble (to separate structure from contents)
%...
\newlength{\mylen}

% In document/frame
%...
\begin{columns}
  \setlength{\mylen}{0.8\textwidth}
  \begin{column}{\mylen}
    %%
  \end{column}
  \begin{column}{\dimexpr\textwidth-\mylen}
    %%
  \end{column}
\end{columns}