ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* two newbie questions (about conditional processing)
@ 2009-05-21  1:25 Yue Wang
  2009-05-23 16:17 ` Yue Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Yue Wang @ 2009-05-21  1:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: two newbie questions (about conditional processing)
  2009-05-21  1:25 two newbie questions (about conditional processing) Yue Wang
@ 2009-05-23 16:17 ` Yue Wang
  2009-05-23 16:49 ` Zhichu Chen
  2009-05-23 17:34 ` Wolfgang Schuster
  2 siblings, 0 replies; 19+ messages in thread
From: Yue Wang @ 2009-05-23 16:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

anyone can help? thanks.

On Thu, May 21, 2009 at 9:25 AM, Yue Wang <yuleopen@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
___________________________________________________________________________________


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

* Re: two newbie questions (about conditional processing)
  2009-05-21  1:25 two newbie questions (about conditional processing) Yue Wang
  2009-05-23 16:17 ` Yue Wang
@ 2009-05-23 16:49 ` Zhichu Chen
  2009-05-23 17:16   ` Yue Wang
  2009-05-23 17:34 ` Wolfgang Schuster
  2 siblings, 1 reply; 19+ messages in thread
From: Zhichu Chen @ 2009-05-23 16:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, May 21, 2009 at 9:25 AM, Yue Wang <yuleopen@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
___________________________________________________________________________________

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

* Re: two newbie questions (about conditional processing)
  2009-05-23 16:49 ` Zhichu Chen
@ 2009-05-23 17:16   ` Yue Wang
  0 siblings, 0 replies; 19+ messages in thread
From: Yue Wang @ 2009-05-23 17:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, May 24, 2009 at 12:49 AM, Zhichu Chen <zhichu.chen@gmail.com> wrote:
> On Thu, May 21, 2009 at 9:25 AM, Yue Wang <yuleopen@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
___________________________________________________________________________________


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

* Re: two newbie questions (about conditional processing)
  2009-05-21  1:25 two newbie questions (about conditional processing) Yue Wang
  2009-05-23 16:17 ` Yue Wang
  2009-05-23 16:49 ` Zhichu Chen
@ 2009-05-23 17:34 ` Wolfgang Schuster
  2009-05-24  4:12   ` Zhichu Chen
  2 siblings, 1 reply; 19+ messages in thread
From: Wolfgang Schuster @ 2009-05-23 17:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: two newbie questions (about conditional processing)
  2009-05-23 17:34 ` Wolfgang Schuster
@ 2009-05-24  4:12   ` Zhichu Chen
  2009-05-24  8:00     ` Wolfgang Schuster
  2009-05-24 10:36     ` Hans Hagen
  0 siblings, 2 replies; 19+ messages in thread
From: Zhichu Chen @ 2009-05-24  4:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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.wolfgang@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
___________________________________________________________________________________

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

* Re: two newbie questions (about conditional processing)
  2009-05-24  4:12   ` Zhichu Chen
@ 2009-05-24  8:00     ` Wolfgang Schuster
  2009-05-24  8:46       ` Zhichu Chen
  2009-05-24 10:36     ` Hans Hagen
  1 sibling, 1 reply; 19+ messages in thread
From: Wolfgang Schuster @ 2009-05-24  8:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: two newbie questions (about conditional processing)
  2009-05-24  8:00     ` Wolfgang Schuster
@ 2009-05-24  8:46       ` Zhichu Chen
  2009-05-24  8:57         ` Wolfgang Schuster
  0 siblings, 1 reply; 19+ messages in thread
From: Zhichu Chen @ 2009-05-24  8:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, May 24, 2009 at 4:00 PM, Wolfgang Schuster
<schuster.wolfgang@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
___________________________________________________________________________________

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

* Re: two newbie questions (about conditional processing)
  2009-05-24  8:46       ` Zhichu Chen
@ 2009-05-24  8:57         ` Wolfgang Schuster
  2009-05-24  9:44           ` Zhichu Chen
  0 siblings, 1 reply; 19+ messages in thread
From: Wolfgang Schuster @ 2009-05-24  8:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: two newbie questions (about conditional processing)
  2009-05-24  8:57         ` Wolfgang Schuster
@ 2009-05-24  9:44           ` Zhichu Chen
  0 siblings, 0 replies; 19+ messages in thread
From: Zhichu Chen @ 2009-05-24  9:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, May 24, 2009 at 4:57 PM, Wolfgang Schuster
<schuster.wolfgang@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
___________________________________________________________________________________

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

* Re: two newbie questions (about conditional processing)
  2009-05-24  4:12   ` Zhichu Chen
  2009-05-24  8:00     ` Wolfgang Schuster
@ 2009-05-24 10:36     ` Hans Hagen
  2009-05-25  6:55       ` Zhichu Chen
  1 sibling, 1 reply; 19+ messages in thread
