Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-25 Thread Zhichu Chen
On Sun, May 24, 2009 at 6:36 PM, Hans Hagen pra...@wxs.nl wrote:

 something like state=once would be handy but i'm not going to touch that
 code till i'm redoing some page-* code in mkiv
I don't get it, the once made me confused. Should that just be
affectedpage=current or range={1,2,15} which will make more
sense to me. I don't know the range for once

Anyway, hi Yue, this small test file may be useful:

% \tracingmacros=2

\def\Reverse
  {\global\negateprintboxtrue
   \appendtoks\global\negateprintboxfalse\to\afterpage}

\setuphead
  [chapter]
  [before=\Reverse]

\setupcolors[state=start]

\starttext

\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\stoptext


 Hans


 -
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki     : http://contextgarden.net
 ___




-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-25 Thread Hans Hagen

Zhichu Chen wrote:

On Sun, May 24, 2009 at 6:36 PM, Hans Hagen pra...@wxs.nl wrote:

something like state=once would be handy but i'm not going to touch that
code till i'm redoing some page-* code in mkiv

I don't get it, the once made me confused. Should that just be
affectedpage=current or range={1,2,15} which will make more
sense to me. I don't know the range for once


well, we have already

state=repeat: same background each upcoming page
state=start : enable background (calculate each time)
state=stop  : disable backgrond

so we would have

state=once  : enable background and after this page disable it

in this case 'once' is kind of start before and stop after \page

a range makes not much sense as one seldom knows the page in advance so 
that would then be named pages; however, as we have 25 page areas it 
would involve more testing then i currently want to do (the otr is 
already not that fast)




-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-25 Thread Wolfgang Schuster


Am 25.05.2009 um 08:55 schrieb Zhichu Chen:


On Sun, May 24, 2009 at 6:36 PM, Hans Hagen pra...@wxs.nl wrote:


something like state=once would be handy but i'm not going to touch  
that

code till i'm redoing some page-* code in mkiv


I don't get it, the once made me confused. Should that just be
affectedpage=current or range={1,2,15} which will make more
sense to me. I don't know the range for once

Anyway, hi Yue, this small test file may be useful:


Very nice but it shows only up in Adobe Reader and you can't select
the color for the background.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-25 Thread Zhichu Chen
On Mon, May 25, 2009 at 3:12 PM, Hans Hagen pra...@wxs.nl wrote:

 well, we have already

 state=repeat: same background each upcoming page
 state=start : enable background (calculate each time)
 state=stop  : disable backgrond

 so we would have

 state=once  : enable background and after this page disable it

 in this case 'once' is kind of start before and stop after \page
Cool, I'm looking forward to that.

 a range makes not much sense as one seldom knows the page in advance so that
 would then be named pages; however, as we have 25 page areas it would
 involve more testing then i currently want to do (the otr is already not
 that fast)
No we won't know the page numbers so forget mine.

There's just one other thing: since we are changing background colors,
we probably need the text colors to be changed as well. But by searching
the sources, I only get the negative color scheme which is some sort of
pdf specials or gs specials. I mean can we just customize such configurations
ourselves? Like colorscheme={inverse+0.1} will inverse the color and reduce
the RGB value to 10%. Then my little test file could make more useful.





 -
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki     : http://contextgarden.net
 ___




-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-25 Thread Zhichu Chen
On Mon, May 25, 2009 at 3:30 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

 Am 25.05.2009 um 08:55 schrieb Zhichu Chen:

 On Sun, May 24, 2009 at 6:36 PM, Hans Hagen pra...@wxs.nl wrote:

 something like state=once would be handy but i'm not going to touch that
 code till i'm redoing some page-* code in mkiv

 I don't get it, the once made me confused. Should that just be
 affectedpage=current or range={1,2,15} which will make more
 sense to me. I don't know the range for once

 Anyway, hi Yue, this small test file may be useful:

 Very nice
Thank you:)

 but it shows only up in Adobe Reader
I don't know what's that mean.

 and you can't select
 the color for the background.
No, I can't. I'm trying to figure out how to make a more interesting
test file.


 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki     : http://contextgarden.net
 ___




-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-25 Thread Wolfgang Schuster


Am 25.05.2009 um 09:42 schrieb Zhichu Chen:


but it shows only up in Adobe Reader

I don't know what's that mean.


