ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Mikael P. Sundqvist" <mickep@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: recalculate background on every page with \uniqueMPgraphic?
Date: Fri, 15 Feb 2013 14:59:18 +0100	[thread overview]
Message-ID: <CAHy-LL8f0J1ZgsBYCu1L0tQs5cfDEX8Nc18BQSqOP-BEnjJvLg@mail.gmail.com> (raw)

Dear list,

with the (almost minimal) example below, I hoped that the frame would
be recalculated at every page. But it is not (they all look the same
in my output pdf). How can I force the frame to be redrawn at every
page?

Btw, If I change the uniqueMPgraphic to useMPgraphic (everywhere) my
file does not compile anymore. I get some lua error.

/Mikael

\setuppapersize[S6][S6]

\setuplayout[
width=fit,
height=fit,
margin=1pt,
topspace=0.5cm,
headerdistance=0.3cm,
footerdistance=0.5cm,
footer=14pt,
backspace=1.5cm,
location=middle,
]

\startuniqueMPgraphic{figram}
path q;
rr:=7mm;
StartPage;
q := lrcorner Field[RightMargin][Header] --
     llcorner Field[LeftMargin][Header] --
     ulcorner Field[LeftMargin][Footer] --
     urcorner Field[RightMargin][Footer] -- cycle;

draw q withcolor 0.7white;
draw (urcorner q)--((urcorner q) xshifted 1bp+(uniformdeviate rr))
withcolor .7white;
draw (urcorner q)--((urcorner q) yshifted 1bp+(uniformdeviate rr))
withcolor .7white;
draw (ulcorner q)--((ulcorner q) xshifted -1bp-(uniformdeviate rr))
withcolor .7white;
draw (ulcorner q)--((ulcorner q) yshifted 1bp+(uniformdeviate rr))
withcolor .7white;
draw (llcorner q)--((llcorner q) xshifted -1bp-(uniformdeviate rr))
withcolor .7white;
draw (llcorner q)--((llcorner q) yshifted -1bp-(uniformdeviate rr))
withcolor .7white;
draw (lrcorner q)--((lrcorner q) xshifted 1bp+(uniformdeviate rr))
withcolor .7white;
draw (lrcorner q)--((lrcorner q) yshifted -1bp-(uniformdeviate rr))
withcolor .7white;
StopPage;
\stopuniqueMPgraphic

\defineoverlay[figram][\uniqueMPgraphic{figram}]
\setupbackgrounds[page][background=figram]

\starttext
\dorecurse{10}{\input knuth}
\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


             reply	other threads:[~2013-02-15 13:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15 13:59 Mikael P. Sundqvist [this message]
2013-02-15 15:02 ` Marco Patzer
2013-02-18  9:25   ` Mikael P. Sundqvist
2013-02-18  9:53     ` Marco Patzer
2013-02-26 15:46       ` Mikael P. Sundqvist
2013-02-26 20:39         ` Hans Hagen
2013-02-26 20:59           ` Marco Patzer
2013-02-26 21:01         ` Marco Patzer
2013-03-04 12:14           ` Mikael P. Sundqvist

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=CAHy-LL8f0J1ZgsBYCu1L0tQs5cfDEX8Nc18BQSqOP-BEnjJvLg@mail.gmail.com \
    --to=mickep@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).