ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \setupMPvariables in \startMPpage
@ 2005-12-26 21:26 David Arnold
  2005-12-26 23:01 ` Willi Egger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Arnold @ 2005-12-26 21:26 UTC (permalink / raw)



All,

Why doesn't this work?

%output=pdf

\startuseMPgraphic{usquare}
   draw unitsquare scaled 4cm;
\stopuseMPgraphic

\starttext

\startMPpage
\useMPgraphic{square}
\stopMPpage

\stoptext


Why doesn't this work?

%output=pdf

\startuseMPgraphic{usquare}
   draw unitsquare scaled \MPvar{u};
\stopuseMPgraphic

\starttext

\startMPpage
\setupMPvariables[usquare][u=4cm]
\includeMPgraphic{usquare}
\stopMPpage

\stoptext

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

* Re: \setupMPvariables in \startMPpage
  2005-12-26 21:26 \setupMPvariables in \startMPpage David Arnold
@ 2005-12-26 23:01 ` Willi Egger
  2005-12-27 20:55 ` Hans Hagen
  2005-12-27 20:58 ` Hans Hagen
  2 siblings, 0 replies; 4+ messages in thread
From: Willi Egger @ 2005-12-26 23:01 UTC (permalink / raw)


Hi David,

without digging into depth, it works if you change MPpage into TEXpage

Willi

David Arnold wrote:

>
> All,
>
> Why doesn't this work?
>
> %output=pdf
>
> \startuseMPgraphic{usquare}
>   draw unitsquare scaled 4cm;
> \stopuseMPgraphic
>
> \starttext
>
> \startMPpage
> \useMPgraphic{square}
> \stopMPpage
>
> \stoptext
>
>
> Why doesn't this work?
>
> %output=pdf
>
> \startuseMPgraphic{usquare}
>   draw unitsquare scaled \MPvar{u};
> \stopuseMPgraphic
>
> \starttext
>
> \startMPpage
> \setupMPvariables[usquare][u=4cm]
> \includeMPgraphic{usquare}
> \stopMPpage
>
> \stoptext
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: \setupMPvariables in \startMPpage
  2005-12-26 21:26 \setupMPvariables in \startMPpage David Arnold
  2005-12-26 23:01 ` Willi Egger
@ 2005-12-27 20:55 ` Hans Hagen
  2005-12-27 20:58 ` Hans Hagen
  2 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2005-12-27 20:55 UTC (permalink / raw)


David Arnold wrote:

>
> All,
>
> Why doesn't this work?
>
> %output=pdf
>
> \startuseMPgraphic{usquare}
>   draw unitsquare scaled 4cm;
> \stopuseMPgraphic
>
> \starttext
>
> \startMPpage
> \useMPgraphic{square}
> \stopMPpage
>
> \stoptext
>
because you nest a graphic, kind of

beginfig(1) beginfig(2) draw unitsquare scaled 4cm; endfig ; endfig ;

Hans

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

* Re: \setupMPvariables in \startMPpage
  2005-12-26 21:26 \setupMPvariables in \startMPpage David Arnold
  2005-12-26 23:01 ` Willi Egger
  2005-12-27 20:55 ` Hans Hagen
@ 2005-12-27 20:58 ` Hans Hagen
  2 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2005-12-27 20:58 UTC (permalink / raw)


David Arnold wrote:

> Why doesn't this work?
>
> %output=pdf
>
> \startuseMPgraphic{usquare}
>   draw unitsquare scaled \MPvar{u};
> \stopuseMPgraphic
>
> \starttext
>
> \startMPpage
> \setupMPvariables[usquare][u=4cm]
> \includeMPgraphic{usquare}
> \stopMPpage
>
> \stoptext

because

(1) after startMPpage metapost code is expected (or something like 
\includeMPgraphic{...} that expands to mp code
(2) when the setup is moved outside the startMPpage, contex does not 
know what vars to preset

however, this works (MPrawvar is undocumented, yet)

\startuseMPgraphic{usquare}
  draw unitsquare scaled \MPrawvar{usquare}{u};
\stopuseMPgraphic

\starttext

\setupMPvariables[usquare][u=4cm]

\startMPpage
\includeMPgraphic{usquare}
\stopMPpage

\stoptext

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

end of thread, other threads:[~2005-12-27 20:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-26 21:26 \setupMPvariables in \startMPpage David Arnold
2005-12-26 23:01 ` Willi Egger
2005-12-27 20:55 ` Hans Hagen
2005-12-27 20:58 ` Hans Hagen

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