Re: [NTG-context] embeddedxtable
On 24 May 2015, at 22:53, Wolfgang Schuster schuster.wolfg...@gmail.commailto:schuster.wolfg...@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] ___ 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 ___
Re: [NTG-context] embeddedxtable
On 24 May 2015, at 22:53, Wolfgang Schuster schuster.wolfg...@gmail.com wrote: Am 24.05.2015 um 21:33 schrieb Meer, H. van der h.vanderm...@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. xtablespace.pdf Description: xtablespace.pdf ___ 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 ___
Re: [NTG-context] embeddedxtable
On 24 May 2015, at 22:53, Wolfgang Schuster schuster.wolfg...@gmail.commailto:schuster.wolfg...@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 xtablespace.pdf Description: xtablespace.pdf ___ 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 ___
Re: [NTG-context] embeddedxtable
Am 25.05.2015 um 11:26 schrieb Meer, H. van der h.vanderm...@uva.nl: On 24 May 2015, at 22:53, Wolfgang Schuster schuster.wolfg...@gmail.com mailto:schuster.wolfg...@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 ___ 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 ___
Re: [NTG-context] embeddedxtable
Am 25.05.2015 um 12:08 schrieb Meer, H. van der h.vanderm...@uva.nl: On 24 May 2015, at 22:53, Wolfgang Schuster schuster.wolfg...@gmail.com mailto:schuster.wolfg...@gmail.com wrote: Am 24.05.2015 um 21:33 schrieb Meer, H. van der h.vanderm...@uva.nl mailto:h.vanderm...@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 tdA/td tdB/td /tr tr tdC/td tdD/td /tr /tbody /table /root \stopbuffer \ruledhbox{\xmlprocessbuffer{root}{table}{}} \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 ___
Re: [NTG-context] embeddedxtable
Am 25.05.2015 um 10:35 schrieb Meer, H. van der h.vanderm...@uva.nl: On 24 May 2015, at 22:53, Wolfgang Schuster schuster.wolfg...@gmail.com mailto:schuster.wolfg...@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 ___ 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 ___
Re: [NTG-context] embeddedxtable
On 24 May 2015, at 22:53, Wolfgang Schuster schuster.wolfg...@gmail.commailto:schuster.wolfg...@gmail.com wrote: Am 24.05.2015 um 21:33 schrieb Meer, H. van der h.vanderm...@uva.nlmailto:h.vanderm...@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 xtablespace.pdf Description: xtablespace.pdf ___ 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 ___
Re: [NTG-context] embeddedxtable
On 25 May 2015, at 13:05, Wolfgang Schuster schuster.wolfg...@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 ___
[NTG-context] Architectural paper sizes
Hello, I made definitions for the architectural paper sizes, usually known as ArchA, ArchB, etc. I don't know if you want to add them to base/page-lay.mkiv. % Architectural sizes \definepapersize [ArchA] [\c!width=9in, \c!height=12in] % 3:4 \definepapersize [ArchB] [\c!width=12in,\c!height=18in] % 2:3 \definepapersize [ArchC] [\c!width=18in,\c!height=24in] % 3:4 \definepapersize [ArchD] [\c!width=24in,\c!height=36in] % 2:3 \definepapersize [ArchE] [\c!width=36in,\c!height=48in] % 3:4 \definepapersize [ArchE1] [\c!width=30in,\c!height=42in] % 5:7 \definepapersize [ArchE2] [\c!width=26in,\c!height=38in] % 13:19 \definepapersize [ArchE3] [\c!width=27in,\c!height=39in] % 9:13 -- Kate ___ 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 ___