[NTG-context] TaBlE from Lua

Daniel Lyons fusion at storytotell.org
Thu Feb 24 02:45:47 CET 2011


On Feb 23, 2011, at 6:16 PM, Philipp Gesang wrote:

> On 2011-02-23 <17:07:38>, Daniel Lyons wrote:
>> Is there a convenient way to create TaBlE tables from Lua? If so,
>> where can I read about it?
> 
> Good evening, Daniel!
> 
> [-1] Isn’t TaBlE deprecated?  <http://wiki.contextgarden.net/Tables_Overview>

I didn't know that!

> [0] If you aim for convenience, wouldn’t you rather want to
>    switch to \[start|stop]tabulate? Its syntax is very similar
>    and there are a few examples to learn from in the context
>    source code.

My particular situation is a bit more involved. I want to put SQL in my ConTeXt source and have it run it against my database and format the result nicely in my document. I think I see how to do it, I just need to be able to take the parsed output and make the visually appealing table.

> [1] I don’t know how your table structure looks like, but the
>    example 1 can be a starting point, assuming a 2dimensional
>    table where all rows have the same element count:

It's not going to be too fancy, just headers and rows with the same number of columns on each line. I do want to be able to control how they get aligned but otherwise nothing interesting.

> [2] Item example 2, but using the cld interface
>    <http://wiki.contextgarden.net/cld>.
> 
> Put both files in the same directory and run “context” on
> table.tex to build the examples.

Thanks!

— 
Daniel Lyons



More information about the ntg-context mailing list