troubles with xtable (might be because I nest the same xtables)
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
...
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
participants (2)
-
damien@thiriet.web4me.fr
-
Wolfgang Schuster