On 1/3/2025 4:53 PM, Jeong Dal via ntg-context wrote:
Dear all,
I got the error "You can't use '\prevdepth' in restricted horizontal mode” when I compile the following code.
If I remove “\starttabulete… \stoptabulate”, then no errors, but the out put is not the form of table.
How can I fix this error?
Thank you.
Best regards,
Dalyoung
\starttext
\startluacode function makeHead(a) local n = #a context.HL() for i = 1, n do context.NC() context(a[i]) end context.NC()context.AR() context.HL() end \stopluacode
%\starttabulate[|mcw(1cm)|mcw(1cm)|mcw(1cm)|mcw(1cm)|] \startluacode local a = {"x","y","z","(x\\to y)"} makeHead(a) \stopluacode %\stoptabulate
\stoptext
or \starttext \startluacode function document.MakeHead(p,a) if not a then local t = p p = string.rep("|k.5",#p) .. "|" a = t end context.starttabulate { p } context.FL() for i=1,#a do context.NC() context(a[i]) end context.NC() context.NR() context.LL() context.stoptabulate() end \stopluacode \startluacode document.MakeHead ( "|mcw(1cm)|mcw(1cm)|mcw(1cm)|mcw(2cm)|", { "x", "y", "z", "(x \\to y)" } ) \stopluacode \startluacode document.MakeHead { "x", "y", "z", "(x \\to y)" } \stopluacode \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------