ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Page Backgrounds
Date: Mon, 9 Jul 2012 10:06:43 +0200	[thread overview]
Message-ID: <BF9C95FA-542D-4A48-86EA-3800581BA651@gmail.com> (raw)
In-Reply-To: <1341802025.6451.15.camel@kip-laptop>


Am 09.07.2012 um 04:47 schrieb Kip Warner:

> Hey list,
> 
> On the cover page of my book I'd like just an image displayed and
> another image used as the background for every other page in the book.
> So I put this in my environment,
> 
>    % Cover image...
>    \definelayer
>        [CoverImage]
>        [x=0mm, y=0mm,
>         \paperwidth, 
>         \paperheight]
>    \setupbackgrounds[page][background=CoverImage]
> 
>    \setlayer
>        [CoverImage]	% name of the layer
>        {\externalfigure
>            [Makeup/Images/Cover.jpg]
>            [align=center,
>             \paperwidth,
>             \paperheight]}  % the actual contents of the layer
> 
>    % Regular background image...
>    \definelayer
>        [BackgroundImage]
>        [x=0mm, y=0mm,
>         \paperwidth, 
>         \paperheight,
>         repeat=yes]
> 
>    \setlayer
>        [BackgroundImage]	% name of the layer
>        {\externalfigure
>            [Makeup/Images/Background.png]
>            [align=center,
>             \paperwidth,
>             \paperheight]}  % the actual contents of the layer
> 
> , the following in the book's first page,
> 
>    \setupbackgrounds[page][background=CoverImage]
> 
> , and the following on second page,
> 
>    \setupbackgrounds[page][background=BackgroundImage]
> 
> . But this does not work properly. What ends up happening is the cover
> image is displayed correctly, but every page after that just has a blank
> white background.

\setupexternalfigures[directory=Makeup/Images]

\defineoverlay
  [backgroundimage]
  [{\ifnum\rawcountervalue[userpage]=1\relax
      \overlayfigure{Cover}%
    \else
      \overlayfigure{Background}%
    \fi}]

\setupbackgrounds[page][background=backgroundimage]

\starttext
\dorecurse{4}{\input knuth\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
___________________________________________________________________________________


  parent reply	other threads:[~2012-07-09  8:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09  2:47 Kip Warner
2012-07-09  7:45 ` Hans Hagen
2012-07-09  8:06 ` Wolfgang Schuster [this message]
2012-07-10  0:28   ` Kip Warner
  -- strict thread matches above, loose matches on Subject: below --
2007-11-13 10:26 page backgrounds olivier Turlier
2007-11-13 15:52 ` Wolfgang Schuster
2007-11-13 18:12 ` Peter Rolf
2007-11-14 15:46   ` olivier Turlier
2003-11-17 15:11 Thomas A. Schmitz
2003-11-17 13:09 Thomas A. Schmitz
2003-11-17 14:03 ` Otared Kavian
2003-11-17 14:41   ` Patrick Gundlach
2003-11-17 14:43   ` Patrick Gundlach
2003-11-17 14:08 ` Patrick Gundlach
2003-11-03 21:05 reset \use[sub]path Hans Hagen
2003-11-15 21:36 ` page backgrounds Thomas A.Schmitz
2003-11-16 20:08   ` Thomas A.Schmitz
2003-11-17  9:59     ` Patrick Gundlach
2003-11-16 22:32   ` Patrick Gundlach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BF9C95FA-542D-4A48-86EA-3800581BA651@gmail.com \
    --to=schuster.wolfgang@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).