Re: [NTG-context] How to properly `\setuplayout' for several pages and then restore back?

2015-05-24 Thread Hans Hagen

On 5/23/2015 8:36 PM, Alexander Shukaev wrote:

Hello,

I have a table of contents that now has grown to span several pages.
Before that I used the following setup:

\definemakeup
[contentspage]

\setupmakeup
[contentspage][%
   footerstate={stop},
   headerstate={stop},
 pagestate={stop},
  page={yes},
bottom={\vfill},
   top={},
]

\setuplayout
[contentspage][%
   footer={\zeropoint},
   header={\zeropoint},
]

\setuplayout
[contentspage][%
   footerdistance={\zeropoint},
   headerdistance={\zeropoint},
]

\startcontentspagemakeup

\setupwhitespace
[line]

% ToC

\stopcontentspagemakeup

and that indeed worked when ToC spanned only one page.  Since page
breaking does not work inside `makeup', I had ti give it up.  Now I try
the following:

\start

\setupheader[state={stop}]
\setupfooter[state={stop}]

\setuppagenumbering[state={stop}]

\setuplayout[%
   footer={\zeropoint},
   header={\zeropoint},
]

\setuplayout[%
   footerdistance={\zeropoint},
   headerdistance={\zeropoint},
]

% ToC

\stop

