Re: [NTG-context] Some question regarding Layers

2009-12-19 Thread Wolfgang Schuster

Am 18.12.2009 um 21:56 schrieb Erik Margraf:

 Thank's very much! Works perfect. At least with texexec (I suppose that's 
 MKII) 
 I didn't get it to work with context (MKIV, i suppose) 
 Is this supposed to work unchanged with MIV also?

AFAIR \currentvalue did not work in MkIV but you don't have to define a new 
layer
for each graphic, one is enough and can be multiple times.

\definelayer[MLayer]

\setupbackgrounds[page][background=MLayer]

\define[1]\MLayer
  {\setlayerframed
 [MLayer]
 [width=\paperwidth,
  height=\paperheight,
  frame=off,
  align={middle,middle}]
 {\externalfigure[#1]}}

\starttext
...
\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
___


Re: [NTG-context] Some question regarding Layers

2009-12-17 Thread Wolfgang Schuster

Am 17.12.2009 um 14:05 schrieb Erik Margraf:

 Hi all,
 i have two questions regarding the use of layers. 
 
  -- Is there an easy way to position a layer in the middle of the page.
 My intent is to position some kind of graphic/picture there. 
 I usually try to wrap the picture in a hbox to \paperwidth {\hfil 
 \externalfigure{} \hfil} and then
 wrapping the hbox in a vbox
  -- Is there a better way to achieve this?
  -- How to do that with layers? 
 
 -- Is it possible to define and position layers in one Macro. I have 
 something like the following
in mind (untested): 
 
\define[1]\MLayer{
   \definelayer[#1]
   \setlayer[#1][state=start]{\externalfigure[#1]}
 }
 My experience so far is, that it's necessary for a layer to appear that 
 it is listed in pagebackgrounds
 ist this true? With this it seems, that a macro like that above is 
 impossible, true?

\define[1]\MLayer
  {\definelayer[#1]%
   \expandparameters\setupbackgrounds[page][background={\currentvalue,#1}]%
   
\setlayerframed[#1][width=\paperwidth,height=\paperheight,frame=off,align={middle,middle}]{\externalfigure[#1]}}

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
___