[NTG-context] presets for setlayerframed

Wolfgang Schuster schuster.wolfgang at gmail.com
Mon Apr 6 11:05:45 CEST 2015


> Am 06.04.2015 um 01:29 schrieb Aditya Mahajan <adityam at umich.edu>:
> 
> Hi,
> 
> Is it possible to set 'presets' for the framed settings of \setlayerframed?
> 
> For example:
> 
> \definelayer[text]
> \definelayer[annotate]
> \setupbackgrounds[text][background={text,foreground,annotate}]
> 
> \starttext
> 
> Testing layers:
> 
> \setlayerframed[annotate][x=1cm,y=1cm][frame=off, align=middle]
>    {\input ward \par}
> 
> \setlayerframed[annotate][x=1cm,y=4cm][frame=off, align=middle]
>    {\input tufte \par}
> 
> \stoptext
> 
> I don't want to repeat the `frame=off, align=middle` setting everytime (in may actual usecase, these are much more complicated settings). How can I do that?


Use \setlayer and create your own \framed command.

\definelayer[text]
\definelayer[annotate]
\setupbackgrounds[text][background={text,foreground,annotate}]

\defineframed[LayerFrame][frame=off,align=middle]

\starttext

Testing layers:

\setlayer[annotate][x=1cm,y=1cm]
   {\LayerFrame{\input ward \par}}

\setlayer[annotate][x=1cm,y=4cm]
   {\LayerFrame{\input tufte \par}}

\stoptext

Wolfgang


More information about the ntg-context mailing list