Why after `\stop' previous setups for `layout', `header', `footer', and
`pagenumbering' do not restore?  Is there a way to achieve this or do I
have to manually duplicate the setups which were before `\start'?  Thank
you.


switching layouts is tricky as there is a mix between local and global 
settings and actions around the page crossing


\startlayout[name]

\stoplayout

also, when there is a layout defined with the same name as a makeup, 
then the makeup will take that layout


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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] arranging pages

2015-05-24 Thread Otared Kavian
Hi,

Maybe you need to say also:

\setuppagenumbering[alternative={singlesided,doublesided}]

or just
\setuppagenumbering[alternative={singlesided}]

Best regards: OK

 On 24 May 2015, at 11:24, Meer, H. van der h.vanderm...@uva.nl wrote:
 
 Trying to put 2 pages in A5 format besides one another on an A4 page like 
 this:
 
 --
 | |  |
 | |  |
 | |  |
 |1|  2   |
 | |  |
 | |  |
 --
 
 but using:
 
 \setuppapersize[A5][A4,landscape]
 \setuparranging[2UP]
 
 I get this instead:
 
 --  --
 | |  |  | |  |  
 | |  |  | |  |  
 | |  |  | |  |  
 | | 1|  |2|  |  
 | |  |  | |  |  
 | |  |  | |  |  
 | |  |  | |  |  
 --  --
 
 What I am doing wrong?
 
 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
 ___

___
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

2015-05-24 Thread Meer, H. van der
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   Btable 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.vanderm...@uva.nlmailto:h.vanderm...@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.nlmailto: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
___

___
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] arranging pages

2015-05-24 Thread dr. Hans van der Meer
Neither of these suggestions makes any difference. Not the solution therefore.


Hans van der Meer




 On 24 May 2015, at 12:07, Otared Kavian ota...@gmail.com wrote:
 
 Hi,
 
 Maybe you need to say also:
 
   \setuppagenumbering[alternative={singlesided,doublesided}]
 
 or just
   \setuppagenumbering[alternative={singlesided}]
 
 Best regards: OK
 
 On 24 May 2015, at 11:24, Meer, H. van der h.vanderm...@uva.nl 
 mailto:h.vanderm...@uva.nl wrote:
 
 Trying to put 2 pages in A5 format besides one another on an A4 page like 
 this:
 
 --
 | |  |
 | |  |
 | |  |
 |1|  2   |
 | |  |
 | |  |
 --
 
 but using:
 
 \setuppapersize[A5][A4,landscape]
 \setuparranging[2UP]
 
 I get this instead:
 
 --  --
 | |  |  | |  |  
 | |  |  | |  |  
 | |  |  | |  |  
 | | 1|  |2|  |  
 | |  |  | |  |  
 | |  |  | |  |  
 | |  |  | |  |  
 --  --
 
 What I am doing wrong?
 
 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 
 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/ 
 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 / 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
 ___

___
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

2015-05-24 Thread Meer, H. van der
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.vanderm...@uva.nlmailto:h.vanderm...@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   Btable 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.vanderm...@uva.nlmailto:h.vanderm...@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.nlmailto:ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nlhttp://www.pragma-ade.nl/ / 
http://tex.aanhet.nethttp://tex.aanhet.net/
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.nethttp://contextgarden.net/
___

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

maillist : ntg-context@ntg.nlmailto: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
___

___
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

2015-05-24 Thread Meer, H. van der
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.vanderm...@uva.nlmailto:h.vanderm...@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.vanderm...@uva.nlmailto:h.vanderm...@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   Btable 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.vanderm...@uva.nlmailto:h.vanderm...@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.nlmailto:ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nlhttp://www.pragma-ade.nl/ / 
http://tex.aanhet.nethttp://tex.aanhet.net/
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.nethttp://contextgarden.net/
___

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

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

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

maillist : ntg-context@ntg.nlmailto: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
___

___
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

2015-05-24 Thread Meer, H. van der
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.vanderm...@uva.nlmailto:h.vanderm...@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.vanderm...@uva.nlmailto:h.vanderm...@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.vanderm...@uva.nlmailto:h.vanderm...@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   Btable 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.vanderm...@uva.nlmailto:h.vanderm...@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.nlmailto:ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nlhttp://www.pragma-ade.nl/ / 
http://tex.aanhet.nethttp://tex.aanhet.net/
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.nethttp://contextgarden.net/
___

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

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

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

maillist : ntg-context@ntg.nlmailto:ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nlhttp://www.pragma-ade.nl/ / 
http://tex.aanhet.nethttp://tex.aanhet.net/
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.nethttp://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.nlmailto:ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : 

Re: [NTG-context] Smart Acronym Pluralization (`y' or `ie' before `s')

2015-05-24 Thread Alexander Shukaev
On Sun, May 24, 2015 at 11:17 AM, Hans Hagen pra...@wxs.nl wrote:

 On 5/24/2015 1:39 AM, Alexander Shukaev wrote:

 Hello,

 Consider the following:

 \definesynonyms
 [ACRONYM]
 [ACRONYMS]
 [\FULL]
 [\SHORT]

 ​​
 \ACRONYM{DLL}{Dynamic-Link Librar\doifnextcharelse{s}{ie}{y}}

 Why

 \FULL{DLL}s

 does not do what I expect it to do?  I assume that it's because
 `\doifnextcharelse' expands before `\FULL'.  So how to achieve the
 desired effect?  Thanks.


 \FULL is doing a lot and it's unlikely that inside there the nest token
 seen is the 's' so your test fails

 \ACRONYM{DLL}{\SelectFull{Dynamic-Link Library}{Dynamic-Link Libraries}}

 \def\VeryFullSingular#1#2{\FULL{#1}}
 \def\VeryFullPlural  #1#2{\FULL{#2}}

 \unexpanded\def\VeryFull
   {
 ​​
 \doifnextcharelse{s}
  {\let\SelectFull\VeryFullPlural}
  {\let\SelectFull\VeryFullSingular}}

 test \VeryFull{DLL} or \VeryFull{DLL}s it is

 if there is real need for this i can consider building something in but
 the check for a following 's' is not that common I think


 -
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | www.pragma-pod.nl
 -

 ___
 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

 ___


​Hello Hans,

Thanks for your response.  It seems to me that a simple (and backward
compatible) extension would be to add ​the 3rd optional parameter to
`ACRONYM':

​\ACRONYM{DLL}{Dynamic-Link Library}[Dynamic-Link Libraries][s]
​ ​   ^^  ^
  single  pluraltrigger
(should of course be `s' by default, but let it be configurable just in
case)

​and put

\doifnextcharelse{trigger}{plural}{single}​

​inside `FULL' properly so that it can indeed find trigger in case of
`\FULL{DLL}trigger'.​

Regards,
Alexander
___
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] Environment \starttikzpicture \stoptikzpicture like float

2015-05-24 Thread Hans Hagen

On 5/24/2015 2:36 PM, Aditya Mahajan wrote:




On May 24, 2015, at 5:48 AM, Mojca Miklavec mojca.miklavec.li...@gmail.com 
wrote:


