ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Background for current page only
@ 2009-04-03 20:54 Khaled Hosny
  2009-04-03 21:19 ` Hans Hagen
  2009-04-04  8:45 ` Wolfgang Schuster
  0 siblings, 2 replies; 5+ messages in thread
From: Khaled Hosny @ 2009-04-03 20:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 339 bytes --]

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).

Regards,
 Khaled


-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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] 5+ messages in thread

* Re: Background for current page only
  2009-04-03 20:54 Background for current page only Khaled Hosny
@ 2009-04-03 21:19 ` Hans Hagen
  2009-04-04  0:08   ` Khaled Hosny
  2009-04-04  8:45 ` Wolfgang Schuster
  1 sibling, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2009-04-03 21:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Khaled Hosny wrote:
> 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).

state=start|stop|repeat

by default the one for the page is repeat

\setupbackgrounds[page][state=...]
\setupbackgrounds[leftpage][state=...]
\setupbackgrounds[rightpage][state=...]

etc


-----------------------------------------------------------------
                                           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] 5+ messages in thread

* Re: Background for current page only
  2009-04-03 21:19 ` Hans Hagen
@ 2009-04-04  0:08   ` Khaled Hosny
  0 siblings, 0 replies; 5+ messages in thread
From: Khaled Hosny @ 2009-04-04  0:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1.1: Type: text/plain, Size: 1138 bytes --]

On Fri, Apr 03, 2009 at 11:19:07PM +0200, Hans Hagen wrote:
> Khaled Hosny wrote:
>> 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).
>
> state=start|stop|repeat
>
> by default the one for the page is repeat
>
> \setupbackgrounds[page][state=...]
> \setupbackgrounds[leftpage][state=...]
> \setupbackgrounds[rightpage][state=...]
>
> etc

I think I missing something here, in the following example I expect the
2nd page (and any subsequent page) not to have a background, but that is
not what I get. I tried every combination of state=start|stop|repeat,
but nothing seem to change at all.

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

\starttext
\setupbackgrounds[page][state=start]
\input tufte
\page
\setupbackgrounds[page][state=stop]
\input tufte
\stoptext

Regards,
 Khaled


-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer

[-- Attachment #1.1.2: bck.pdf --]
[-- Type: application/pdf, Size: 29624 bytes --]

[-- Attachment #1.1.3: bck.tex --]
[-- Type: text/x-tex, Size: 234 bytes --]

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

\starttext
\setupbackgrounds[page][state=start]
\input tufte
\page
\setupbackgrounds[page][state=stop]
\input tufte
\stoptext

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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] 5+ messages in thread

* Re: Background for current page only
  2009-04-03 20:54 Background for current page only Khaled Hosny
  2009-04-03 21:19 ` Hans Hagen
@ 2009-04-04  8:45 ` Wolfgang Schuster
  2009-04-04 14:41   ` Khaled Hosny
  1 sibling, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2009-04-04  8:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


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

* Re: Background for current page only
  2009-04-04  8:45 ` Wolfgang Schuster
@ 2009-04-04 14:41   ` Khaled Hosny
  0 siblings, 0 replies; 5+ messages in thread
From: Khaled Hosny @ 2009-04-04 14:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 576 bytes --]

On Sat, Apr 04, 2009 at 10:45:09AM +0200, Wolfgang Schuster wrote:
>
> 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.

Thanks, that was of great help!

Regards,
 Khaled


-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2009-04-04 14:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-03 20:54 Background for current page only Khaled Hosny
2009-04-03 21:19 ` Hans Hagen
2009-04-04  0:08   ` Khaled Hosny
2009-04-04  8:45 ` Wolfgang Schuster
2009-04-04 14:41   ` Khaled Hosny

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).