[NTG-context] setting lineheight in embedded xtables
Thomas A. Schmitz
thomas.schmitz at uni-bonn.de
Mon Oct 19 12:48:12 CEST 2015
Hi,
I have a small problem with adjusting the height of embedded xtables.
Here's my example (the colors are there just to see that all the setups
are read and applied):
\startbuffer[test]
<text>
<bilingual>
<bilingualrow>
<bilingualcell>
First line of text
</bilingualcell>
<bilingualcell ny="2">
This is the translation. It is slightly longer than the width of the
paragraph.
</bilingualcell>
</bilingualrow>
<bilingualrow>
<bilingualcell>
Second line of text
</bilingualcell>
</bilingualrow>
</bilingual>
<bilingual>
<bilingualrow>
<bilingualcell>
third line of text
</bilingualcell>
<bilingualcell ny="3">
An even longer translation which should span three rows of the table.
</bilingualcell>
</bilingualrow>
<bilingualrow>
<bilingualcell>
fourth line of text
</bilingualcell>
</bilingualrow>
<bilingualrow>
<bilingualcell>
fifth line of text.
</bilingualcell>
</bilingualrow>
</bilingual>
</text>
\stopbuffer
\startxmlsetups xml:somesetups
\xmlsetsetup{#1}{text|bilingual|bilingualrow|bilingualcell}{xml:*}
\stopxmlsetups
\xmlregistersetup{xml:somesetups}
\startxmlsetups xml:text
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:bilingual
\startembeddedxtable [Bilingual]
\xmlflush{#1}
\stopembeddedxtable
\stopxmlsetups
\startxmlsetups xml:bilingualrow
\startxrow
[height=\the\baselineskip,background=color,backgroundcolor=gray]
\xmlflush{#1}
\stopxrow
\stopxmlsetups
\startxmlsetups xml:bilingualcell
\startxcell [width=0.4\textwidth,align=normal,ny=\xmlattdef{#1}{ny}{1}]
\xmlflush{#1}
\stopxcell
\stopxmlsetups
\setupxtable [Bilingual]
[option=stretch,
frame=on,
align=normal,
columndistance=1em,
foregroundcolor=darkred]
\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext
Problem: while the fist table <bilingual></bilingual> follows the height
assignment for table rows, in the second table, the lines are much
higher. When I try to reproduces in a TeX file and apply the
height=\the\baselineskip to every row individually, it works. What's
going wrong here?
All best
Thomas
More information about the ntg-context
mailing list