On Sun, May 24, 2015 at 11:20 AM, Fabrice Couvreur wrote:

Hi,
Why the command \placerecipe{}{} does not with an environment
\starttikzpicture
\stoptikzpicture ?


In my opinion this is a bug in TikZ that has been pointed out a
while ago already. The picture creates a wrong type of the box. If I
remember correctly the behaviour is different in LaTeX.

An easy workaround (that I always use) is to enclose the graphic into
an \hbox{}, like this:

\hbox{\starttikzpicture
...
% content
...
\stoptikzpicture}

(With \placefigure or \placerecipe or whatever used as usual before
the \hbox{}.)

We might want to coordinate a patch with the TikZ team.


Yes, it is a two line change in t-tikz that would not affect the latex or plain 
tex behavior.


it all depends how sensitive the environment is with respect to spaces 
as unwanted one can creep in when in horizontal mode


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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] Environment \starttikzpicture \stoptikzpicture like float

2015-05-24 Thread Fabrice Couvreur
Hi,
Why the command \placerecipe{}{} does not with an environment \
starttikzpicture
\stoptikzpicture ?
Fabrice

\setupexternalfigures[location={local,global,default}]

\setuppagenumbering[location=]

\usemodule[tikz]
\usemodule[pgfplots]
\pgfplotsset{compat=1.8}

\definefloat
   [recipe]
   [figure]

\setupfloat
   [recipe]
   [default={right,none}]

\starttext
\startitemize[n][stopper={.},style=bold]
\placerecipe
   {}
{\externalfigure[cow.pdf][width=4cm]}
\item \input knuth
\placerecipe
   {}
{
\starttikzpicture[level 1/.style={level distance=35mm,sibling
distance=40mm},level 2/.style={level distance=25mm,sibling
distance=15mm},cadre/.style={rectangle,draw}]
\node{}[grow=right]
child{node{$\overline{R}$}
child{node{$\overline{M}$}
edge from parent node [below=0.2cm,midway] {\unknown}}
child{node{$M$}
edge from parent node [above=0.2cm,midway] {\unknown}}
edge from parent node [below=0.2cm,midway] {\unknown}
}
child{node{$R$}
child{node{$\overline{M}$}
edge from parent node [below=0.2cm,midway] {\unknown}}
child{node{$M$}
edge from parent node [above=0.2cm,midway] {\unknown}}
edge from parent node [above=0.2cm,scale=0.75] {\unknown}
};
\stoptikzpicture
}
\item \input knuth
\stopitemize
\stoptext
___
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] Environment \starttikzpicture \stoptikzpicture like float

2015-05-24 Thread Hans Hagen

On 5/24/2015 11:20 AM, Fabrice Couvreur wrote:


Hi,
Why the command \placerecipe{}{} does not with an environment
\starttikzpicture
\stoptikzpicture?
Fabrice

\setupexternalfigures[location={local,global,default}]

\setuppagenumbering[location=]

\usemodule[tikz]
\usemodule[pgfplots]
\pgfplotsset{compat=1.8}

\definefloat
[recipe]
[figure]

\setupfloat
[recipe]
[default={right,none}]

\starttext
\startitemize[n][stopper={.},style=bold]
\placerecipe
{}
{\externalfigure[cow.pdf][width=4cm]}
\item \input knuth
\placerecipe
{}
{
\starttikzpicture[level 1/.style={level distance=35mm,sibling
distance=40mm},level 2/.style={level distance=25mm,sibling
distance=15mm},cadre/.style={rectangle,draw}]
\node{}[grow=right]
child{node{$\overline{R}$}
child{node{$\overline{M}$}
edge from parent node [below=0.2cm,midway] {\unknown}}
child{node{$M$}
edge from parent node [above=0.2cm,midway] {\unknown}}
edge from parent node [below=0.2cm,midway] {\unknown}
}
child{node{$R$}
child{node{$\overline{M}$}
edge from parent node [below=0.2cm,midway] {\unknown}}
child{node{$M$}
edge from parent node [above=0.2cm,midway] {\unknown}}
edge from parent node [above=0.2cm,scale=0.75] {\unknown}
};
\stoptikzpicture
}
\item \input knuth
\stopitemize
\stoptext


