ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Dynamic content on layers - wiki example not working
@ 2012-02-21 10:34 Mari Voipio
  2012-02-21 11:00 ` luigi scarso
  2012-02-21 11:06 ` Marco
  0 siblings, 2 replies; 6+ messages in thread
From: Mari Voipio @ 2012-02-21 10:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello!

I'm trying to place dynamic content on a layer and now it turns out
that while getting a different pic every time is easy, getting the
layers redrawn wasn't that simple. The wiki has this code:

\definelayer
  [pagenumber]
  [width=\paperwidth,
   height=\paperheight,
   preset=middle,
   state=repeat]

\setlayer[pagenumber]{Page \pagenumber}

\setupbackgrounds[page][background=pagenumber]

\starttext
\dorecurse{4}{\page[empty]}
\stoptext



AFAIK, that should be a complete  minimal sample. Unfortunately it
doesn't seem to work, at least my ConTeXt MkIV of February 8 only
gives "Page 1" on every one of those 4 pages...


How to fix this? Preferably on the "Dummies" level, I'd prefer not to
see the bowels of my ConTeXt, if I can avoid it.



Thanks,

Mari
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Dynamic content on layers - wiki example not working
  2012-02-21 10:34 Dynamic content on layers - wiki example not working Mari Voipio
@ 2012-02-21 11:00 ` luigi scarso
  2012-02-21 11:53   ` Wolfgang Schuster
  2012-02-21 11:06 ` Marco
  1 sibling, 1 reply; 6+ messages in thread
From: luigi scarso @ 2012-02-21 11:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Feb 21, 2012 at 11:34 AM, Mari Voipio <mari.voipio@iki.fi> wrote:
> Hello!
>
> I'm trying to place dynamic content on a layer and now it turns out
> that while getting a different pic every time is easy, getting the
> layers redrawn wasn't that simple. The wiki has this code:
>
> \definelayer
>  [pagenumber]
>  [width=\paperwidth,
>   height=\paperheight,
>   preset=middle,
>   state=repeat]
>
> \setlayer[pagenumber]{Page \pagenumber}
>
> \setupbackgrounds[page][background=pagenumber]
>
> \starttext
> \dorecurse{4}{\page[empty]}
> \stoptext
>
>
>
> AFAIK, that should be a complete  minimal sample. Unfortunately it
> doesn't seem to work, at least my ConTeXt MkIV of February 8 only
> gives "Page 1" on every one of those 4 pages...
right, it's ok
>
>
> How to fix this? Preferably on the "Dummies" level, I'd prefer not to
> see the bowels of my ConTeXt, if I can avoid it.
going on on
http://wiki.contextgarden.net/Layers
you see

\definelayer
  [pagenumber]
  [width=\paperwidth,
   height=\paperheight,
   preset=middle]

\startsetups layer

\setlayer[pagenumber]{Page \pagenumber}

\stopsetups

\setupbackgrounds[page][setups=layer,background=pagenumber]

\starttext
\dorecurse{4}{\page[empty]}
\stoptext

Is that what you want ?
-- 
luigi
___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Dynamic content on layers - wiki example not working
  2012-02-21 10:34 Dynamic content on layers - wiki example not working Mari Voipio
  2012-02-21 11:00 ` luigi scarso
@ 2012-02-21 11:06 ` Marco
  2012-02-22  6:54   ` Mari Voipio
  1 sibling, 1 reply; 6+ messages in thread
From: Marco @ 2012-02-21 11:06 UTC (permalink / raw)
  To: ntg-context

On 2012-02-21 Mari Voipio <mari.voipio@iki.fi> wrote:

> The wiki has this code:
> […]

This is an example of how it's *not* going to work:

	“This is not always what you desire like in the example
	 above, where on each page the current page number should
	 be shown and not the number from the first page.”

> How to fix this?

Check out the second one of the two examples of the wiki¹.
It works here.

Marco

[1] http://wiki.contextgarden.net/layers#Use_dynamic_content


