Am 03.04.2009 um 22:54 schrieb Khaled Hosny:

How to set a background for the current page only? \setupbackgrounds
sets backgrounds for all pages, I don't seem to find a way to turn it
on/off for certain pages (\setupbackgrounds[state=start/stop] has no
effect).


Tricky thing, here is a (not so) quick and dirty solution.

\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

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

\starttext
\input tufte
\page
\gobackground
\input tufte
\page
\input tufte
\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
___________________________________________________________________________________

Reply via email to