probably bevause of the way such pictures are wrapped, you can try

\hbox{\starttikzpicture.. \stoptikzpicture}

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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] Environment \starttikzpicture \stoptikzpicture like float

2015-05-24 Thread Fabrice

Thank you for your suggestions, it works.
Fabrice
___
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] Environment \starttikzpicture \stoptikzpicture like float

2015-05-24 Thread Aditya Mahajan


 On May 24, 2015, at 5:48 AM, Mojca Miklavec mojca.miklavec.li...@gmail.com 
 wrote:
 
 On Sun, May 24, 2015 at 11:20 AM, Fabrice Couvreur wrote:
 
 Hi,
 Why the command \placerecipe{}{} does not with an environment
 \starttikzpicture
 \stoptikzpicture ?
 
 In my opinion this is a bug in TikZ that has been pointed out a
 while ago already. The picture creates a wrong type of the box. If I
 remember correctly the behaviour is different in LaTeX.
 
 An easy workaround (that I always use) is to enclose the graphic into
 an \hbox{}, like this:
 
 \hbox{\starttikzpicture
 ...
 % content
 ...
 \stoptikzpicture}
 
 (With \placefigure or \placerecipe or whatever used as usual before
 the \hbox{}.)
 
 We might want to coordinate a patch with the TikZ team.

Yes, it is a two line change in t-tikz that would not affect the latex or plain 
tex behavior. 

Aditya 
___
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] embeddedxtable

2015-05-24 Thread Meer, H. van der
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
___

[NTG-context] arranging pages

2015-05-24 Thread Meer, H. van der
Trying to put 2 pages in A5 format besides one another on an A4 page like this:

--
| |  |
| |  |
| |  |
|1|  2   |
| |  |
| |  |
--

but using:

\setuppapersize[A5][A4,landscape]
\setuparranging[2UP]

I get this instead:

--  --
| |  |  | |  |
| |  |  | |  |
| |  |  | |  |
| | 1|  |2|  |
| |  |  | |  |
| |  |  | |  |
| |  |  | |  |
--  --

What I am doing wrong?

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
___

Re: [NTG-context] arranging pages

2015-05-24 Thread Otared Kavian
Hi again,

Sorry I didn’t notice that you used

\setuparranging[2UP] 

Actually what you want to do may be:

 begin arranging-up-or-side.tex
\setuppapersize[A5][A4,landscape]
\setuplayout[location=middle]
\setuparranging[2SIDE]
%\setuparranging[2UP]  —— Compare with the above
\setuppagenumbering[alternative={singlesided,doublesided}]

\starttext
\dorecurse{20}{\input knuth\par}
\stoptext
 begin arranging-up-or-side.tex

Best regards: OK

 On 24 May 2015, at 11:24, Meer, H. van der h.vanderm...@uva.nl wrote:
 
 Trying to put 2 pages in A5 format besides one another on an A4 page like 
 this:
 
 --
 | |  |
 | |  |
 | |  |
 |1|  2   |
 | |  |
 | |  |
 --
 
 but using:
 
 \setuppapersize[A5][A4,landscape]
 \setuparranging[2UP]
 
 I get this instead:
 
 --  --
 | |  |  | |  |  
 | |  |  | |  |  
 | |  |  | |  |  
 | | 1|  |2|  |  
 | |  |  | |  |  
 | |  |  | |  |  
 | |  |  | |  |  
 --  --
 
 What I am doing wrong?
 
 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
 ___

___
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] Smart Acronym Pluralization (`y' or `ie' before `s')

2015-05-24 Thread Hans Hagen

On 5/24/2015 1:39 AM, Alexander Shukaev wrote:

Hello,

Consider the following:

\definesynonyms
[ACRONYM]
[ACRONYMS]
[\FULL]
[\SHORT]

\ACRONYM{DLL}{Dynamic-Link Librar\doifnextcharelse{s}{ie}{y}}

Why

\FULL{DLL}s

does not do what I expect it to do?  I assume that it's because
`\doifnextcharelse' expands before `\FULL'.  So how to achieve the
desired effect?  Thanks.


\FULL is doing a lot and it's unlikely that inside there the nest token 
seen is the 's' so your test fails