___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Dynamic content on layers - wiki example not working
  2012-02-21 11:00 ` luigi scarso
@ 2012-02-21 11:53   ` Wolfgang Schuster
  2012-02-22  7:02     ` Mari Voipio
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2012-02-21 11:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 21.02.2012 um 12:00 schrieb luigi scarso:

> On Tue, Feb 21, 2012 at 11:34 AM, Mari Voipio <mari.voipio@iki.fi> wrote:
>> Hello!
>> 
>> I'm trying to place dynamic content on a layer and now it turns out
>> that while getting a different pic every time is easy, getting the
>> layers redrawn wasn't that simple. The wiki has this code:
>> 
>> \definelayer
>>  [pagenumber]
>>  [width=\paperwidth,
>>   height=\paperheight,
>>   preset=middle,
>>   state=repeat]
>> 
>> \setlayer[pagenumber]{Page \pagenumber}
>> 
>> \setupbackgrounds[page][background=pagenumber]
>> 
>> \starttext
>> \dorecurse{4}{\page[empty]}
>> \stoptext
>> 
>> 
>> 
>> AFAIK, that should be a complete  minimal sample. Unfortunately it
>> doesn't seem to work, at least my ConTeXt MkIV of February 8 only
>> gives "Page 1" on every one of those 4 pages...
> right, it's ok
>> 
>> 
>> How to fix this? Preferably on the "Dummies" level, I'd prefer not to
>> see the bowels of my ConTeXt, if I can avoid it.
> going on on
> http://wiki.contextgarden.net/Layers
> you see
> 
> \definelayer
>  [pagenumber]
>  [width=\paperwidth,
>   height=\paperheight,
>   preset=middle]
> 
> \startsetups layer
> 
> \setlayer[pagenumber]{Page \pagenumber}
> 
> \stopsetups
> 
> \setupbackgrounds[page][setups=layer,background=pagenumber]
> 
> \starttext
> \dorecurse{4}{\page[empty]}
> \stoptext


Here is a slightly different version which is better when you need more dynamic layers.

\definelayer  [pagenumber][width=\overlaywidth,height=\overlayheight,preset=middle]
\defineoverlay[pagenumber][\texsetup{layer}]

\startsetups layer

\setlayer[pagenumber]{Page \pagenumber}

\tightlayer[pagenumber]

\stopsetups

\setupbackgrounds[page][background=pagenumber]

\starttext
\dorecurse{4}{\page[empty]}
\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
___________________________________________________________________________________


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

* Re: Dynamic content on layers - wiki example not working
  2012-02-21 11:06 ` Marco
@ 2012-02-22  6:54   ` Mari Voipio
  0 siblings, 0 replies; 6+ messages in thread
From: Mari Voipio @ 2012-02-22  6:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Feb 21, 2012 at 13:06, Marco <netuse@lavabit.com> wrote:
> This is an example of how it's *not* going to work:

Doh! Either I can't read or I can't copy.... Sorry for the waste of bandwidth!
The correct example works fine - however, I tried something similar in
my file and it didn't work; but there are so many things that can have
gone wrong as my understanding of layers in ConTeXt is still pretty
shaky. (I understand layers as concept as I've done my share of vector
drawing, I just can't translate that knowledge into ConTeXt, at least
not yet.)
Which is why I needed to backtrack a bit and start from something
simple that works.


I added comments to the examples on the wiki so the next person doing
a careless copy-paste won't fall into the same pit. :-D


Slightly red-eared,

Mari
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Dynamic content on layers - wiki example not working
  2012-02-21 11:53   ` Wolfgang Schuster
@ 2012-02-22  7:02     ` Mari Voipio
  0 siblings, 0 replies; 6+ messages in thread
From: Mari Voipio @ 2012-02-22  7:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Feb 21, 2012 at 13:53, Wolfgang Schuster
<schuster.wolfgang@googlemail.com> wrote:
> Here is a slightly different version which is better when you need more dynamic layers.

Hey, I can get it to work. Will take more than a bit of effort to
understanding it, but at least I got it wikified (hopefully correctly)
so I can find it later...
(http://wiki.contextgarden.net/Layers#Use_dynamic_content)


Thank you,

Mari
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2012-02-22  7:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-21 10:34 Dynamic content on layers - wiki example not working Mari Voipio
2012-02-21 11:00 ` luigi scarso
2012-02-21 11:53   ` Wolfgang Schuster
2012-02-22  7:02     ` Mari Voipio
2012-02-21 11:06 ` Marco
2012-02-22  6:54   ` Mari Voipio

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