ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* "externalfigure" vs. "draw externalfigure" in metafun
@ 2011-09-16 14:00 Mojca Miklavec
  2011-09-16 14:13 ` Andreas Schneider
  2011-09-17  9:11 ` Nicola
  0 siblings, 2 replies; 7+ messages in thread
From: Mojca Miklavec @ 2011-09-16 14:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear Hans,

I have problems with externalfigure inside metapost.

In MKII, only
    externalfigure "something.png";
works, while in MKIV only
    draw externalfigure "something.png";
is accepted.

Is there any chance to accept one of the syntaxes in both flavours?

Thank you,
   Mojca

Minimal example:

\starttext
\startMPpage
% only good for MKII
externalfigure "abc.png" xyscaled (5cm,8cm);
% only good for MKIV
% draw externalfigure "abc.png" xyscaled (5cm,8cm);
\stopMPpage
\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] 7+ messages in thread

* Re: "externalfigure" vs. "draw externalfigure" in metafun
  2011-09-16 14:00 "externalfigure" vs. "draw externalfigure" in metafun Mojca Miklavec
@ 2011-09-16 14:13 ` Andreas Schneider
  2011-09-17  9:11 ` Nicola
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Schneider @ 2011-09-16 14:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 16.09.2011 16:00, Mojca Miklavec wrote:
> Dear Hans,
>
> I have problems with externalfigure inside metapost.
>
> In MKII, only
>      externalfigure "something.png";
> works, while in MKIV only
>      draw externalfigure "something.png";
> is accepted.
>
> Is there any chance to accept one of the syntaxes in both flavours?

Hmm, I noticed that too. However I'm sure that plain "externalfigure" 
used to work in MkIV too, so I guess the change happened (more or less) 
recently.


-- 
Best Regards,
Andreas
___________________________________________________________________________________
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] 7+ messages in thread

* Re: "externalfigure" vs. "draw externalfigure" in metafun
  2011-09-16 14:00 "externalfigure" vs. "draw externalfigure" in metafun Mojca Miklavec
  2011-09-16 14:13 ` Andreas Schneider
@ 2011-09-17  9:11 ` Nicola
  2011-09-17  9:20   ` Nicola
  2011-09-17  9:32   ` Mojca Miklavec
  1 sibling, 2 replies; 7+ messages in thread
From: Nicola @ 2011-09-17  9:11 UTC (permalink / raw)
  To: ntg-context

In article 
<CALBOmsadxdYX8Q9pmVa2_cpM3RQ8j1MXKEPQGNaSJtAFUhc2OQ@mail.gmail.com>,
 Mojca Miklavec <mojca.miklavec.lists@gmail.com> wrote:

> Dear Hans,
> 
> I have problems with externalfigure inside metapost.
> 
> In MKII, only
>     externalfigure "something.png";
> works, while in MKIV only
>     draw externalfigure "something.png";
> is accepted.
> 
> Is there any chance to accept one of the syntaxes in both flavours?
> 
> Thank you,
>    Mojca
> 
> Minimal example:
> 
> \starttext
> \startMPpage
> % only good for MKII
> externalfigure "abc.png" xyscaled (5cm,8cm);
> % only good for MKIV
> % draw externalfigure "abc.png" xyscaled (5cm,8cm);
> \stopMPpage
> \stoptext

Does the following workaround work for you?

def mydraw text t =
   def f = begingroup t endgroup enddef;
   if picture f : draw f ; fi
enddef;
mydraw externalfigure "abc.png" xyscaled (5cm,8cm);

Nicola

___________________________________________________________________________________
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] 7+ messages in thread