You have to view the PDF view Adobe Reader to see effect for
the chapter page, when I open the file with Preview App the chapter
page has black text on a white background.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-25 Thread Wolfgang Schuster


Am 25.05.2009 um 09:12 schrieb Hans Hagen:


well, we have already

state=repeat: same background each upcoming page
state=start : enable background (calculate each time)
state=stop  : disable backgrond


These settings have no effect on the background color, you can control
with them only the background layer (overlays) :(

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-25 Thread Hans Hagen

Wolfgang Schuster wrote:


Am 25.05.2009 um 09:12 schrieb Hans Hagen:


well, we have already

state=repeat: same background each upcoming page
state=start : enable background (calculate each time)
state=stop  : disable backgrond


These settings have no effect on the background color, you can control
with them only the background layer (overlays) :(


ok

well, i mostly use overlays for background colors anyway -)

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-24 Thread Wolfgang Schuster


Am 24.05.2009 um 06:12 schrieb Zhichu Chen:

As you said before, in my problem, this kind of handler could break  
something

like hyper-links, and I assume Yue wanted those kind of stuffs.


I don't think this is a problem for this example because the page  
dimension
are always the same while in the code for you the real and the  
calculated

coordinates are different.

Maybe just a \start(stop)setups which changes the background back to  
normal

and \prependtoks it to some token list. So is there an \everypage or
\everyshipout
token? Then using \setuphead (I don't know if it's appropriate) or
\appendtoks to every title page.


I posted a code to enable/disable the backgroundcolor for certain pages
not so long ago, take a look in the mail archive.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-24 Thread Zhichu Chen
On Sun, May 24, 2009 at 4:00 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

 Am 24.05.2009 um 06:12 schrieb Zhichu Chen:

 As you said before, in my problem, this kind of handler could break
 something
 like hyper-links, and I assume Yue wanted those kind of stuffs.

 I don't think this is a problem for this example because the page dimension
 are always the same while in the code for you the real and the calculated
 coordinates are different.

 Maybe just a \start(stop)setups which changes the background back to
 normal
 and \prependtoks it to some token list. So is there an \everypage or
 \everyshipout
 token? Then using \setuphead (I don't know if it's appropriate) or
 \appendtoks to every title page.

 I posted a code to enable/disable the backgroundcolor for certain pages
 not so long ago, take a look in the mail archive.

Found it. Well, then it's just as easy as it sounds:

\unprotect

\let\!!savedbackgroundcolor\empty

\def\onbackground
 {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor}

\def\offbackground
 {\globallet\!!savedbackgroundcolor\@@mapagebackgroundcolor
  \globalletempty\@@mapagebackgroundcolor}

\def\nobackground
 {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor
  \globalletempty\@@mapagebackgroundcolor
  
\appendtoks\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor\to\afterpage}

\def\gobackground
 {\globallet\@@mapagebackgroundcolor\!!savedbackgroundcolor
  \appendtoks\globalletempty\@@mapagebackgroundcolor\to\afterpage}

\protect

\setuphead
  [chapter]
  [before=\gobackground]

\setupcolors[state=start]
\setupbackgrounds[page][background=color,backgroundcolor=lightgray]\offbackground

\starttext

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\chapter{hello}
\dorecurse{10}{\input zapf\par}

\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  : https://foundry.supelec.fr/projects/contextrev/
 wiki     : http://contextgarden.net
 ___




-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-24 Thread Wolfgang Schuster


Am 24.05.2009 um 10:46 schrieb Zhichu Chen:


Maybe just a \start(stop)setups which changes the background back to
normal and \prependtoks it to some token list. So is there an  
\everypage or
\everyshipout token? Then using \setuphead (I don't know if it's  
appropriate) or

\appendtoks to every title page.


I posted a code to enable/disable the backgroundcolor for certain  
pages

not so long ago, take a look in the mail archive.


Found it. Well, then it's just as easy as it sounds:


This could be the better method for the background color (when the code
is rewritten in a better style) but to change the textcolor you need my
other code.

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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-24 Thread Zhichu Chen
On Sun, May 24, 2009 at 4:57 PM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

 Am 24.05.2009 um 10:46 schrieb Zhichu Chen:

 Maybe just a \start(stop)setups which changes the background back to
 normal and \prependtoks it to some token list. So is there an \everypage
 or
 \everyshipout token? Then using \setuphead (I don't know if it's
 appropriate) or
 \appendtoks to every title page.

 I posted a code to enable/disable the backgroundcolor for certain pages
 not so long ago, take a look in the mail archive.

 Found it. Well, then it's just as easy as it sounds:

 This could be the better method for the background color (when the code
 is rewritten in a better style) but to change the textcolor you need my
 other code.
Yes, I noticed that. I added the foregroundcolor part to your code but
only pagenumbers are affected. And by appending
\setuppapersize [A4][A4,negative]
to \afterpage gives a really weird result

 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki     : http://contextgarden.net
 ___




-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-24 Thread Hans Hagen

Zhichu Chen wrote:

As you said before, in my problem, this kind of handler could break something
like hyper-links, and I assume Yue wanted those kind of stuffs.

Maybe just a \start(stop)setups which changes the background back to normal
and \prependtoks it to some token list. So is there an \everypage or
\everyshipout
token? Then using \setuphead (I don't know if it's appropriate) or
\appendtoks to
every title page.


something like state=once would be handy but i'm not going to touch that 
code till i'm redoing some page-* code in mkiv


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-23 Thread Yue Wang
anyone can help? thanks.

On Thu, May 21, 2009 at 9:25 AM, Yue Wang yuleo...@gmail.com wrote:
 Hi,

 I have a new book to design, but I don't know how to do page/content
 conditional processing). Please help me:)

 - I want my chapter page (first page of each chapter) to be really
 distinctive. that is, I define a dark color background, and want all
 the text on the first page set in white. how can I do that? for
 example
 \chapter{hello}
 \dorecurse{10}{\input zapf } % all the characters in the first page
 should white, others should set in black.

 - I want to insert graphics and images. all the graphics are inserted
 using \placeexternalfigures. I want all the pages where the insertion
 happens to be quite distictive (that is, have a very narrow text
 layout, and leave the large margin for the figures. However, when a
 page starts, TeX does not know wheter or not an external figure will
 be placed on this page, so it really has no idea whether this page
 should be set narrower or not. how can I do that?

 Thanks.

 Yue Wang

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-23 Thread Zhichu Chen
On Thu, May 21, 2009 at 9:25 AM, Yue Wang yuleo...@gmail.com wrote:
 Hi,

 I have a new book to design, but I don't know how to do page/content
 conditional processing). Please help me:)

 - I want my chapter page (first page of each chapter) to be really
 distinctive. that is, I define a dark color background, and want all
 the text on the first page set in white. how can I do that? for
 example
 \chapter{hello}
 \dorecurse{10}{\input zapf } % all the characters in the first page
 should white, others should set in black.
