Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
A system that works like tabularx would be nice, where you have a “virtual”, unspecified length x so that one can define column lengths by means of x. E. g. first column 1x and second column 2x gives a 1st column with length 1/3\linewidth-columngap/2 and a second with 2/3\linewidth-columngap/2. Unfortunately I can't provide such a solution ... –  Chris Oct 29 '12 at 16:48
add comment

1 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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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