\ACRONYM{DLL}{\SelectFull{Dynamic-Link Library}{Dynamic-Link Libraries}}

\def\VeryFullSingular#1#2{\FULL{#1}}
\def\VeryFullPlural  #1#2{\FULL{#2}}

\unexpanded\def\VeryFull
  {\doifnextcharelse{s}
 {\let\SelectFull\VeryFullPlural}
 {\let\SelectFull\VeryFullSingular}}

test \VeryFull{DLL} or \VeryFull{DLL}s it is

if there is real need for this i can consider building something in but 
the check for a following 's' is not that common I think



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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] Environment \starttikzpicture \stoptikzpicture like float

2015-05-24 Thread Mojca Miklavec
On Sun, May 24, 2015 at 11:20 AM, Fabrice Couvreur wrote:

 Hi,
 Why the command \placerecipe{}{} does not with an environment
 \starttikzpicture
 \stoptikzpicture ?

In my opinion this is a bug in TikZ that has been pointed out a
while ago already. The picture creates a wrong type of the box. If I
remember correctly the behaviour is different in LaTeX.

An easy workaround (that I always use) is to enclose the graphic into
an \hbox{}, like this:

\hbox{\starttikzpicture
...
% content
...
\stoptikzpicture}

(With \placefigure or \placerecipe or whatever used as usual before
the \hbox{}.)

We might want to coordinate a patch with the TikZ team.

Mojca
___
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] arranging pages

2015-05-24 Thread Meer, H. van der
That is it! The difference between 2UP and 2SIDE had escaped me. Thanks.

Hans van der Meer




On 24 May 2015, at 12:15, Otared Kavian 
ota...@gmail.commailto:ota...@gmail.com wrote:

Hi again,

Sorry I didn’t notice that you used

\setuparranging[2UP]

Actually what you want to do may be:

 begin arranging-up-or-side.tex
\setuppapersize[A5][A4,landscape]
\setuplayout[location=middle]
\setuparranging[2SIDE]
%\setuparranging[2UP]  —— Compare with the above
\setuppagenumbering[alternative={singlesided,doublesided}]

\starttext
\dorecurse{20}{\input knuth\par}
\stoptext
 begin arranging-up-or-side.tex

Best regards: OK

On 24 May 2015, at 11:24, Meer, H. van der 
h.vanderm...@uva.nlmailto:h.vanderm...@uva.nl wrote:

Trying to put 2 pages in A5 format besides one another on an A4 page like this:

--
| |  |
| |  |
| |  |
|1|  2   |
| |  |
| |  |
--

but using:

\setuppapersize[A5][A4,landscape]
\setuparranging[2UP]

I get this instead:

--  --
| |  |  | |  |
| |  |  | |  |
| |  |  | |  |
| | 1|  |2|  |
| |  |  | |  |
| |  |  | |  |
| |  |  | |  |
--  --

What I am doing wrong?

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.nlmailto:ntg-context@ntg.nl / 
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nlhttp://www.pragma-ade.nl/ / 
http://tex.aanhet.nethttp://tex.aanhet.net/
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.nethttp://contextgarden.net/
___

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

maillist : ntg-context@ntg.nlmailto: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
___

___
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] Environment \starttikzpicture \stoptikzpicture like float

2015-05-24 Thread Wolfgang Schuster

 Am 24.05.2015 um 11:20 schrieb Fabrice Couvreur fabrice1.couvr...@gmail.com:
 
 
 Hi,
 Why the command \placerecipe{}{} does not with an environment 
 \starttikzpicture 
 \stoptikzpicture ?
 Fabrice
 
 \setupexternalfigures[location={local,global,default}]
 
 \setuppagenumbering[location=]
 
 \usemodule[tikz]
 \usemodule[pgfplots]
 \pgfplotsset{compat=1.8}
 
 \definefloat
[recipe]
[figure]

To make a clone of the figure environment you have to use all three arguments 
for the \definefloat command.

\definefloat[recipe][recipes][figure]

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

2015-05-24 Thread Wolfgang Schuster

 Am 24.05.2015 um 18:01 schrieb Meer, H. van der h.vanderm...@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