From: Hans Hagen @ 2009-05-24 10:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: two newbie questions (about conditional processing)
  2009-05-24 10:36     ` Hans Hagen
@ 2009-05-25  6:55       ` Zhichu Chen
  2009-05-25  7:12         ` Hans Hagen
  2009-05-25  7:30         ` Wolfgang Schuster
  0 siblings, 2 replies; 19+ messages in thread
From: Zhichu Chen @ 2009-05-25  6:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sun, May 24, 2009 at 6:36 PM, Hans Hagen <pragma@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
___________________________________________________________________________________

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

* Re: two newbie questions (about conditional processing)
  2009-05-25  6:55       ` Zhichu Chen
@ 2009-05-25  7:12         ` Hans Hagen
  2009-05-25  7:40           ` Zhichu Chen
  2009-05-25  7:51           ` Wolfgang Schuster
  2009-05-25  7:30         ` Wolfgang Schuster
  1 sibling, 2 replies; 19+ messages in thread
From: Hans Hagen @ 2009-05-25  7:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Zhichu Chen wrote:
> On Sun, May 24, 2009 at 6:36 PM, Hans Hagen <pragma@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
___________________________________________________________________________________


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

* Re: two newbie questions (about conditional processing)
  2009-05-25  6:55       ` Zhichu Chen
  2009-05-25  7:12         ` Hans Hagen
@ 2009-05-25  7:30         ` Wolfgang Schuster
  2009-05-25  7:42           ` Zhichu Chen
  1 sibling, 1 reply; 19+ messages in thread
From: Wolfgang Schuster @ 2009-05-25  7:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 25.05.2009 um 08:55 schrieb Zhichu Chen:

> On Sun, May 24, 2009 at 6:36 PM, Hans Hagen <pragma@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
___________________________________________________________________________________


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

* Re: two newbie questions (about conditional processing)
  2009-05-25  7:12         ` Hans Hagen
@ 2009-05-25  7:40           ` Zhichu Chen
  2009-05-25  7:51           ` Wolfgang Schuster
  1 sibling, 0 replies; 19+ messages in thread
From: Zhichu Chen @ 2009-05-25  7:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, May 25, 2009 at 3:12 PM, Hans Hagen <pragma@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
___________________________________________________________________________________

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

* Re: two newbie questions (about conditional processing)
  2009-05-25  7:30         ` Wolfgang Schuster
@ 2009-05-25  7:42           ` Zhichu Chen
  2009-05-25  7:49             ` Wolfgang Schuster
  0 siblings, 1 reply; 19+ messages in thread
From: Zhichu Chen @ 2009-05-25  7:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, May 25, 2009 at 3:30 PM, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:
>
> Am 25.05.2009 um 08:55 schrieb Zhichu Chen:
>
>> On Sun, May 24, 2009 at 6:36 PM, Hans Hagen <pragma@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
___________________________________________________________________________________

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

* Re: two newbie questions (about conditional processing)
  2009-05-25  7:42           ` Zhichu Chen
@ 2009-05-25  7:49             ` Wolfgang Schuster
  0 siblings, 0 replies; 19+ messages in thread
From: Wolfgang Schuster @ 2009-05-25  7:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: two newbie questions (about conditional processing)
  2009-05-25  7:12         ` Hans Hagen
  2009-05-25  7:40           ` Zhichu Chen
@ 2009-05-25  7:51           ` Wolfgang Schuster
  2009-05-25  7:57             ` Hans Hagen
  1 sibling, 1 reply; 19+ messages in thread
From: Wolfgang Schuster @ 2009-05-25  7:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: two newbie questions (about conditional processing)
  2009-05-25  7:51           ` Wolfgang Schuster
@ 2009-05-25  7:57             ` Hans Hagen
  0 siblings, 0 replies; 19+ messages in thread
From: Hans Hagen @ 2009-05-25  7:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

end of thread, other threads:[~2009-05-25  7:57 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-21  1:25 two newbie questions (about conditional processing) Yue Wang
2009-05-23 16:17 ` Yue Wang
2009-05-23 16:49 ` Zhichu Chen
2009-05-23 17:16   ` Yue Wang
2009-05-23 17:34 ` Wolfgang Schuster
2009-05-24  4:12   ` Zhichu Chen
2009-05-24  8:00     ` Wolfgang Schuster
2009-05-24  8:46       ` Zhichu Chen
2009-05-24  8:57         ` Wolfgang Schuster
2009-05-24  9:44           ` Zhichu Chen
2009-05-24 10:36     ` Hans Hagen
2009-05-25  6:55       ` Zhichu Chen
2009-05-25  7:12         ` Hans Hagen
2009-05-25  7:40           ` Zhichu Chen
2009-05-25  7:51           ` Wolfgang Schuster
2009-05-25  7:57             ` Hans Hagen
2009-05-25  7:30         ` Wolfgang Schuster
2009-05-25  7:42           ` Zhichu Chen
2009-05-25  7:49             ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).