This must have something to do with the OTR, I'm really not good
at that.

By \definecolor[black][r=1, g=1, b=1] you can get white texts which
maybe useful for you.

 - I want to insert graphics and images. all the graphics are inserted
 using \placeexternalfigures. I want all the pages where the insertion
 happens to be quite distictive (that is, have a very narrow text
 layout, and leave the large margin for the figures. However, when a
 page starts, TeX does not know wheter or not an external figure will
 be placed on this page, so it really has no idea whether this page
 should be set narrower or not. how can I do that?
Sounds like an \insert like footnote. Good luck.

 Thanks.

 Yue Wang
 ___
 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki     : http://contextgarden.net
 ___




-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-23 Thread Yue Wang
On Sun, May 24, 2009 at 12:49 AM, Zhichu Chen zhichu.c...@gmail.com wrote:
 On Thu, May 21, 2009 at 9:25 AM, Yue Wang yuleo...@gmail.com wrote:
 Hi,

 I have a new book to design, but I don't know how to do page/content
 conditional processing). Please help me:)

 - I want my chapter page (first page of each chapter) to be really
 distinctive. that is, I define a dark color background, and want all
 the text on the first page set in white. how can I do that? for
 example
 \chapter{hello}
 \dorecurse{10}{\input zapf } % all the characters in the first page
 should white, others should set in black.
 This must have something to do with the OTR, I'm really not good
 at that.

 By \definecolor[black][r=1, g=1, b=1] you can get white texts which
 maybe useful for you.

