ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* embeddedxtable
@ 2015-05-24 10:18 Meer, H. van der
  2015-05-24 10:36 ` embeddedxtable Meer, H. van der
  0 siblings, 1 reply; 18+ messages in thread
From: Meer, H. van der @ 2015-05-24 10:18 UTC (permalink / raw)
  To: NTG ConTeXt

With the construct
     \startembeddedxtable\xmlflush{#1}\stopembeddedxtable
placed inside a
     \midaligned
I used to get a neatly centered content. But now the material is shifted to the right, even sticking out of the page.

Has something changed in the embeddedxtable alignment handling since the end of 2013?


(The embeddedxtable macro was needed because the typeset material exists inside \startbuffer..\stopbuffer.)

Hans van der Meer




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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 10:18 embeddedxtable Meer, H. van der
@ 2015-05-24 10:36 ` Meer, H. van der
  2015-05-24 11:49   ` embeddedxtable Meer, H. van der
  0 siblings, 1 reply; 18+ messages in thread
From: Meer, H. van der @ 2015-05-24 10:36 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1: Type: text/plain, Size: 1646 bytes --]

When typesetting inside a \midaligned a version with markers around:

  A\startembeddedxtable\xmlflush{#1}\stopembeddedxtable B

then the A and B show up centered and have the width of the table material between them.
The embeddedxtable stuff is placed outside that range starting at the location of the B.
A sketch of what happens:

    A   <space of tablewidth>   B<table starts here extending to the right>

Definitely something with embeddedxtable placement, I might guess. Some unwanted spaces in the code perhaps?


Hans van der Meer


On 24 May 2015, at 12:18, Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>> wrote:

With the construct
    \startembeddedxtable\xmlflush{#1}\stopembeddedxtable
placed inside a
    \midaligned
I used to get a neatly centered content. But now the material is shifted to the right, even sticking out of the page.

Has something changed in the embeddedxtable alignment handling since the end of 2013?


(The embeddedxtable macro was needed because the typeset material exists inside \startbuffer..\stopbuffer.)

Hans van der Meer




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

maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 3937 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 10:36 ` embeddedxtable Meer, H. van der
@ 2015-05-24 11:49   ` Meer, H. van der
  2015-05-24 13:06     ` embeddedxtable Meer, H. van der
  0 siblings, 1 reply; 18+ messages in thread
From: Meer, H. van der @ 2015-05-24 11:49 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1: Type: text/plain, Size: 2787 bytes --]

Further experimenting with different ConTeXt versions:

Trying earlier and latest beta, placing the embeddedxtable inside \midaligned:

version 2014.11.26 puts the embbedxtable to the right over distance width-of-table.

version 2015.03.25 and version 2015.05.23 put the left side of the embeddedxtable in the middle of the page.
Something changed between these two versions. But clearly not enough.

Hans van der Meer




On 24 May 2015, at 12:36, Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>> wrote:

