3

Why is it not possible to define a command to create a table like this? I had no problem doing the same with a list

List Command:

\define[1]\docListBulleted
{\startitemize[before={\blank[small]},after={\blank[big]},inbetween={\blank[small]}] #1 \stopitemize}

MWE:

\define[1]\tabd
{\startxtable
    [option={stretch},split=yes]
    #1
\stopxtable}    
\starttext
\tabd{\NC  Elements \NC Amount  \NR}
\stoptext

The same (or similar) error occurs when I try to define the table with /definestartstop

MWE:

\definestartstop
[Asdf]
[before={\startxtable},
 after={\stopxtable}]    

\starttext

\startAsdf
  \startxrow
    \startxcell
      dddd
    \stopxcell 
  \stopxrow 
\stopAsdf

\stoptext
5

Extreme tables (aka xtables) are implemented using Lua buffers. These do not play well with macro definitions because the starting command has to “see“ the stopping command. From the manual:

enter image description here

Also apart from it not working, you should not use \definestartstop to wrap an xtable. Just use \definextable instead.

\define[1]\tabd{%
  \startembeddedxtable
    [option={stretch},split=yes]
    #1
  \stopembeddedxtable
}

\definextable
  [Asdf]
  [option=stretch,
   split=yes]

\starttext

\tabd{\NC  Elements \NC Amount  \NR}

\startxtable[Asdf]
  \startxrow
    \startxcell
      dddd
    \stopxcell 
  \stopxrow 
\stopxtable

\stoptext

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.