ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] troubles with xtable (might be because I nest the same xtables)
@ 2024-11-24 12:19 Damien Thiriet via ntg-context
  2024-11-24 13:44 ` [NTG-context] " Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: Damien Thiriet via ntg-context @ 2024-11-24 12:19 UTC (permalink / raw)
  To: ntg-context; +Cc: damien

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:

tex memory      > bumping category 'parameter' succeeded, details: 
all=120000 | ini=-1 | max=100000 | mem=30000 | min=20000 | ptr=20002 | 
set=100000 | stp=10000 | top=20002
tex memory      > bumping category 'parameter' succeeded, details: 
all=160000 | ini=-1 | max=100000 | mem=40000 | min=20000 | ptr=30002 | 
set=100000 | stp=10000 | top=30002
tex memory      > bumping category 'input' succeeded, details: 
all=960000 | ini=-1 | max=100000 | mem=30000 | min=10000 | ptr=20001 | 
set=100000 | stp=10000 | top=20001
tex memory      > bumping category 'parameter' succeeded, details: 
all=200000 | ini=-1 | max=100000 | mem=50000 | min=20000 | ptr=40002 | 
set=100000 | stp=10000 | top=40002
tex memory      > bumping category 'parameter' succeeded, details: 
all=240000 | ini=-1 | max=100000 | mem=60000 | min=20000 | ptr=50002 | 
set=100000 | stp=10000 | top=50002
tex memory      > bumping category 'input' succeeded, details: 
all=1280000 | ini=-1 | max=100000 | mem=40000 | min=10000 | ptr=30001 | 
set=100000 | stp=10000 | top=30001
tex memory      > bumping category 'parameter' succeeded, details: 
all=280000 | ini=-1 | max=100000 | mem=70000 | min=20000 | ptr=60002 | 
set=100000 | stp=10000 | top=60002
tex memory      > bumping category 'parameter' succeeded, details: 
all=320000 | ini=-1 | max=100000 | mem=80000 | min=20000 | ptr=70002 | 
set=100000 | stp=10000 | top=70002
tex memory      > bumping category 'input' succeeded, details: 
all=1600000 | ini=-1 | max=100000 | mem=50000 | min=10000 | ptr=40001 | 
set=100000 | stp=10000 | top=40001
tex memory      > bumping category 'parameter' succeeded, details: 
all=360000 | ini=-1 | max=100000 | mem=90000 | min=20000 | ptr=80002 | 
set=100000 | stp=10000 | top=80002
tex memory      > bumping category 'parameter' succeeded, details: 
all=400000 | ini=-1 | max=100000 | mem=100000 | min=20000 | ptr=90002 | 
set=100000 | stp=10000 | top=90002
tex memory      > bumping category 'input' succeeded, details: 
all=1920000 | ini=-1 | max=100000 | mem=60000 | min=10000 | ptr=50001 | 
set=100000 | stp=10000 | top=50001
tex memory      > bumping category 'parameter' failed, details: 
all=400000 | ini=-1 | max=100000 | mem=100000 | min=20000 | ptr=100002 | 
set=100000 | stp=10000 | top=100002
tex error       > tex error on line 3 in file 
virtual://buffer.x_table_1.1: TeX capacity exceeded, sorry 
[parameter=100000]

{}>Test:[bad 43]

<macro> \doxtableparentparameter
     #1#2->
     \ifrelax #1\doxtablerootparameter {#2}\else \doxtableparameter 
{#1}{#2}\fi
<macro> \doxtableparameter
     #1#2->\ifcsname #1:#2\endcsname \csnamestring \else \expandafter 
\doxtableparentparameter \csname #1:\s!parent \endcsname {#2}
     \fi
<macro> \doxtableparentparameter
     #1#2->\ifrelax #1\doxtablerootparameter {#2}\else \doxtableparameter 
{#1}{#2}
     \fi
<macro> \doxtableparameter
     #1#2->\ifcsname #1:#2\endcsname \csnamestring \else \expandafter 
\doxtableparentparameter \csname #1:\s!parent \endcsname {#2}
     \fi
<macro> \doxtableparentparameter
     #1#2->\ifrelax #1\doxtablerootparameter {#2}\else \doxtableparameter 
{#1}{#2}
     \fi
<macro> \doxtableparameter
     #1#2->\ifcsname #1:#2\endcsname \csnamestring \else \expandafter 
\doxtableparentparameter \csname #1:\s!parent \endcsname {#2}
     \fi
  ...

<line 7.3>
     b
     la

<empty file>
If you really absolutely need more capacity, you can ask a wizard to 
enlarge me.

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

Damien
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [NTG-context] Re: troubles with xtable (might be because I nest the same xtables)
  2024-11-24 12:19 [NTG-context] troubles with xtable (might be because I nest the same xtables) Damien Thiriet via ntg-context
@ 2024-11-24 13:44 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2024-11-24 13:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Damien Thiriet via ntg-context; +Cc: damien

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-24 13:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-24 12:19 [NTG-context] troubles with xtable (might be because I nest the same xtables) Damien Thiriet via ntg-context
2024-11-24 13:44 ` [NTG-context] " Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).