latex: Automate columnizing words in table? 

Newsgroups: comp.text.tex
Date: 2001-08-19 22:48:55 PST

http://groups.google.com/groups?hl=en&selm=9lq8b4%24hdt%241%40slb1.atl.mindspring.net

>I need to include in a paper long lists of sorted words which came out
>of a database. I have to build hundreds of lists (tables?) where each
>one has from a few hundred to a couple of thousand words.
>
>What I want is to get in the output would be some lists (which might
>possibly be tables) where the words are packed into the available
>width depending upon the length of the individual word's length.  This
>would be like the unix "ls" command output, where each column has the
>words going in order down the page and the position of each next
>column is determined by the length of the longest word in past column.
>
>I have been searching the teTeX docs and do not see anything
>applicable yet. I read on how to use two columns but that still leaves
>most of the pages mostly blank/un-used.

It finally happened. There's an actual use for \valign.

An example of a twenty row table of the chemical elements is:

\scrollmode
\def\element#1{\hbox{\strut #1\quad}&}
\valign{#&#&#&#&#&#&#&#&#&#&#&#&#&#&#&#&#&#&#&#\cr
\element{Hydrogen}
\element{Helium}
...
\element{Uranium}
\crcr}\end

TeX will complain every twenty rows but will go to the next column anyway.