ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* recalculate background on every page with \uniqueMPgraphic?
@ 2013-02-15 13:59 Mikael P. Sundqvist
  2013-02-15 15:02 ` Marco Patzer
  0 siblings, 1 reply; 9+ messages in thread
From: Mikael P. Sundqvist @ 2013-02-15 13:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: recalculate background on every page with \uniqueMPgraphic?
  2013-02-15 13:59 recalculate background on every page with \uniqueMPgraphic? Mikael P. Sundqvist
@ 2013-02-15 15:02 ` Marco Patzer
  2013-02-18  9:25   ` Mikael P. Sundqvist
  0 siblings, 1 reply; 9+ messages in thread
From: Marco Patzer @ 2013-02-15 15:02 UTC (permalink / raw)
  To: ntg-context


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

On 2013–02–15 Mikael P. Sundqvist wrote:

> with the (almost minimal) example below,

I reduced your minimal example slightly further:

\startuseMPgraphic{figram}
  StartPage; fill Field[Text][Text]; StopPage;
\stopuseMPgraphic

\starttext
  \useMPgraphic{figram}
  
  %% using the graphic a second time fails
  %% \useMPgraphic{figram}
\stoptext

> I hoped that the frame would be recalculated at every page.

That's not how uniqueMPgraphics work.


Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: recalculate background on every page with \uniqueMPgraphic?
  2013-02-15 15:02 ` Marco Patzer
@ 2013-02-18  9:25   ` Mikael P. Sundqvist
  2013-02-18  9:53     ` Marco Patzer
  0 siblings, 1 reply; 9+ messages in thread
From: Mikael P. Sundqvist @ 2013-02-18  9:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Feb 15, 2013 at 4:02 PM, Marco Patzer <homerow@lavabit.com> wrote:
> On 2013–02–15 Mikael P. Sundqvist wrote:
>
>> with the (almost minimal) example below,
>
> I reduced your minimal example slightly further:
>
> \startuseMPgraphic{figram}
>   StartPage; fill Field[Text][Text]; StopPage;
> \stopuseMPgraphic
>
> \starttext
>   \useMPgraphic{figram}
>
>   %% using the graphic a second time fails
>   %% \useMPgraphic{figram}
> \stoptext
>
>> I hoped that the frame would be recalculated at every page.
>
> That's not how uniqueMPgraphics work.
>
>
> Marco
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

Thank you Marco for giving a better example.

I thought that uniqueMPgraphic meant it was redrawn everytime while
useMPgraphic meant it was done once and then gave the same result
everytime used. I probably misunderstood something in the MetaFun
manual.

In any case: Is there a way to get different frames for every page in
a random way?

/Mikael
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: recalculate background on every page with \uniqueMPgraphic?
  2013-02-18  9:25   ` Mikael P. Sundqvist
@ 2013-02-18  9:53     ` Marco Patzer
  2013-02-26 15:46       ` Mikael P. Sundqvist
  0 siblings, 1 reply; 9+ messages in thread
From: Marco Patzer @ 2013-02-18  9:53 UTC (permalink / raw)
  To: ntg-context


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

On 2013–02–18 Mikael P. Sundqvist wrote:

> Thank you Marco for giving a better example.
> 
> I thought that uniqueMPgraphic meant it was redrawn everytime while
> useMPgraphic meant it was done once and then gave the same result
> everytime used.

http://thread.gmane.org/gmane.comp.tex.context/79507/focus=79538

> In any case: Is there a way to get different frames for every page in
> a random way?

Using \startuseMPgraphic is the correct way, since you want the
graphic  to be recalculated every time. I have no clue why this
fails at the moment. It works fine in older versions, so I assume
it's a bug.


Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: recalculate background on every page with \uniqueMPgraphic?
  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 21:01         ` Marco Patzer
  0 siblings, 2 replies; 9+ messages in thread
