[NTG-context] Repeat backgrounds on slides

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Fri Feb 14 19:53:43 CET 2020


On Fri, 14 Feb 2020 09:10:22 +0100
"Jan U. Hasecke" <juh+ntg-context at mailbox.org> wrote:

> Am 13.02.20 um 20:39 schrieb Wolfgang Schuster:
> 
> > 
> > This is normal behaviour for layers but you can repeat it on every page with
> > 
> >     \definelayer [bg:...] [state=repeat]
> 
> Thanks. There was a dark idea of this in the back of my brain.
> 
> > 
> > In your case a simple overlay is the simpler solution to get repeated images on every page, i.e.
> > 
> >   \defineoverlay [bg:hs2020-mond] [{\externalfigure[background.jpg][height=\paperheight]}]
> > 
> > or
> > 
> >   \defineoverlay [bg:hs2020-mond] [\overlayfigure{background.jpg}]
> 
> Is this defining and setting in one command?

You can also pass a variable as argument in the second argument,
e.g. in the following example I set the background image with
the start of each new slide.

\setupexternalfigures[location=default]

\defineoverlay
  [SlideBackground]
  [\doifsomething
     {\structureuservariable{background}}
     {\externalfigure[\structureuservariable{background}][factor=max]}]

\setuppapersize[S6]
\setupbackgrounds[page][background=SlideBackground]

%\setuppapersize[S6][S6,oversized]
%\setupbackgrounds[paper][background=SlideBackground]
%\setuplayout[location=middle]

\definehead[Slide][chapter]

\starttext

\startSlide[title=Cow][background=cow]
\dorecurse{3}{\dontleavehmode\page}
\stopSlide

\startSlide[title=Hacker][background=hacker]
\dorecurse{3}{\dontleavehmode\page}
\stopSlide

\stoptext

> Can I set the offset in this way, too?

It depends on your requirements, to get equal bleed on all
four sides you can just increase the width/height of the image
with the offset value.

Wolfgang


More information about the ntg-context mailing list