___
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] Force to display page number on the `makeup' page

2015-05-24 Thread Wolfgang Schuster

 Am 24.05.2015 um 20:03 schrieb Alexander Shukaev haroo...@gmail.com:
 
 Hello,
 
 I have a special `makeup' for the abstract page:
 
 \definemakeup
 [abstractpage]
 
 I also have general `makeup' setup:
 
 \setupmakeup[
   doublesided={no},
 pagestate={start},
  page={yes},
 ]
 
 The footer is available from general `layout' setup:
 
 \setuplayout[
   footer={16pt},
   header={\zeropoint},
   margin={\zeropoint},
 ]
 
 Page numbering comes from general `pagenumbering' setup:
 
 \setuppagenumbering
 [location={footer}]
 
 I'm aware that `makeup' pages don't display page numbers even though they can 
 count them with the `pagestate={start}' setting.  However, for this 
 particular `makeup' (`abstractpage') I would like to force the display of 
 page number.  I've tried
 
 \startabstractpagemakeup
 
 \setuppagenumbering
 [location={footer}]
 
 ...
 
 \stopabstractpagemakeup
 
 in hope that `makeup' simply sets `location=' behind the scenes to hide the 
 page number, but it seems that I was wrong.  Is it possible to force page 
 number placement for a particular `makeup'?  Thanks a lot.

You can enable the header with the headerstate key and the footer with the 
footerstate key.

\setupmakeup[standard][pagestate=start]

\starttext

\input knuth

\startmakeup[standard]
\input knuth
\stopmakeup

\input knuth

\startmakeup[standard][headerstate=start]
\input knuth
\stopmakeup

\input knuth

\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

2015-05-24 Thread Meer, H. van der
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

Re: [NTG-context] embeddedxtable

2015-05-24 Thread Meer, H. van der
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.wolfg...@gmail.commailto:schuster.wolfg...@gmail.com wrote:


Am 24.05.2015 um 15:32 schrieb Meer, H. van der 
h.vanderm...@uva.nlmailto:h.vanderm...@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.nlmailto: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
___

___
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

2015-05-24 Thread Wolfgang Schuster

 Am 24.05.2015 um 15:32 schrieb Meer, H. van der h.vanderm...@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
___

Re: [NTG-context] Force to display page number on the `makeup' page

2015-05-24 Thread Alexander Shukaev
Thanks, Wolfgang, that indeed does the trick.

A related question.  I've noticed that global `whitespace' setup is not
recognized by `makeup' environment, i.e.

\setupwhitespace[line]

\definemakeup
[abstractpage]

\startabstractpagemakeup

% `whitespace' is definitely not `line'.

\stopabstractpagemakeup

The trivial and ugly solution is to

\definemakeup
[abstractpage]

\startabstractpagemakeup

\setupwhitespace[line]

% `whitespace' is definitely `line'.

\stopabstractpagemakeup

However, I would prefer

\setupmakeup[
  commands={%
\setupwhitespace[line]%
  },
]

but it has no effect too.  I would like to know why and if there is a
alternative?

By the way, the similar setting

\setupmakeup[
  commands={%
\setupinterlinespace[line={4.2ex}]%
  },
]

does have an effect.  Once again, why?  What's the difference in this case?