From: Mikael P. Sundqvist @ 2013-02-26 15:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, Feb 18, 2013 at 10:53 AM, Marco Patzer <homerow@lavabit.com> wrote:
> On 2013–02–18 Mikael P. Sundqvist wrote:
>
>> Thank you Marco for giving a better example.
>>
>> I thought that uniqueMPgraphic meant it was redrawn everytime while
>> useMPgraphic meant it was done once and then gave the same result
>> everytime used.
>
> http://thread.gmane.org/gmane.comp.tex.context/79507/focus=79538
>
>> In any case: Is there a way to get different frames for every page in
>> a random way?
>
> Using \startuseMPgraphic is the correct way, since you want the
> graphic  to be recalculated every time. I have no clue why this
> fails at the moment. It works fine in older versions, so I assume
> it's a bug.
>
>
> Marco
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

Ok, thank you Marco.

Hans, is this a bug? Has something changed?

/Mikael
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: recalculate background on every page with \uniqueMPgraphic?
  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
  1 sibling, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2013-02-26 20:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mikael P. Sundqvist

On 2/26/2013 4:46 PM, Mikael P. Sundqvist wrote:
> On Mon, Feb 18, 2013 at 10:53 AM, Marco Patzer <homerow@lavabit.com> wrote:
>> On 2013–02–18 Mikael P. Sundqvist wrote:
>>
>>> Thank you Marco for giving a better example.
>>>
>>> I thought that uniqueMPgraphic meant it was redrawn everytime while
>>> useMPgraphic meant it was done once and then gave the same result
>>> everytime used.

it's reused *when possible* depending on some characteristics (like 
width and height)

>> http://thread.gmane.org/gmane.comp.tex.context/79507/focus=79538
>>
>>> In any case: Is there a way to get different frames for every page in
>>> a random way?
>>
>> Using \startuseMPgraphic is the correct way, since you want the
>> graphic  to be recalculated every time. I have no clue why this
>> fails at the moment. It works fine in older versions, so I assume
>> it's a bug.
>>
>>
>> Marco
>>
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
>
> Ok, thank you Marco.
>
> Hans, is this a bug? Has something changed?

I don't know .. no example

> /Mikael
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: recalculate background on every page with \uniqueMPgraphic?
  2013-02-26 20:39         ` Hans Hagen
@ 2013-02-26 20:59           ` Marco Patzer
  0 siblings, 0 replies; 9+ messages in thread
From: Marco Patzer @ 2013-02-26 20:59 UTC (permalink / raw)
  To: ntg-context


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

On 2013–02–26 Hans Hagen wrote:

> >Hans, is this a bug? Has something changed?
> 
> I don't know .. no example

I provided an example in

  http://www.ntg.nl/pipermail/ntg-context/2013/071552.html

However, it seems to be fixed in a recent beta. At least it works
for me.

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: recalculate background on every page with \uniqueMPgraphic?
  2013-02-26 15:46       ` Mikael P. Sundqvist
  2013-02-26 20:39         ` Hans Hagen
@ 2013-02-26 21:01         ` Marco Patzer
  2013-03-04 12:14           ` Mikael P. Sundqvist
  1 sibling, 1 reply; 9+ messages in thread
From: Marco Patzer @ 2013-02-26 21:01 UTC (permalink / raw)
  To: ntg-context


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

Hi Mikael,

your original example works for me with a current beta if you
replace uniqueMPgraphic with useMPgraphic.


Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: recalculate background on every page with \uniqueMPgraphic?
  2013-02-26 21:01         ` Marco Patzer
@ 2013-03-04 12:14           ` Mikael P. Sundqvist
  0 siblings, 0 replies; 9+ messages in thread
From: Mikael P. Sundqvist @ 2013-03-04 12:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Feb 26, 2013 at 10:01 PM, Marco Patzer <homerow@lavabit.com> wrote:
> Hi Mikael,
>
> your original example works for me with a current beta if you
> replace uniqueMPgraphic with useMPgraphic.
>
>
> Marco
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

Thanks, it works here aswell with useMPgraphic now with latest beta.

/Mikael
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2013-03-04 12:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-15 13:59 recalculate background on every page with \uniqueMPgraphic? Mikael P. Sundqvist
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

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