Damien Thiriet via ntg-context schrieb am 24.11.2024 um 13:19:
Hello,

I have troubles with \definextable, something I obviously didn't understand
This MWE compiles well.

\definextable [Test]
\setupxtable [Test]
    [frame=off]
\starttext
\startxtable %[Test]
    \startxrow
       \startxcell [Test]
bla
       \stopxcell
       \startxcell [Test]
bli
       \stopxcell
    \stopxrow
\stopxtable
\stoptext

However, if I uncomment [Test] afetr \startxtable, I get this error:

[...]

Why can't I nest the same kind of xtable?

These are *not* nested xtables.

Your problem here is a circular reference where a parameter (e.g. framecolor) tries to load the value of its parent because it has no value itself. Since you set the parent to itself it results in an endless loop until it runs out of memory.

To avoid this problem uses different instance name for the table as a whole and the named parameters for a cell, row etc.

\definextable [Tableinstance] [framecolor=red]

\setupxtable [Parameters] [foregroundstyle=italic]

\starttext

\startxtable [Tableinstance]
  \startxrow
    \startxcell [Parameters]
      bla
    \stopxcell
  \stopxrow
\stopxtable

\stoptext

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

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to