[cl-typesetting-devel] Tables with variable column widths

Marc Battyani marc.battyani at fractalconcept.com
Fri Apr 8 14:01:55 UTC 2005


"Edi Weitz" <edi at agharta.de> wrote:
> On Fri, 08 Apr 2005 13:28:37 +0200, Edi Weitz <edi at agharta.de> wrote:
>
> > I admit I haven't done much with CL-PDF and CL-TYPESETTING yet so if
> > this is a particularly dumb question or has been discussed before
> > feel free to be rude.
> >
> > I'm trying to create a table where I don't know the width of the
> > columns in advance, i.e. I want the table to be "just big enough"
> > like in HTML or LaTeX.  I've looked at the table example in
> > tables.lisp which uses fixed column sizes.  Am I supposed to
> > calculate the sizes myself?  And if so, what are the functions one
> > would use to do that?
>
> I've searched the list archives a bit and found a discussion from
> about a year ago where the general agreement obviously was that fully
> automatic tables are hard to do.  Is that the last word?
>
> Anyway - let's suppose I just want a very simple table: each row as
> exactly n columns and I /know/ that the whole table will fit on the
> page.  I just want to compute the maximum width for each column in
> order to feed it into the table description - how do I do that?

The general case is very difficult to do well but simple cases are... simple
;-)
I just did not found the time to work on it. Basically what is needed is a
first pass to compute the natural width of the cells. Then the maximum one
for each row and finally the table width. So far so good. The problems start
when the table width is too big. Then it's some kind of NP optimization
problem. I wanted to use screamer or something like that to do this just for
the fun ;-)

I can do that simple case if you want.

Cheers,

Marc





More information about the cl-typesetting-devel mailing list