Regards,
Alexander
___
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] How to properly `\setuplayout' for several pages and then restore back?

2015-05-24 Thread Alexander Shukaev
On Sun, May 24, 2015 at 11:20 AM, Hans Hagen pra...@wxs.nl wrote:

 On 5/23/2015 8:36 PM, Alexander Shukaev wrote:

 Hello,

 I have a table of contents that now has grown to span several pages.
 Before that I used the following setup:

 \definemakeup
 [contentspage]

 \setupmakeup
 [contentspage][%
footerstate={stop},
headerstate={stop},
  pagestate={stop},
   page={yes},
 bottom={\vfill},
top={},
 ]

 \setuplayout
 [contentspage][%
footer={\zeropoint},
header={\zeropoint},
 ]

 \setuplayout
 [contentspage][%
footerdistance={\zeropoint},
headerdistance={\zeropoint},
 ]

 \startcontentspagemakeup

 \setupwhitespace
 [line]

 % ToC

 \stopcontentspagemakeup

 and that indeed worked when ToC spanned only one page.  Since page
 breaking does not work inside `makeup', I had ti give it up.  Now I try
 the following:

 \start

 \setupheader[state={stop}]
 \setupfooter[state={stop}]

 \setuppagenumbering[state={stop}]

 \setuplayout[%
footer={\zeropoint},
header={\zeropoint},
 ]

 \setuplayout[%
footerdistance={\zeropoint},
headerdistance={\zeropoint},
 ]

 % ToC

 \stop

 Why after `\stop' previous setups for `layout', `header', `footer', and
 `pagenumbering' do not restore?  Is there a way to achieve this or do I
 have to manually duplicate the setups which were before `\start'?  Thank
 you.


 switching layouts is tricky as there is a mix between local and global
 settings and actions around the page crossing

 \startlayout[name]

 \stoplayout

 also, when there is a layout defined with the same name as a makeup, then
 the makeup will take that layout

 -
   Hans Hagen | PRAGMA ADE
   Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
  | www.pragma-pod.nl
 -

 ___
 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

 ___


​Works as intended, thanks!​
___
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] Force to display page number on the `makeup' page

2015-05-24 Thread Alexander Shukaev
Hello,

I have a special `makeup' for the abstract page:

\definemakeup
[abstractpage]

I also have general `makeup' setup:

\setupmakeup[
  doublesided={no},
pagestate={start},
 page={yes},
]

The footer is available from general `layout' setup:

\setuplayout[
  footer={16pt},
  header={\zeropoint},
  margin={\zeropoint},
]

Page numbering comes from general `pagenumbering' setup:

\setuppagenumbering
[location={footer}]

I'm aware that `makeup' pages don't display page numbers even though they
can count them with the `pagestate={start}' setting.  However, for this
particular `makeup' (`abstractpage') I would like to force the display of
page number.  I've tried

\startabstractpagemakeup

\setuppagenumbering
[location={footer}]

...

\stopabstractpagemakeup

in hope that `makeup' simply sets `location=' behind the scenes to hide the
page number, but it seems that I was wrong.  Is it possible to force page
number placement for a particular `makeup'?  Thanks a lot.

Kind regards,
Alexander
___
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

2015-05-24 Thread Wolfgang Schuster

 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

\starttext

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

\startbuffer[b]
?xml version=1.0 encoding=UTF-8?
root
tabletrtdA/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
___

Re: [NTG-context] Force to display page number on the `makeup' page

2015-05-24 Thread Wolfgang Schuster

 Am 24.05.2015 um 21:20 schrieb Alexander Shukaev haroo...@gmail.com:
 
 Thanks, Wolfgang, that indeed does the trick.
 
 A related question.  I've noticed that global `whitespace' setup is not 
 recognized by `makeup' environment, i.e.
 
 \setupwhitespace[line]
 
 \definemakeup
 [abstractpage]
 
 \startabstractpagemakeup
 
 % `whitespace' is definitely not `line'.
 
 \stopabstractpagemakeup
 
 The trivial and ugly solution is to
 
 \definemakeup
 [abstractpage]
 
 \startabstractpagemakeup
 
 \setupwhitespace[line]
 
 % `whitespace' is definitely `line'.
 
 \stopabstractpagemakeup
 
 However, I would prefer
 
 \setupmakeup[
   commands={%
 \setupwhitespace[line]%
   },
 ]
 
 but it has no effect too.  I would like to know why and if there is a 
 alternative?
 
 By the way, the similar setting
 
 \setupmakeup[
   commands={%
 \setupinterlinespace[line={4.2ex}]%
   },
 ]
 
 does have an effect.  Once again, why?  What's the difference in this case?

The makeup environment resets the global indentation and whitespace settings.

To apply your own setups for the makeup environment you can put them in a setups
environment and enable them. The commands key can’t be used for this because
its content is flushed before context resets the value and your whitespace 
setting
is never used.

\definemakeup[abstractpage]

\startsetups[makeup:abstractpage]
  \setupwhitespace[line]
\stopsetups

\setupmakeup[abstractpage][setups=makeup:abstractpage]

\setupwhitespace[line]

\starttext

\input knuth

\startmakeup[abstractpage]
\input knuth
\stopmakeup

\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
___