* Re: "externalfigure" vs. "draw externalfigure" in metafun
  2011-09-17  9:11 ` Nicola
@ 2011-09-17  9:20   ` Nicola
  2011-09-17  9:32   ` Mojca Miklavec
  1 sibling, 0 replies; 7+ messages in thread
From: Nicola @ 2011-09-17  9:20 UTC (permalink / raw)
  To: ntg-context

In article <nvitacolonna-9462E1.11114817092011@news.gmane.org>,
 Nicola <nvitacolonna@gmail.com> wrote:
 
> Does the following workaround work for you?
> 
> def mydraw text t =
>    def f = begingroup t endgroup enddef;
>    if picture f : draw f ; fi
> enddef;
> mydraw externalfigure "abc.png" xyscaled (5cm,8cm);

This may be better:

def mydraw text t =  _mydraw begingroup t endgroup enddef;
def _mydraw primary f = if picture f : draw f ; fi enddef;
mydraw externalfigure "abc.png" xyscaled (5cm,8cm);

Nicola

___________________________________________________________________________________
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] 7+ messages in thread

* Re: "externalfigure" vs. "draw externalfigure" in metafun
  2011-09-17  9:11 ` Nicola
  2011-09-17  9:20   ` Nicola
@ 2011-09-17  9:32   ` Mojca Miklavec
  2011-09-17  9:50     ` Hans Hagen
  2011-09-17 12:22     ` Nicola
  1 sibling, 2 replies; 7+ messages in thread
From: Mojca Miklavec @ 2011-09-17  9:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, Sep 17, 2011 at 11:11, Nicola wrote:
>
> Does the following workaround work for you?

If Hans is willing to fix metafun, I would prefer to avoid workarounds.
(I don't care which syntax is used, but I would be grateful if the
same syntax worked in both mkii and mkiv.)

Since you seem to be a metapost expert: do you have any idea what
exactly would have to be fixed in ConTeXt core code?

If ConTeXt won't be fixed for whatever reason, I will write a wrapper
function using your code, but I would like to avoid that.

Hans?

Mojca
___________________________________________________________________________________
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] 7+ messages in thread

* Re: "externalfigure" vs. "draw externalfigure" in metafun
  2011-09-17  9:32   ` Mojca Miklavec
@ 2011-09-17  9:50     ` Hans Hagen
  2011-09-17 12:22     ` Nicola
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2011-09-17  9:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mojca Miklavec

On 17-9-2011 11:32, Mojca Miklavec wrote:

> Hans?

is in "too busy mode" currently .. more later (but the metafun mkiv way 
is conceptually more ok so we might need to change metafun mkii)

Hans


-----------------------------------------------------------------
                                           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] 7+ messages in thread

* Re: "externalfigure" vs. "draw externalfigure" in metafun
  2011-09-17  9:32   ` Mojca Miklavec
  2011-09-17  9:50     ` Hans Hagen
@ 2011-09-17 12:22     ` Nicola
  1 sibling, 0 replies; 7+ messages in thread
From: Nicola @ 2011-09-17 12:22 UTC (permalink / raw)
  To: ntg-context

In article 
<CALBOmsbm2tHsUp+KzJLKFd8PbA2bBT7jvf-BvRWKRkz3+WBO7A@mail.gmail.com>,
 Mojca Miklavec <mojca.miklavec.lists@gmail.com> wrote:

> do you have any idea what
> exactly would have to be fixed in ConTeXt core code?

Edit mp-spec.mp and change the line

  draw p withcolor ...

with

  image(draw p withcolor ...)

The line is in the body of the doexternalfigure macro. Then, 'draw 
externalfigure ...' should work in mkii, too.

Note: knowledge of ConTeXt internals - which I don't have - is needed to be sure 
that the patch doesn't break anything. Hence, the above is to be considered as a 
wild guess of mine.

Nicola

___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2011-09-17 12:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-16 14:00 "externalfigure" vs. "draw externalfigure" in metafun Mojca Miklavec
2011-09-16 14:13 ` Andreas Schneider
2011-09-17  9:11 ` Nicola
2011-09-17  9:20   ` Nicola
2011-09-17  9:32   ` Mojca Miklavec
2011-09-17  9:50     ` Hans Hagen
2011-09-17 12:22     ` Nicola

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