Re: [NTG-context] xtables with lua
Dear Otared, What do you mean “does not typeset correctly as expected”? I copied and tested the last example and got the result without error. One problem is that the vertical alignment is not centered as the example of Aditya’s. Would you please tell me what I miss? Thank you. Best regards, Dalyoung
I wanted to make an observation about the last example in that page, which does not typeset correctly as expected, and also it does not work well if one wanted to make a multiplication table instead of the addition table of your examples. I think the following modification might be necessary (here for the multiplication table):
On Mon, 1 Oct 2018, Jeong Dal wrote:
What do you mean “does not typeset correctly as expected”?
As I said, I fixed the post.
I copied and tested the last example and got the result without error. One problem is that the vertical alignment is not centered as the example of Aditya’s. Would you please tell me what I miss?
The part in the beginning of the post: \setupTABLE[each][each][width=2em,height=2em,align={middle,middle}] \setupTABLE[r][1][background=color,backgroundcolor=gray] \setupTABLE[c][1][background=color,backgroundcolor=gray] Aditya
Hi,
Thank you Aditya for the link. I knew that with natural tables, but I hoped
it could be done with xtables too.
Fabrice
Le lun. 1 oct. 2018 à 05:50, Aditya Mahajan
On Mon, 1 Oct 2018, Jeong Dal wrote:
What do you mean “does not typeset correctly as expected”?
As I said, I fixed the post.
I copied and tested the last example and got the result without error. One problem is that the vertical alignment is not centered as the example of Aditya’s. Would you please tell me what I miss?
The part in the beginning of the post:
\setupTABLE[each][each][width=2em,height=2em,align={middle,middle}] \setupTABLE[r][1][background=color,backgroundcolor=gray] \setupTABLE[c][1][background=color,backgroundcolor=gray]
Aditya___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
On Mon, 1 Oct 2018, Fabrice Couvreur wrote:
Hi, Thank you Aditya for the link. I knew that with natural tables, but I hoped it could be done with xtables too.
Almost the same code works with xtables as well (in your example, I don't know the relationship between the columns) \starttext \startluacode context.startxtable({"align=middle, width=0.8cm"}) context.startxrow() context.startxcell() context("$(+)$") context.stopxcell() for y = 1,6 do context.startxcell() context(y) context.stopxcell() end context.stopxrow() for x = 1,6 do context.startxrow() context.startxcell() context(x) context.stopxcell() for y = 1,6 do context.startxcell() context(x+y) context.stopxcell() end context.stopxrow() end context.stopxtable() \stopluacode \stoptext Aditya
participants (3)
-
Aditya Mahajan
-
Fabrice Couvreur
-
Jeong Dal