Dear all,

I used code which generates the table as following:

\startluacode
local NC, NR, HL, VL = context.NC, context.NR, context.HL, context.VL
context.starttabulate { "|c|c|c|c|c|c|c|c|c|c|" }
HL()
for i=1, 6, 1 do
        for j=1,10 ,1 do
                k= i % 3
                if k==1 then
                        VL() context(10*(i - k)/3+j)
                else
                        VL()
                end
        end
        VL()
        NR()
        if k==0 then
                HL()
        end
end
context.stoptabulate()
\stopluacode

But it has a fixed column definition as "|c|c|c|c|c|c|c|c|c|c|" and the number 
of columns.
I wonder it is possible to use the variable for "j" to control the number of 
columns and the column setting.
Of course, I may put similar codes  which are different only in the number of 
columns and column settings when I need a table.
But I have many similar tables whose number of columns are different only.
If such a method is possible, I'd like to put such a code in 
\startbuffer…\stopbudffer and call it to generate tables of various number of 
columns given at each time. 
I also don't know whether it is possible to convey a number from ConTeXt to the 
variable in Lua code.

I write this email because I saw a hope in recent discussion "Re: Fwd: Need 
help with \definetabulate" which has a method to vary the column setting.

\definetabulate
[whatever]
[|l|r|]

\definetabulate
[whatever][else]
[|l|c|r|]


It may be a lazy man's question with no need for others.

Thank you for reading.

Best regards,

Dalyoung

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to