[OS X TeX] Loop in tabular environment

Œistein Andersen oeandersen at wanadoo.fr
Sat Apr 17 14:34:20 CEST 2004


Le samedi, 17 avr 2004, à 02h37 Paris, Ross Moore écrivit :

> If you want the high-quality typesetting, then of course you should 
> use TeX.
> [...]
> An easier way to read data from a file, into a table,
> is to preprocess (a copy of) the data-file to contain all
> of the markup for the table.

Actually, this is what I thought of when I wrote ‘using another 
language than TeX’. And you are certainly right; that would be an 
easier solution.


Le samedi, 17 avr 2004, à 08h01 Paris, Gerben Wierda écrivit :

> Maybe the use of \tabularnewline will help and organizing your input 
> that it is one cell at a time and producing the & inside the loop.

The command \tabularnewline has the same effect as & or \cr inside the 
loop: It stops prematurely.


A possibility is to create the table using \vbox’es rather than a 
specific LaTeX environment. This seems to solve my problem, as the 
table itself is quite simple, but rather long (about 40 pages, so I 
would have had to use supertabular or something of the like). However, 
I have (re)discovered a ‘feature’ which I do not quite understand. In 
the following piece of code, the \vbox’es (or rather \vtop’s, but that 
changes nothing) line up horizontally:

\hsize=12cm
\hfil
\vtop{\hsize = 4cm 1st LINE\\ 2nd LINE}%
\vtop{\hsize = 4cm TEXT}%
\vtop{\hsize = 4cm TEXT}

Here, the \hfil will have zero width. However, if I remove the \hfil 
(and put nothing before the first \vbox), the \vbox’es will stack 
vertically. Could anyone explain the logic behind this behaviour? (A 
\hfil is not always a good idea, either.)

Thank you for your help.

-- 
Øistein Andersen
-----------------------------------------------------
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.





More information about the macostex-archives mailing list