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.

Is it possible to create a table with with a dynamic number of columns that depend on some given width, e.g., \textwidth? For example, given a fixed-width table t with size(t) <= 0.5\textwidth that has three columns and looks as follows,

A & B & C \\
D & E & F \\
G & H & I \\
J & K & L \\

I am asking if it is possible to translate it dynamically into something like:

A & B & C  &  G & H & I \\
D & E & F  &  J & K & L \\ 
share|improve this question
1  
That seems awfully confusing to the reader. –  You May 11 '11 at 9:29

1 Answer 1

up vote 3 down vote accepted

eplain has something that's somewhat similar to what you want.

\input eplain

\makecolumns 12/6:
A
B
C
D
E
F
G
H
I
J
K
L
It's not quite what you want.
\bye

enter image description here

memoir has something similar.

\documentclass{memoir}
\begin{document}
\autorows{c}{6}{l}{
        A, B, C, D, E, F, G, H, I, J, K, L%
}
\end{document}

enter image description here

share|improve this answer
    
Thanks, the memoir package offers the right tools to solve this issue. –  Matthias Vallentin May 11 '11 at 23:11

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.