When typesetting inside a \midaligned a version with markers around:

  A\startembeddedxtable\xmlflush{#1}\stopembeddedxtable B

then the A and B show up centered and have the width of the table material between them.
The embeddedxtable stuff is placed outside that range starting at the location of the B.
A sketch of what happens:

    A   <space of tablewidth>   B<table starts here extending to the right>

Definitely something with embeddedxtable placement, I might guess. Some unwanted spaces in the code perhaps?


Hans van der Meer


On 24 May 2015, at 12:18, Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>> wrote:

With the construct
    \startembeddedxtable\xmlflush{#1}\stopembeddedxtable
placed inside a
    \midaligned
I used to get a neatly centered content. But now the material is shifted to the right, even sticking out of the page.

Has something changed in the embeddedxtable alignment handling since the end of 2013?


(The embeddedxtable macro was needed because the typeset material exists inside \startbuffer..\stopbuffer.)

Hans van der Meer




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

maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl<http://www.pragma-ade.nl/> / http://tex.aanhet.net<http://tex.aanhet.net/>
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net<http://contextgarden.net/>
___________________________________________________________________________________

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

maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 6104 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 11:49   ` embeddedxtable Meer, H. van der
@ 2015-05-24 13:06     ` Meer, H. van der
  2015-05-24 13:32       ` embeddedxtable Meer, H. van der
  0 siblings, 1 reply; 18+ messages in thread
From: Meer, H. van der @ 2015-05-24 13:06 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1: Type: text/plain, Size: 3965 bytes --]

Here can be seen how every row adds space before the table. I.e. spaces are added and after that the table is put behind. This behaviour was not present when I had the material typeset earlier. The xmlsetup's used were not changed since then.

\startxmlsetups xmlcommon:tr
\xmlstripanywhere{#1}{.}
\bgroup
\setupxtableparameters{#1}
\startxrow
X\xmlflush{#1}
\stopxrow
\egroup
\stopxmlsetups

Hans van der Meer

[cid:723DA497-86EF-4142-A951-D70FD92D5104]


On 24 May 2015, at 13:49, Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>> wrote:

Further experimenting with different ConTeXt versions:

Trying earlier and latest beta, placing the embeddedxtable inside \midaligned:

version 2014.11.26 puts the embbedxtable to the right over distance width-of-table.

version 2015.03.25 and version 2015.05.23 put the left side of the embeddedxtable in the middle of the page.
Something changed between these two versions. But clearly not enough.

Hans van der Meer




On 24 May 2015, at 12:36, Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>> wrote:

When typesetting inside a \midaligned a version with markers around:

  A\startembeddedxtable\xmlflush{#1}\stopembeddedxtable B

then the A and B show up centered and have the width of the table material between them.
The embeddedxtable stuff is placed outside that range starting at the location of the B.
A sketch of what happens:

    A   <space of tablewidth>   B<table starts here extending to the right>

Definitely something with embeddedxtable placement, I might guess. Some unwanted spaces in the code perhaps?


Hans van der Meer


On 24 May 2015, at 12:18, Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>> wrote:

With the construct
    \startembeddedxtable\xmlflush{#1}\stopembeddedxtable
placed inside a
    \midaligned
I used to get a neatly centered content. But now the material is shifted to the right, even sticking out of the page.

Has something changed in the embeddedxtable alignment handling since the end of 2013?


(The embeddedxtable macro was needed because the typeset material exists inside \startbuffer..\stopbuffer.)

Hans van der Meer




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

maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl<http://www.pragma-ade.nl/> / http://tex.aanhet.net<http://tex.aanhet.net/>
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net<http://contextgarden.net/>
___________________________________________________________________________________

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

maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl<http://www.pragma-ade.nl/> / http://tex.aanhet.net<http://tex.aanhet.net/>
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net<http://contextgarden.net/>
___________________________________________________________________________________

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

maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 8716 bytes --]

[-- Attachment #2: row-adds-space.tiff --]
[-- Type: image/tiff, Size: 11904 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 13:06     ` embeddedxtable Meer, H. van der
@ 2015-05-24 13:32       ` Meer, H. van der
  2015-05-24 15:31         ` embeddedxtable Wolfgang Schuster
  0 siblings, 1 reply; 18+ messages in thread
From: Meer, H. van der @ 2015-05-24 13:32 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1: Type: text/plain, Size: 5384 bytes --]

I can get rid of the unwanted spaces before the table by inserting a whole bunch of \unskip's in my code. All the \unskip's in the following code are necessary. I guess this observation will be enough to repair the ConText code. Or do I have to change something in my code?

\startxmlsetups xmlcommon:tr
\unskip
\xmlstripanywhere{#1}{.}
\unskip
\bgroup
\unskip
\setupxtableparameters{#1}
\unskip
\startxrow
\unskip\xmlflush{#1}
\stopxrow
\egroup
\unskip
\stopxmlsetups

\startxmlsetups xmlcommon:td
\unskip
\xmlstrip{#1}{.}
\bgroup
\setupxtableparameters{#1}
\startxcell[nc=\xmlattdef{#1}{colspan}{1},nr=\xmlattdef{#1}{rowspan}{1}]
\xmlflush{#1}
\stopxcell
\egroup
\stopxmlsetups

Hans van der Meer




On 24 May 2015, at 15:06, Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>> wrote:

Here can be seen how every row adds space before the table. I.e. spaces are added and after that the table is put behind. This behaviour was not present when I had the material typeset earlier. The xmlsetup's used were not changed since then.

\startxmlsetups xmlcommon:tr
\xmlstripanywhere{#1}{.}
\bgroup
\setupxtableparameters{#1}
\startxrow
X\xmlflush{#1}
\stopxrow
\egroup
\stopxmlsetups

Hans van der Meer




On 24 May 2015, at 13:49, Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>> wrote:

Further experimenting with different ConTeXt versions:

Trying earlier and latest beta, placing the embeddedxtable inside \midaligned:

version 2014.11.26 puts the embbedxtable to the right over distance width-of-table.

version 2015.03.25 and version 2015.05.23 put the left side of the embeddedxtable in the middle of the page.
Something changed between these two versions. But clearly not enough.

Hans van der Meer




On 24 May 2015, at 12:36, Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>> wrote:

When typesetting inside a \midaligned a version with markers around:

  A\startembeddedxtable\xmlflush{#1}\stopembeddedxtable B

then the A and B show up centered and have the width of the table material between them.
The embeddedxtable stuff is placed outside that range starting at the location of the B.
A sketch of what happens:

    A   <space of tablewidth>   B<table starts here extending to the right>

Definitely something with embeddedxtable placement, I might guess. Some unwanted spaces in the code perhaps?


Hans van der Meer


On 24 May 2015, at 12:18, Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>> wrote:

With the construct
    \startembeddedxtable\xmlflush{#1}\stopembeddedxtable
placed inside a
    \midaligned
I used to get a neatly centered content. But now the material is shifted to the right, even sticking out of the page.

Has something changed in the embeddedxtable alignment handling since the end of 2013?


(The embeddedxtable macro was needed because the typeset material exists inside \startbuffer..\stopbuffer.)

Hans van der Meer




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

maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl<http://www.pragma-ade.nl/> / http://tex.aanhet.net<http://tex.aanhet.net/>
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net<http://contextgarden.net/>
___________________________________________________________________________________

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

maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl<http://www.pragma-ade.nl/> / http://tex.aanhet.net<http://tex.aanhet.net/>
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net<http://contextgarden.net/>
___________________________________________________________________________________

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

maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl<http://www.pragma-ade.nl/> / http://tex.aanhet.net<http://tex.aanhet.net/>
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net<http://contextgarden.net/>
___________________________________________________________________________________

<row-adds-space.tiff>___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 12835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 13:32       ` embeddedxtable Meer, H. van der
@ 2015-05-24 15:31         ` Wolfgang Schuster
  2015-05-24 16:01           ` embeddedxtable Meer, H. van der
  0 siblings, 1 reply; 18+ messages in thread
From: Wolfgang Schuster @ 2015-05-24 15:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 24.05.2015 um 15:32 schrieb Meer, H. van der <H.vanderMeer@uva.nl>:
> 
> I can get rid of the unwanted spaces before the table by inserting a whole bunch of \unskip's in my code. All the \unskip's in the following code are necessary. I guess this observation will be enough to repair the ConText code. Or do I have to change something in my code?
> 
> \startxmlsetups xmlcommon:tr
> \unskip
> \xmlstripanywhere{#1}{.}
> \unskip
> \bgroup
> \unskip
> \setupxtableparameters{#1}
> \unskip
> \startxrow
> \unskip\xmlflush{#1}
> \stopxrow
> \egroup
> \unskip
> \stopxmlsetups
> 
> \startxmlsetups xmlcommon:td
> \unskip
> \xmlstrip{#1}{.}
> \bgroup
> \setupxtableparameters{#1}
> \startxcell[nc=\xmlattdef{#1}{colspan}{1},nr=\xmlattdef{#1}{rowspan}{1}]
> \xmlflush{#1}
> \stopxcell
> \egroup
> \stopxmlsetups


How did you define the \setupxtableparameters command in your example?

Wolfgang

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 15:31         ` embeddedxtable Wolfgang Schuster
@ 2015-05-24 16:01           ` Meer, H. van der
  2015-05-24 18:16             ` embeddedxtable Wolfgang Schuster
  0 siblings, 1 reply; 18+ messages in thread
From: Meer, H. van der @ 2015-05-24 16:01 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1: Type: text/plain, Size: 3855 bytes --]

Defined as follows:

\def\setupxtableparameters#1{% #1 is the node
\setupframeparameters{#1}{\setupxtable}%
\setupToAttribute{#1}{\setupxtable}{foregroundstyle}{style}{style}{\tf}%
\setupToAttribute{#1}{\setupxtable}{offset}{cellpadding}{}{0pt}%
\setupToAttribute{#1}{\setupxtable}{columndistance}{cellspacing}{}{0pt}%
\setupToAttribute{#1}{\setupxtable}{spaceinbetween}{rowspacing}{}{0pt}%
\setupToAttribute{#1}{\setupxtable}{option}{option}{}{}%
}
\def\setupframeparameters#1#2{%
% color
% Always set background to color if backgroundcolor is set.
\doifnot{\xmlatt{#1}{bgcolor}}{\empty}{#2[background=color]}%
% But it can be overridden.
\doifnot{\xmlatt{#1}{background}}{\empty}{#2[background=\xmlatt{#1}{background}]}%
\setupToAttribute{#1}{#2}{foregroundcolor}{color}{}{darkblue}%
\setupToAttribute{#1}{#2}{backgroundcolor}{bgcolor}{}{green}%
% frame
\doifnot{\xmlatt{#1}{frame}}{\empty}%
{#2[frame=off]\setframeparts{\xmlatt{#1}{frame}}{#2}}%
\setupToAttribute{#1}{#2}{framecolor}{framecolor}{}{black}%
\setupToAttribute{#1}{#2}{corner}{corner}{}{rectangular}%
\setupToAttribute{#1}{#2}{radius}{radius}{}{0.5ex}%
\setupToAttribute{#1}{#2}{backgroundcorner}{bgcorner}{}{rectangular}%
\setupToAttribute{#1}{#2}{backgroundradius}{bgradius}{}{0.5ex}%
% dimensions
\setupToAttribute{#1}{#2}{rulethickness}{rulethickness}{}{3pt}%
\doifnot{\xmlatt{#1}{height}}{\empty}%
{#2[height=\NumberCollect{"\xmlattdef{#1}{height}{fit}","\the\makeupheight"}]}%
\doifnot{\xmlatt{#1}{width}}{\empty}%
{#2[width=\NumberCollect{"\xmlattdef{#1}{width}{fit}","\the\textwidth"}]}%
% alignment
\setupToAttribute{#1}{#2}{strut}{strut}{}{on}%
\setupToAttribute{#1}{#2}{align}{align}{html}{normal}%
\setupToAttribute{#1}{#2}{align}{valign}{html}{lohi}%
}
% Setup parameter to attribute.
% #1 = node, #2 = setup, #3 = param, #4 = attrib, #5 = category, #6 = default.
\def\setupToAttribute#1#2#3#4#5#6{%
% Only executed if attribute is present.
\doifexistattribute{#1}{#4}%
% Attribute is present but category can be empty.
{\doifelse{#5}{\empty}%
{\doifelse{\xmlatt{#1}{#4}}{\empty}%
{#2[#3=#6]}% attribute present but empty then take default
{#2[#3=\xmlatt{#1}{#4}]}% attribute has content
}%
{#2[#3=\xlat{#1}{#5}{#4}{#6}]}% translate from category
}%
}

Hans van der Meer




On 24 May 2015, at 17:31, Wolfgang Schuster <schuster.wolfgang@gmail.com<mailto:schuster.wolfgang@gmail.com>> wrote:


Am 24.05.2015 um 15:32 schrieb Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>>:

I can get rid of the unwanted spaces before the table by inserting a whole bunch of \unskip's in my code. All the \unskip's in the following code are necessary. I guess this observation will be enough to repair the ConText code. Or do I have to change something in my code?

\startxmlsetups xmlcommon:tr
\unskip
\xmlstripanywhere{#1}{.}
\unskip
\bgroup
\unskip
\setupxtableparameters{#1}
\unskip
\startxrow
\unskip\xmlflush{#1}
\stopxrow
\egroup
\unskip
\stopxmlsetups

\startxmlsetups xmlcommon:td
\unskip
\xmlstrip{#1}{.}
\bgroup
\setupxtableparameters{#1}
\startxcell[nc=\xmlattdef{#1}{colspan}{1},nr=\xmlattdef{#1}{rowspan}{1}]
\xmlflush{#1}
\stopxcell
\egroup
\stopxmlsetups


How did you define the \setupxtableparameters command in your example?

Wolfgang

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

maillist : ntg-context@ntg.nl<mailto:ntg-context@ntg.nl> / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 10860 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 16:01           ` embeddedxtable Meer, H. van der
@ 2015-05-24 18:16             ` Wolfgang Schuster
  2015-05-24 19:33               ` embeddedxtable Meer, H. van der
  0 siblings, 1 reply; 18+ messages in thread
From: Wolfgang Schuster @ 2015-05-24 18:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2541 bytes --]


> Am 24.05.2015 um 18:01 schrieb Meer, H. van der <H.vanderMeer@uva.nl>:
> 
> Defined as follows:
> 
> \def\setupxtableparameters#1{% #1 is the node
> \setupframeparameters{#1}{\setupxtable}%
> \setupToAttribute{#1}{\setupxtable}{foregroundstyle}{style}{style}{\tf}%
> \setupToAttribute{#1}{\setupxtable}{offset}{cellpadding}{}{0pt}%
> \setupToAttribute{#1}{\setupxtable}{columndistance}{cellspacing}{}{0pt}%
> \setupToAttribute{#1}{\setupxtable}{spaceinbetween}{rowspacing}{}{0pt}%
> \setupToAttribute{#1}{\setupxtable}{option}{option}{}{}%
> }
> \def\setupframeparameters#1#2{%
> % color
> % Always set background to color if backgroundcolor is set.
> \doifnot{\xmlatt{#1}{bgcolor}}{\empty}{#2[background=color]}%
> % But it can be overridden.
> \doifnot{\xmlatt{#1}{background}}{\empty}{#2[background=\xmlatt{#1}{background}]}%
> \setupToAttribute{#1}{#2}{foregroundcolor}{color}{}{darkblue}%
> \setupToAttribute{#1}{#2}{backgroundcolor}{bgcolor}{}{green}%
> % frame
> \doifnot{\xmlatt{#1}{frame}}{\empty}%
> {#2[frame=off]\setframeparts{\xmlatt{#1}{frame}}{#2}}%
> \setupToAttribute{#1}{#2}{framecolor}{framecolor}{}{black}%
> \setupToAttribute{#1}{#2}{corner}{corner}{}{rectangular}%
> \setupToAttribute{#1}{#2}{radius}{radius}{}{0.5ex}%
> \setupToAttribute{#1}{#2}{backgroundcorner}{bgcorner}{}{rectangular}%
> \setupToAttribute{#1}{#2}{backgroundradius}{bgradius}{}{0.5ex}%
> % dimensions
> \setupToAttribute{#1}{#2}{rulethickness}{rulethickness}{}{3pt}%
> \doifnot{\xmlatt{#1}{height}}{\empty}%
> {#2[height=\NumberCollect{"\xmlattdef{#1}{height}{fit}","\the\makeupheight"}]}%
> \doifnot{\xmlatt{#1}{width}}{\empty}%
> {#2[width=\NumberCollect{"\xmlattdef{#1}{width}{fit}","\the\textwidth"}]}%
> % alignment
> \setupToAttribute{#1}{#2}{strut}{strut}{}{on}%
> \setupToAttribute{#1}{#2}{align}{align}{html}{normal}%
> \setupToAttribute{#1}{#2}{align}{valign}{html}{lohi}%
> }
> % Setup parameter to attribute.
> % #1 = node, #2 = setup, #3 = param, #4 = attrib, #5 = category, #6 = default.
> \def\setupToAttribute#1#2#3#4#5#6{%
> % Only executed if attribute is present.
> \doifexistattribute{#1}{#4}%
> % Attribute is present but category can be empty.
> {\doifelse{#5}{\empty}%
> {\doifelse{\xmlatt{#1}{#4}}{\empty}%
> {#2[#3=#6]}% attribute present but empty then take default
> {#2[#3=\xmlatt{#1}{#4}]}% attribute has content
> }%
> {#2[#3=\xlat{#1}{#5}{#4}{#6}]}% translate from category
> }%
> }

In this case you have to provide a working minimal example.

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 8482 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 18:16             ` embeddedxtable Wolfgang Schuster
@ 2015-05-24 19:33               ` Meer, H. van der
  2015-05-24 20:53                 ` embeddedxtable Wolfgang Schuster
  0 siblings, 1 reply; 18+ messages in thread
From: Meer, H. van der @ 2015-05-24 19:33 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1.1: Type: text/plain, Size: 5551 bytes --]

In this case you have to provide a working minimal example.

Wolfgang

Here an example as minimal as I could construct.
Hans van der Meer

The following example outputs show what happens with and without the \unskip's in the code.
[cid:E7DC008D-E8CB-4F0A-BC45-9E8E4969C8DB]
[cid:8A14737A-52AE-4B90-A03B-FA36FFF321E0]

Also I am adding two other examples made by the same code, one in 2012 and one just now. Note the extensions to the right of each row. They are absent in the older version.

[cid:1110D708-ADD3-46B8-A49B-143200704DA7][cid:539F8473-CC40-4CDB-AFC6-48AF306DD3F5]
The example code follows here:

% Switching on attribute being present (even if empty) or absent.
\def\doifexistattribute#1#2{\doifnot{\xmlattdef{#1}{#2}{__NOT__}}{__NOT__}}%{#3}
% Translate attribute: #1 = node, #2 = category #3 = attribute #4 = default value.
\def\xlat#1#2#3#4{\xmlvalue{#2}{\xmlatt{#1}{#3}}{#4}}
% Setup parameter to attribute.
% #1 = node, #2 = setup, #3 = param, #4 = attrib, #5 = category, #6 = default.
\def\setupToAttribute#1#2#3#4#5#6{%
% Only executed if attribute is present.
\doifexistattribute{#1}{#4}%
% Attribute is present but category can be empty.
{\doifelse{#5}{\empty}%
{\doifelse{\xmlatt{#1}{#4}}{\empty}%
{#2[#3=#6]}% attribute present but empty then take default
{#2[#3=\xmlatt{#1}{#4}]}% attribute has content
}%
{#2[#3=\xlat{#1}{#5}{#4}{#6}]}% translate from category
}%
}
% Setup flag (an TeX-if) from attribute values on,off,no,yes,true,false.
% #1=node #2=flag: execute \attributetrue or \attributefalse
\def\setFlagToAttribute#1#2{%
\doifexistattribute{#1}{#2}%
{%
\doifinset{\xmlatt{#1}{#2}}{on,yes,true}{\csname#2true\endcsname}%
\doifinset{\xmlatt{#1}{#2}}{off,no,false}{\csname#2false\endcsname}%
}%
}
\startxmlsetups xmlcommon
\xmlsetsetup{\xmldocument}{error|store|restore|include
|table|tr|td|tbody
}{xmlcommon:*}
\stopxmlsetups
\xmlregistersetup{xmlcommon}
% Place at top/middle(default)/bottom location.
\def\startlocationbox#1{%
\let\templocation\relax
\doif{\xmlatt{#1}{location}}{top}{\def\templocation{\vtop}}%
\doif{\xmlatt{#1}{location}}{middle}{\def\templocation{\vcenter}}%
\doif{\xmlatt{#1}{location}}{center}{\def\templocation{\vcenter}}%
\doif{\xmlatt{#1}{location}}{bottom}{\def\templocation{\vbox}}%
\templocation\bgroup\ifx\templocation\relax\else\vss\fi
}
\let\stoplocationbox\egroup
\def\setupframeparameters#1#2{%
% color
% Always set background to color if backgroundcolor is set.
\doifnot{\xmlatt{#1}{bgcolor}}{\empty}{#2[background=color]}%
% But it can be overridden.
\doifnot{\xmlatt{#1}{background}}{\empty}{#2[background=\xmlatt{#1}{background}]}%
\setupToAttribute{#1}{#2}{foregroundcolor}{color}{}{darkblue}%
\setupToAttribute{#1}{#2}{backgroundcolor}{bgcolor}{}{green}%
% frame
\doifnot{\xmlatt{#1}{frame}}{\empty}%
{#2[frame=off]\setframeparts{\xmlatt{#1}{frame}}{#2}}%
\setupToAttribute{#1}{#2}{framecolor}{framecolor}{}{black}%
\setupToAttribute{#1}{#2}{corner}{corner}{}{rectangular}%
\setupToAttribute{#1}{#2}{radius}{radius}{}{0.5ex}%
\setupToAttribute{#1}{#2}{backgroundcorner}{bgcorner}{}{rectangular}%
\setupToAttribute{#1}{#2}{backgroundradius}{bgradius}{}{0.5ex}%
% dimensions
\setupToAttribute{#1}{#2}{rulethickness}{rulethickness}{}{3pt}%
\doifnot{\xmlatt{#1}{height}}{\empty}%
{#2[height=\NumberCollect{"\xmlattdef{#1}{height}{fit}","\the\makeupheight"}]}%
\doifnot{\xmlatt{#1}{width}}{\empty}%
{#2[width=\NumberCollect{"\xmlattdef{#1}{width}{fit}","\the\textwidth"}]}%
% alignment
\setupToAttribute{#1}{#2}{strut}{strut}{}{on}%
\setupToAttribute{#1}{#2}{align}{align}{html}{normal}%
\setupToAttribute{#1}{#2}{align}{valign}{html}{lohi}%
}
% Setups for tables with xtable.
\def\setupxtableparameters#1{%
\setupframeparameters{#1}{\setupxtable}%
\setupToAttribute{#1}{\setupxtable}{foregroundstyle}{style}{style}{\tf}%
\setupToAttribute{#1}{\setupxtable}{offset}{cellpadding}{}{0pt}%
\setupToAttribute{#1}{\setupxtable}{columndistance}{cellspacing}{}{0pt}%
\setupToAttribute{#1}{\setupxtable}{spaceinbetween}{rowspacing}{}{0pt}%
\setupToAttribute{#1}{\setupxtable}{option}{option}{}{}%
}
\startxmlsetups xmlcommon:table
\bgroup
\xmlstripanywhere{#1}{.}
\setupxtable[% Setup defaults
leftmargindistance=0pt,rightmargindistance=0pt,
offset=2pt,height=fit,width=fit,
align={center,lohi},columndistance=0pt]
\setupxtableparameters{#1}
\startlocationbox{#1}
\startembeddedxtable\xmlflush{#1}\stopembeddedxtable
\stoplocationbox
\egroup
\stopxmlsetups
\startxmlsetups xmlcommon:tbody
\xmlstripanywhere{#1}{.}
\bgroup
\setupxtableparameters{#1}
\startxtablebody
\xmlflush{#1}
\stopxtablebody
\egroup
\stopxmlsetups
\startxmlsetups xmlcommon:tr
\unskip
\xmlstripanywhere{#1}{.}
\unskip
\bgroup
\unskip
\setupxtableparameters{#1}
\unskip
\startxrow
\unskip
=\xmlflush{#1}
\stopxrow
\egroup
\unskip
\stopxmlsetups

\startxmlsetups xmlcommon:td
\unskip
\xmlstrip{#1}{.}
\bgroup
\setupxtableparameters{#1}
\startxcell[nc=\xmlattdef{#1}{colspan}{1},nr=\xmlattdef{#1}{rowspan}{1}]
\xmlflush{#1}
\stopxcell
\egroup
\stopxmlsetups

\starttext
\startbuffer[the-table]
<?xml version="1.0" encoding="UTF-8"?>
<root>
<table>
<tbody>
<tr><td>A</td></tr>
<tr><td>B</td></tr>
<tr><td>C</td></tr>
<tr><td>D</td></tr>
</tbody>
</table>
</root>
\stopbuffer
\midaligned{\xmlprocessbuffer{root}{the-table}{}}
\blank
The equalsign (=) is added to \type{\startxmlsetups xmlcommon:tr} in order to show the spurious whitespace injected.
\stoptext


[-- Attachment #1.1.2: Type: text/html, Size: 25851 bytes --]

[-- Attachment #1.2: without-unskips.jpg --]
[-- Type: image/jpeg, Size: 12763 bytes --]

[-- Attachment #1.3: with-unskips.jpg --]
[-- Type: image/jpeg, Size: 10191 bytes --]

[-- Attachment #1.4: created 2012-7-11.jpg --]
[-- Type: image/jpeg, Size: 11711 bytes --]

[-- Attachment #1.5: created 2015-5-24.jpg --]
[-- Type: image/jpeg, Size: 10729 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 19:33               ` embeddedxtable Meer, H. van der
@ 2015-05-24 20:53                 ` Wolfgang Schuster
  2015-05-25  8:35                   ` embeddedxtable Meer, H. van der
                                     ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Wolfgang Schuster @ 2015-05-24 20:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 24.05.2015 um 21:33 schrieb Meer, H. van der <H.vanderMeer@uva.nl>:
> 
>> In this case you have to provide a working minimal example.
>> 
>> Wolfgang
> 
> Here an example as minimal as I could construct.

The spaces in the output are produced by the spaces between the tags (\xmlstrip doesn’t seem to work)
and you have to use a combination of \removeunwantedspaces and \ignorespaces to remove them.

To center your table this isn’t necessary when you replace \midaligned with a framedtext
environment in combination with “location=middle” or use a float command like \placefigure.


\startxmlsetups xmlcommon
	\xmlsetsetup{\xmldocument}{table|tr|td}{xmlcommon:*}
\stopxmlsetups

\xmlregistersetup{xmlcommon}

\startxmlsetups xmlcommon:table
%	\removeunwantedspaces
	\startembeddedxtable
		\xmlflush{#1}
	\stopembeddedxtable
%	\ignorespaces
\stopxmlsetups

\startxmlsetups xmlcommon:tr
%	\removeunwantedspaces
	\startxrow
		\xmlflush{#1}
	\stopxrow
%	\ignorespaces
\stopxmlsetups

\startxmlsetups xmlcommon:td
%	\removeunwantedspaces
	\startxcell
		\xmlflush{#1}
	\stopxcell
%	\ignorespaces
\stopxmlsetups

\starttext

\startbuffer[a]
<?xml version="1.0" encoding="UTF-8"?>
<root>
<table>
	<tr>
		<td>A</td>
	</tr>
</table>
</root>
\stopbuffer

\startbuffer[b]
<?xml version="1.0" encoding="UTF-8"?>
<root>
<table><tr><td>A</td></tr></table>
</root>
\stopbuffer

\ruledhbox{\xmlprocessbuffer{root}{a}{}}
\ruledhbox{\xmlprocessbuffer{root}{b}{}}

\stoptext

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 20:53                 ` embeddedxtable Wolfgang Schuster
@ 2015-05-25  8:35                   ` Meer, H. van der
  2015-05-25  9:26                     ` embeddedxtable Meer, H. van der
  2015-05-25 10:55                     ` embeddedxtable Wolfgang Schuster
  2015-05-25  9:06                   ` embeddedxtable Meer, H. van der
  2015-05-25 10:08                   ` embeddedxtable Meer, H. van der
  2 siblings, 2 replies; 18+ messages in thread
From: Meer, H. van der @ 2015-05-25  8:35 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1.1: Type: text/plain, Size: 1244 bytes --]


On 24 May 2015, at 22:53, Wolfgang Schuster <schuster.wolfgang@gmail.com<mailto:schuster.wolfgang@gmail.com>> wrote:


The spaces in the output are produced by the spaces between the tags (\xmlstrip doesn’t seem to work)
and you have to use a combination of \removeunwantedspaces and \ignorespaces to remove them.


It is a pity if \xmlstrip does not work. It is of course fairly essential that the whitespace between the tags can be ignored. I sincerely hope this will be looked into. Or could this be a special effect related to either the use of a buffer as source or to the embeddedxtable structure?

However, it doesn't seem the whole story. I removed all whitespace between the tags and the \unskip's from the code. In the result below you can see that removing the whitespace between the tags removes most of the spurious spaces, but not all of them. Another picture has the = embedded before the \xmlflush in \startrow and shows that still spurious space is injected. To me it looks if every row gets an extra space: three of them before the table and the last one after the table (but here I am guessing).

Hans van der Meer

[cid:23AE90F4-C415-4635-B1CD-E8E10E65B791]

[cid:EBC94BBA-8505-47C8-B5D3-20329BC1E06E]


[-- Attachment #1.1.2: Type: text/html, Size: 2321 bytes --]

[-- Attachment #1.2: table-1.jpg --]
[-- Type: image/jpeg, Size: 20965 bytes --]

[-- Attachment #1.3: table-2.jpg --]
[-- Type: image/jpeg, Size: 14335 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 20:53                 ` embeddedxtable Wolfgang Schuster
  2015-05-25  8:35                   ` embeddedxtable Meer, H. van der
@ 2015-05-25  9:06                   ` Meer, H. van der
  2015-05-25 10:08                   ` embeddedxtable Meer, H. van der
  2 siblings, 0 replies; 18+ messages in thread
From: Meer, H. van der @ 2015-05-25  9:06 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1: Type: text/plain, Size: 1723 bytes --]


> On 24 May 2015, at 22:53, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
>
>
>> Am 24.05.2015 um 21:33 schrieb Meer, H. van der <H.vanderMeer@uva.nl>:
>>
>>> In this case you have to provide a working minimal example.
>>>
>>> Wolfgang
>>
>> Here an example as minimal as I could construct.
>
> The spaces in the output are produced by the spaces between the tags (\xmlstrip doesn’t seem to work)
> and you have to use a combination of \removeunwantedspaces and \ignorespaces to remove them.
>
> To center your table this isn’t necessary when you replace \midaligned with a framedtext
> environment in combination with “location=middle” or use a float command like \placefigure.
>
>
> \startxmlsetups xmlcommon
>        \xmlsetsetup{\xmldocument}{table|tr|td}{xmlcommon:*}
> \stopxmlsetups
>
> \xmlregistersetup{xmlcommon}
>
> \startxmlsetups xmlcommon:table
> %     \removeunwantedspaces
>        \startembeddedxtable
>                \xmlflush{#1}
>        \stopembeddedxtable
> %     \ignorespaces
> \stopxmlsetups
>
> \startxmlsetups xmlcommon:tr
> %     \removeunwantedspaces
>        \startxrow
>                \xmlflush{#1}
>        \stopxrow
> %     \ignorespaces
> \stopxmlsetups
>
> \startxmlsetups xmlcommon:td
> %     \removeunwantedspaces
>        \startxcell
>                \xmlflush{#1}
>        \stopxcell
> %     \ignorespaces
> \stopxmlsetups
>

Input from file or from buffer doesn't make a difference.
I inserted the \removeunwantedspaces and \ignorespaces, as you suggested. The xmlstrip macros do not make any difference, either active or commented out. Then there still remains extra space at the end. See below.








[-- Attachment #1.2: Type: text/html, Size: 3121 bytes --]

[-- Attachment #2: xtablespace.pdf --]
[-- Type: application/pdf, Size: 16875 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-25  8:35                   ` embeddedxtable Meer, H. van der
@ 2015-05-25  9:26                     ` Meer, H. van der
  2015-05-25 10:59                       ` embeddedxtable Wolfgang Schuster
  2015-05-25 10:55                     ` embeddedxtable Wolfgang Schuster
  1 sibling, 1 reply; 18+ messages in thread
From: Meer, H. van der @ 2015-05-25  9:26 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1: Type: text/plain, Size: 1338 bytes --]



On 24 May 2015, at 22:53, Wolfgang Schuster <schuster.wolfgang@gmail.com<mailto:schuster.wolfgang@gmail.com>> wrote:


The spaces in the output are produced by the spaces between the tags (\xmlstrip doesn’t seem to work)
and you have to use a combination of \removeunwantedspaces and \ignorespaces to remove them.



There is something I do not understand and I hope you can explain this. The table is typeset by the \xmlflush{#1} in the table macro:

\startxmlsetups xmlcommon:table
Z\bgroup
\setupxtable[% Setup defaults
leftmargindistance=0pt,rightmargindistance=0pt,
offset=2pt,height=fit,width=fit,
align={center,lohi},columndistance=0pt]
\setupxtableparameters{#1}
\startlocationbox{#1}
\removeunwantedspaces
\startembeddedxtable X\xmlflush{#1}Y\stopembeddedxtable
\ignorespaces
\stoplocationbox
\egroup
\stopxmlsetups

The "X" and "Y"  have been placed around the \xmlflush to see what happens. Why do I see them 3 times? It looks as if  the embeddedxtable-line is called 3 times (or maybe 4 times once for each row with the last call vanishing). However, the table macro itself is called only once, the "Z" at the beginning proves that. I cannot explain this.

Another observation: inserting a newline after the <?xml>-tag also does insert a space just before the "Z".

Hans van der Meer




[-- Attachment #1.2: Type: text/html, Size: 3868 bytes --]

[-- Attachment #2: xtablespace.pdf --]
[-- Type: application/pdf, Size: 17236 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-24 20:53                 ` embeddedxtable Wolfgang Schuster
  2015-05-25  8:35                   ` embeddedxtable Meer, H. van der
  2015-05-25  9:06                   ` embeddedxtable Meer, H. van der
@ 2015-05-25 10:08                   ` Meer, H. van der
  2015-05-25 11:05                     ` embeddedxtable Wolfgang Schuster
  2 siblings, 1 reply; 18+ messages in thread
From: Meer, H. van der @ 2015-05-25 10:08 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1: Type: text/plain, Size: 1769 bytes --]


On 24 May 2015, at 22:53, Wolfgang Schuster <schuster.wolfgang@gmail.com<mailto:schuster.wolfgang@gmail.com>> wrote:


Am 24.05.2015 um 21:33 schrieb Meer, H. van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>>:

Here an example as minimal as I could construct.

The spaces in the output are produced by the spaces between the tags (\xmlstrip doesn’t seem to work)
and you have to use a combination of \removeunwantedspaces and \ignorespaces to remove them.

To center your table this isn’t necessary when you replace \midaligned with a framedtext
environment in combination with “location=middle” or use a float command like \placefigure.


I think I can reduce the number of places where spaces have to be suppressed. With just 2 \removeunwantedspaces and 1 \ignorespaces I get rid of most of them. The \framed[offset=0pt] shows where spurious space is still inserted.

Only 1 space remains inside the framed: in the vertical dimension below the table. Any idea where this comes from? Some parameter to change in the \framerd perhaps?

Of course I would be happier if none of these space-suppressing is necessary in my code, because ConTeXt takes care of them.

Hans van der Meer

\startxmlsetups xmlcommon:table
\bgroup
\setupxtable[% Setup defaults
leftmargindistance=0pt,rightmargindistance=0pt,
offset=2pt,height=fit,width=fit,
align={center,lohi},columndistance=0pt]
\setupxtableparameters{#1}
\startlocationbox{#1}
\startembeddedxtable
\xmlflush{#1}
\removeunwantedspaces
\stopembeddedxtable
\stoplocationbox
\egroup
\ignorespaces
\stopxmlsetups
\startxmlsetups xmlcommon:tr
\bgroup
\setupxtableparameters{#1}
\removeunwantedspaces
\startxrow
\xmlflush{#1}
\stopxrow
\egroup
\stopxmlsetups





[-- Attachment #1.2: Type: text/html, Size: 5432 bytes --]

[-- Attachment #2: xtablespace.pdf --]
[-- Type: application/pdf, Size: 16218 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-25  8:35                   ` embeddedxtable Meer, H. van der
  2015-05-25  9:26                     ` embeddedxtable Meer, H. van der
@ 2015-05-25 10:55                     ` Wolfgang Schuster
  1 sibling, 0 replies; 18+ messages in thread
From: Wolfgang Schuster @ 2015-05-25 10:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1327 bytes --]


> Am 25.05.2015 um 10:35 schrieb Meer, H. van der <H.vanderMeer@uva.nl>:
> 
> 
>> On 24 May 2015, at 22:53, Wolfgang Schuster <schuster.wolfgang@gmail.com <mailto:schuster.wolfgang@gmail.com>> wrote:
>> 
>> 
>> The spaces in the output are produced by the spaces between the tags (\xmlstrip doesn’t seem to work)
>> and you have to use a combination of \removeunwantedspaces and \ignorespaces to remove them.
>> 
> 
> It is a pity if \xmlstrip does not work. It is of course fairly essential that the whitespace between the tags can be ignored. I sincerely hope this will be looked into. Or could this be a special effect related to either the use of a buffer as source or to the embeddedxtable structure?
> 
> However, it doesn't seem the whole story. I removed all whitespace between the tags and the \unskip's from the code. In the result below you can see that removing the whitespace between the tags removes most of the spurious spaces, but not all of them. Another picture has the = embedded before the \xmlflush in \startrow and shows that still spurious space is injected. To me it looks if every row gets an extra space: three of them before the table and the last one after the table (but here I am guessing).

I removed the “tbody” tag from my example which adds another space.

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 2343 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-25  9:26                     ` embeddedxtable Meer, H. van der
@ 2015-05-25 10:59                       ` Wolfgang Schuster
  0 siblings, 0 replies; 18+ messages in thread
From: Wolfgang Schuster @ 2015-05-25 10:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1573 bytes --]


> Am 25.05.2015 um 11:26 schrieb Meer, H. van der <H.vanderMeer@uva.nl>:
> 
> 
> 
>> On 24 May 2015, at 22:53, Wolfgang Schuster <schuster.wolfgang@gmail.com <mailto:schuster.wolfgang@gmail.com>> wrote:
>> 
>> 
>> The spaces in the output are produced by the spaces between the tags (\xmlstrip doesn’t seem to work)
>> and you have to use a combination of \removeunwantedspaces and \ignorespaces to remove them.
>> 
> 
> 
> There is something I do not understand and I hope you can explain this. The table is typeset by the \xmlflush{#1} in the table macro:
> 
> \startxmlsetups xmlcommon:table
> Z\bgroup
> \setupxtable[% Setup defaults
> leftmargindistance=0pt,rightmargindistance=0pt,
> offset=2pt,height=fit,width=fit,
> align={center,lohi},columndistance=0pt]
> \setupxtableparameters{#1}
> \startlocationbox{#1}
> \removeunwantedspaces
> \startembeddedxtable X\xmlflush{#1}Y\stopembeddedxtable
> \ignorespaces
> \stoplocationbox
> \egroup
> \stopxmlsetups
> 
> The "X" and "Y"  have been placed around the \xmlflush to see what happens. Why do I see them 3 times? It looks as if  the embeddedxtable-line is called 3 times (or maybe 4 times once for each row with the last call vanishing). However, the table macro itself is called only once, the "Z" at the beginning proves that. I cannot explain this. 

This is normal and needed for the calculation of the cell widths and heights.

This mechanism is called trial typesetting and used by a few mechanism (e.g. float captions) to get the dimensions of the content.

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 4285 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-25 10:08                   ` embeddedxtable Meer, H. van der
@ 2015-05-25 11:05                     ` Wolfgang Schuster
  2015-05-25 13:50                       ` embeddedxtable Meer, H. van der
  0 siblings, 1 reply; 18+ messages in thread
From: Wolfgang Schuster @ 2015-05-25 11:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2605 bytes --]


> Am 25.05.2015 um 12:08 schrieb Meer, H. van der <H.vanderMeer@uva.nl>:
> 
> 
>> On 24 May 2015, at 22:53, Wolfgang Schuster <schuster.wolfgang@gmail.com <mailto:schuster.wolfgang@gmail.com>> wrote:
>> 
>> 
>>> Am 24.05.2015 um 21:33 schrieb Meer, H. van der <H.vanderMeer@uva.nl <mailto:H.vanderMeer@uva.nl>>:
>>> 
>>> Here an example as minimal as I could construct.
>> 
>> The spaces in the output are produced by the spaces between the tags (\xmlstrip doesn’t seem to work)
>> and you have to use a combination of \removeunwantedspaces and \ignorespaces to remove them.
>> 
>> To center your table this isn’t necessary when you replace \midaligned with a framedtext
>> environment in combination with “location=middle” or use a float command like \placefigure.
>> 
> 
> I think I can reduce the number of places where spaces have to be suppressed. With just 2 \removeunwantedspaces and 1 \ignorespaces I get rid of most of them. The \framed[offset=0pt] shows where spurious space is still inserted.
> 
> Only 1 space remains inside the framed: in the vertical dimension below the table. Any idea where this comes from? Some parameter to change in the \framerd perhaps?

It’s impossible to tell what’s wrong with our code snippets, you have to create working minimal examples.

The following example shows where you have to take care of extra space and you don’t need them when you put the whole table in a \vbox (you can test by commenting all \ignorespaces and \removeunwantedspaces commands and replacing \ruledhbox with \ruledvbox).

\startxmlsetups xmlcommon
	\xmlsetsetup{\xmldocument}{table|tbody|tr|td}{xmlcommon:*}
\stopxmlsetups

\xmlregistersetup{xmlcommon}

\startxmlsetups xmlcommon:table
%	\removeunwantedspaces
	\startembeddedxtable
		\xmlflush{#1}
	\stopembeddedxtable
	\ignorespaces
\stopxmlsetups

\startxmlsetups xmlcommon:tbody
%	\removeunwantedspaces
	\startxtablebody
	\xmlflush{#1}
	\stopxtablebody
	\ignorespaces
\stopxmlsetups

\startxmlsetups xmlcommon:tr
%	\removeunwantedspaces
	\startxrow
		\xmlflush{#1}
	\stopxrow
	\ignorespaces
\stopxmlsetups

\startxmlsetups xmlcommon:td
	\removeunwantedspaces
	\startxcell
		\xmlflush{#1}
	\stopxcell
	\ignorespaces
\stopxmlsetups

\starttext

\startbuffer[table]
<?xml version="1.0" encoding="UTF-8"?>
<root>
	<table>
		<tbody>
			<tr>
				<td>A</td>
				<td>B</td>
			</tr>
			<tr>
				<td>C</td>
				<td>D</td>
			</tr>
		</tbody>
	</table>
</root>
\stopbuffer

\ruledhbox{\xmlprocessbuffer{root}{table}{}}

\stoptext

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 6540 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: embeddedxtable
  2015-05-25 11:05                     ` embeddedxtable Wolfgang Schuster
@ 2015-05-25 13:50                       ` Meer, H. van der
  0 siblings, 0 replies; 18+ messages in thread
From: Meer, H. van der @ 2015-05-25 13:50 UTC (permalink / raw)
  To: NTG ConTeXt


> On 25 May 2015, at 13:05, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
> 
> The following example shows where you have to take care of extra space and you don’t need them when you put the whole table in a \vbox (you can test by commenting all \ignorespaces and \removeunwantedspaces commands and replacing \ruledhbox with \ruledvbox).
> 

Thanks for the suggestion of the \ruledvbox. This shows that the remaining whitespace originates in the \framed and not in the table code.

Hans van der Meer

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2015-05-25 13:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-24 10:18 embeddedxtable Meer, H. van der
2015-05-24 10:36 ` embeddedxtable Meer, H. van der
2015-05-24 11:49   ` embeddedxtable Meer, H. van der
2015-05-24 13:06     ` embeddedxtable Meer, H. van der
2015-05-24 13:32       ` embeddedxtable Meer, H. van der
2015-05-24 15:31         ` embeddedxtable Wolfgang Schuster
2015-05-24 16:01           ` embeddedxtable Meer, H. van der
2015-05-24 18:16             ` embeddedxtable Wolfgang Schuster
2015-05-24 19:33               ` embeddedxtable Meer, H. van der
2015-05-24 20:53                 ` embeddedxtable Wolfgang Schuster
2015-05-25  8:35                   ` embeddedxtable Meer, H. van der
2015-05-25  9:26                     ` embeddedxtable Meer, H. van der
2015-05-25 10:59                       ` embeddedxtable Wolfgang Schuster
2015-05-25 10:55                     ` embeddedxtable Wolfgang Schuster
2015-05-25  9:06                   ` embeddedxtable Meer, H. van der
2015-05-25 10:08                   ` embeddedxtable Meer, H. van der
2015-05-25 11:05                     ` embeddedxtable Wolfgang Schuster
2015-05-25 13:50                       ` embeddedxtable Meer, H. van der

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).