ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Repeat backgrounds on slides
@ 2020-02-13  8:19 juh
  2020-02-13 19:39 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: juh @ 2020-02-13  8:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1240 bytes --]

Hi all,

I am a little bit confused as I never had this problem, although I often use
backgrounds and layers.

\definelayer[bg:hs2020-mond]
[x=0, y=0, width=\paperwidth, height=\paperheight]

\setlayer[bg:hs2020-mond]
[x=0mm, y=0mm]
{\externalfigure[background.jpg][height=\paperwidth]}

Ususally I call the background after a head command like \starttitle or when I
create slides like this 

\startslide[title={foobar}]
\setupbackgrounds[page][background=bg:hs2020-mond]
...
\stopslide

The problem is that I cannot call the background on another slide.
It seems as if the layer is gone after the first usage.

So in this example the second bg:hs2020-mond would not print.

\startslide[title={foobar}]
\setupbackgrounds[page][background=bg:hs2020-mond]
...
\stopslide

\startslide[title={foobar}]
\setupbackgrounds[page][background=bg:other]
...
\stopslide

\startslide[title={foobar}]
\setupbackgrounds[page][background=bg:hs2020-mond]
...
\stopslide

TIA
juh

-- 
Autoren-Homepage: ......... http://literatur.hasecke.com
Satiren & Essays: ......... http://www.sudelbuch.de
Privater Blog: ............ http://www.hasecke.eu
Netzliteratur-Projekt: .... http://www.generationenprojekt.de



[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Repeat backgrounds on slides
  2020-02-13  8:19 Repeat backgrounds on slides juh
@ 2020-02-13 19:39 ` Wolfgang Schuster
  2020-02-14  8:10   ` Jan U. Hasecke
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2020-02-13 19:39 UTC (permalink / raw)
  To: ntg-context

On Thu, 13 Feb 2020 09:19:10 +0100
juh <juh+ntg-context@mailbox.org> wrote:

> Hi all,
> 
> I am a little bit confused as I never had this problem, although I often use
> backgrounds and layers.
> 
> \definelayer[bg:hs2020-mond]
> [x=0, y=0, width=\paperwidth, height=\paperheight]
> 
> \setlayer[bg:hs2020-mond]
> [x=0mm, y=0mm]
> {\externalfigure[background.jpg][height=\paperwidth]}
> 
> Ususally I call the background after a head command like \starttitle or when I
> create slides like this 
> 
> \startslide[title={foobar}]
> \setupbackgrounds[page][background=bg:hs2020-mond]
> ...
> \stopslide
> 
> The problem is that I cannot call the background on another slide.
> It seems as if the layer is gone after the first usage.


This is normal behaviour for layers but you can repeat it on every page with

    \definelayer [bg:...] [state=repeat]


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}]


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Repeat backgrounds on slides
  2020-02-13 19:39 ` Wolfgang Schuster
@ 2020-02-14  8:10   ` Jan U. Hasecke
  2020-02-14 18:53     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Jan U. Hasecke @ 2020-02-14  8:10 UTC (permalink / raw)
  To: ntg-context

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? Can I set the offset in
this way, too?

juh

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Repeat backgrounds on slides
  2020-02-14  8:10   ` Jan U. Hasecke
@ 2020-02-14 18:53     ` Wolfgang Schuster
  2020-02-15 13:56       ` Jan U. Hasecke
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2020-02-14 18:53 UTC (permalink / raw)
  To: ntg-context

On Fri, 14 Feb 2020 09:10:22 +0100
"Jan U. Hasecke" <juh+ntg-context@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
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Repeat backgrounds on slides
  2020-02-14 18:53     ` Wolfgang Schuster
@ 2020-02-15 13:56       ` Jan U. Hasecke
  0 siblings, 0 replies; 5+ messages in thread
From: Jan U. Hasecke @ 2020-02-15 13:56 UTC (permalink / raw)
  To: ntg-context

\structureuservariable – this is really cool.

Thanks a lot Wolfgang.
juh

Am 14.02.20 um 19:53 schrieb Wolfgang Schuster:
> \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

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2020-02-15 13:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13  8:19 Repeat backgrounds on slides juh
2020-02-13 19:39 ` Wolfgang Schuster
2020-02-14  8:10   ` Jan U. Hasecke
2020-02-14 18:53     ` Wolfgang Schuster
2020-02-15 13:56       ` Jan U. Hasecke

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