I have a layer that I'd like to appear on some pages but not others, and for which I'd like to switch the content by page. (I need the layer to precisely and reliably locate some graphics. However, as I see it, you can only set the visibility of a layer in \definelayer, \setupbackgrounds - and these ought to preceed \starttext Any pointers / elegant suggestions / neat solutions? Thanks Ian
Am 26.04.2011 um 12:33 schrieb Ian Lawrence:
I have a layer that I'd like to appear on some pages but not others, and for which I'd like to switch the content by page. (I need the layer to precisely and reliably locate some graphics.
However, as I see it, you can only set the visibility of a layer in \definelayer, \setupbackgrounds - and these ought to preceed \starttext
Any pointers / elegant suggestions / neat solutions?
A better solution requires more information from you! \definelayer[test] \startsetups[test] \doifinset{\pagenumber}{1,3,7,10}{\setlayer[test][x=3cm,y=7cm]{\ssd Test: \test}} \stopsetups \setupbackgrounds[page][background=test,setups=test] \starttext \dorecurse{12} {\def\test{\convertnumber{A}{\recurselevel}}% \dontleavehmode\page} \stoptext Wolfgang
Thanks, as every. More information - I hope without overload.
I was trying to make a test suite... And failed depressingly...
I have a series of swf files that I'd like to position in exactly the
same location on a page.
Not all pages will have an swf on them.
The swf will be specific to that page.
Now I think need a layer to be able to position exactly - that is so
many pixels in and down from the top ('Paper' size is 1024 by 768) -
I don't know how to do this with overlays, and it seems to me that the
documentation suggests that layers are made for this job:
So I write:
\definepapersize[Screen][width=1024px,height=768px]
\setuppapersize[Screen][Screen]
\definelayer [SPTinteractivemedium] % name of the layer
[x=359px, y=140px, % from upper left corner of paper
width=642px, height=492px, repeat=yes] % let the layer be large
enough for the med swf
And then
\setupbackgrounds[page][state=page,background={SPTinteractivemedium}]
Then i the text I write
\starttext
Hello world, etc
\setlayer [SPTinteractivemedium] % name of the layer
[hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer)
{\externalfigure [plug][width=200px]} % the actual contents of the layer
But when I get to a new page I'd like to be able to change that plug,
or even have the layer blank
So
\page[yes]
\setlayer [SPTinteractivemedium] % name of the layer
[hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer)
{ \externalfigure [dummy][width=100px]} % the actual contents of the layer
And;
\page[yes]
\setlayer [SPTinteractivemedium] % name of the layer
[hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer)
{ \externalfigure ??????? } % HOW TO SET THE \externalfigure to
NOTHING, or hide the layer?
It seems this ought to be easy, but I tried guessing a 'state=page'
parameter in \setlayer... And trawling wiki, manuals. No joy.
I might try changing the backgrounds on a page by page basis, but this
seems inelegant, as the \setups ought to be before the \starttext..?
On 26 April 2011 13:35, Wolfgang Schuster
Am 26.04.2011 um 12:33 schrieb Ian Lawrence:
I have a layer that I'd like to appear on some pages but not others, and for which I'd like to switch the content by page. (I need the layer to precisely and reliably locate some graphics.
However, as I see it, you can only set the visibility of a layer in \definelayer, \setupbackgrounds - and these ought to preceed \starttext
Any pointers / elegant suggestions / neat solutions?
A better solution requires more information from you!
\definelayer[test]
\startsetups[test] \doifinset{\pagenumber}{1,3,7,10}{\setlayer[test][x=3cm,y=7cm]{\ssd Test: \test}} \stopsetups
\setupbackgrounds[page][background=test,setups=test]
\starttext \dorecurse{12} {\def\test{\convertnumber{A}{\recurselevel}}% \dontleavehmode\page} \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 ___________________________________________________________________________________
On 26-4-2011 6:26, Ian Lawrence wrote:
But when I get to a new page I'd like to be able to change that plug, or even have the layer blank
that happens automatically unless the state of the layer is set to 'repeat' so normally, once a layer is placed its content is forgotten
\page[yes]
\setlayer [SPTinteractivemedium] % name of the layer [hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer) { \externalfigure [dummy][width=100px]} % the actual contents of the layer
And;
\page[yes] \setlayer [SPTinteractivemedium] % name of the layer [hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer) { \externalfigure ??????? } % HOW TO SET THE \externalfigure to NOTHING, or hide the layer?
\resetlayer [SPTinteractivemedium]
I might try changing the backgrounds on a page by page basis, but this seems inelegant, as the \setups ought to be before the \starttext..?
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
OK, now maybe I get it. This might help someone...
It's the **contents** of the layer that get repeated if you set
repeat=yes in \definelayer - as in
http://wiki.contextgarden.net/Layers
If you do a \setlayer then this simply adds to the existing stack of
contents displayed on the layer. You get more and more stuff until
you do a \resetlayer, assuming you set repeat=yes in the
\definelayer. Thus(?) \definelayer is all about the contents of the
layer (? Apart from setting the dimensions and so on... I think that's
what deflected me into thinking that this command was about the
canvas, and the \setlayer about the contents.)
The \setupbackgrounds[page][state=repeat,background={XXX}] is the
command that puts the logical layer on each page.
If this seems about right then I'll have a go at adding a sentence or
two to the wiki...maybe on-one else thinks of it in terms of the
existence and then the population of a layer...?
On 26 April 2011 17:44, Hans Hagen
On 26-4-2011 6:26, Ian Lawrence wrote:
But when I get to a new page I'd like to be able to change that plug, or even have the layer blank
that happens automatically unless the state of the layer is set to 'repeat'
so normally, once a layer is placed its content is forgotten
\page[yes]
\setlayer [SPTinteractivemedium] % name of the layer [hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer) { \externalfigure [dummy][width=100px]} % the actual contents of the layer
And;
\page[yes] \setlayer [SPTinteractivemedium] % name of the layer [hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer) { \externalfigure ??????? } % HOW TO SET THE \externalfigure to NOTHING, or hide the layer?
\resetlayer [SPTinteractivemedium]
I might try changing the backgrounds on a page by page basis, but this seems inelegant, as the \setups ought to be before the \starttext..?
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 26-4-2011 7:41, Ian Lawrence wrote:
The \setupbackgrounds[page][state=repeat,background={XXX}] is the command that puts the logical layer on each page.
indeed, and that repeat is independent of layers Also, you can have multiple layers, so \setupbackgrounds[page][state=repeat,background={XXX,YYY}] as well as put stuff in front \setupbackgrounds[page][state=repeat,background={XXX,foreground,YYY}] in this case YYY goes in front. And then there are viewerlayers (acrobat) that you can turn on and off with \goto{On}[VideLayer{mylayer}] but that's a different topic. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Ian Lawrence
-
Wolfgang Schuster