confused. can you give me an example?



 - I want to insert graphics and images. all the graphics are inserted
 using \placeexternalfigures. I want all the pages where the insertion
 happens to be quite distictive (that is, have a very narrow text
 layout, and leave the large margin for the figures. However, when a
 page starts, TeX does not know wheter or not an external figure will
 be placed on this page, so it really has no idea whether this page
 should be set narrower or not. how can I do that?
 Sounds like an \insert like footnote. Good luck.


Yes. but a footnote on margin...


 Thanks.

 Yue Wang
 ___
 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  : https://foundry.supelec.fr/projects/contextrev/
 wiki     : http://contextgarden.net
 ___




 --
 Best Regards
 Chen
 

          Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
         No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
             tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
                                               | www.sinap.ac.cn
 
 ___
 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  : https://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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-23 Thread Wolfgang Schuster


Am 21.05.2009 um 03:25 schrieb Yue Wang:


Hi,

I have a new book to design, but I don't know how to do page/content
conditional processing). Please help me:)

- I want my chapter page (first page of each chapter) to be really
distinctive. that is, I define a dark color background, and want all
the text on the first page set in white. how can I do that? for
example
\chapter{hello}
\dorecurse{10}{\input zapf } % all the characters in the first page
should white, others should set in black.



Took me a while but with the help of the MkII/IV manual I was able to
implement the chapter layout.

\enableattributeinheritance

\newif\ifchapterpage

\installpagehandler{color}%
 {\dowithnextbox
{\ifchapterpage

\actualshipout 
{\framed[background=color,backgroundcolor=black,foregroundcolor=white] 
{\attributedbox\nextbox}}

 \else
   \actualshipout{\flushnextbox}
 \fi\global\chapterpagefalse}
  \normalhbox}

\starttext

\setuppaper[method=color]

\subject{Tufte}\chapterpagetrue

\dorecurse{10}{\input tufte\par}

\page

\setuppaper[method=color]

\subject{Knuth}\chapterpagetrue

\dorecurse{10}{\input knuth\par}

\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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] two newbie questions (about conditional processing)

2009-05-23 Thread Zhichu Chen
As you said before, in my problem, this kind of handler could break something
like hyper-links, and I assume Yue wanted those kind of stuffs.

Maybe just a \start(stop)setups which changes the background back to normal
and \prependtoks it to some token list. So is there an \everypage or
\everyshipout
token? Then using \setuphead (I don't know if it's appropriate) or
\appendtoks to
every title page.

On Sun, May 24, 2009 at 1:34 AM, Wolfgang Schuster
schuster.wolfg...@googlemail.com wrote:

 Took me a while but with the help of the MkII/IV manual I was able to
 implement the chapter layout.

 \enableattributeinheritance

 \newif\ifchapterpage

 \installpagehandler{color}%
  {\dowithnextbox
    {\ifchapterpage

 \actualshipout{\framed[background=color,backgroundcolor=black,foregroundcolor=white]{\attributedbox\nextbox}}
     \else
       \actualshipout{\flushnextbox}
     \fi\global\chapterpagefalse}
  \normalhbox}

 \starttext

 \setuppaper[method=color]

 \subject{Tufte}\chapterpagetrue

 \dorecurse{10}{\input tufte\par}

 \page

 \setuppaper[method=color]

 \subject{Knuth}\chapterpagetrue

 \dorecurse{10}{\input knuth\par}

 \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  : https://foundry.supelec.fr/projects/contextrev/
 wiki     : http://contextgarden.net
 ___




-- 
Best Regards
Chen


  Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
 No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
 tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
   | www.sinap.ac.cn

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] two newbie questions (about conditional processing)

2009-05-20 Thread Yue Wang
Hi,

I have a new book to design, but I don't know how to do page/content
conditional processing). Please help me:)

- I want my chapter page (first page of each chapter) to be really
distinctive. that is, I define a dark color background, and want all
the text on the first page set in white. how can I do that? for
example
\chapter{hello}
\dorecurse{10}{\input zapf } % all the characters in the first page
should white, others should set in black.

- I want to insert graphics and images. all the graphics are inserted
using \placeexternalfigures. I want all the pages where the insertion
happens to be quite distictive (that is, have a very narrow text
layout, and leave the large margin for the figures. However, when a
page starts, TeX does not know wheter or not an external figure will
be placed on this page, so it really has no idea whether this page
should be set narrower or not. how can I do that?

Thanks.

Yue Wang
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___