ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* missing btex ..etex in mp figure
@ 2008-05-15 23:42 luigi scarso
  2008-05-16  9:49 ` Taco Hoekwater
  0 siblings, 1 reply; 4+ messages in thread
From: luigi scarso @ 2008-05-15 23:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

In

\starttext
\startTEXpage
\startlua
metapost.process("metafun",{"beginfig(1);",
"a=.7in; b=0.5in;",
"z0=(0,0); z1=(a,0); z2=(0,b);",
"z0=.5[z1,z3]=.5[z2,z4];",
"draw z1..z2..z3..z4..cycle;",
"drawarrow z0..z1;",
"drawarrow z0..z2;",
"label.top(btex $a$ etex, .5[z0,z1]);",
"label.lft(btex $b$ etex, .5[z0,z2]);",
"endfig;"})
\stoplua
\stopTEXpage
\stoptext

there are no labels, but I believe that it's wrong.


-- 
luigi
it's new .
it's powerful .
it's luatex .
http://www.luatex.org
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: missing btex ..etex in mp figure
  2008-05-15 23:42 missing btex ..etex in mp figure luigi scarso
@ 2008-05-16  9:49 ` Taco Hoekwater
  2008-05-17 15:41   ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Taco Hoekwater @ 2008-05-16  9:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users



luigi scarso wrote:
> In
> 
> \starttext
> \startTEXpage
> \startlua
> metapost.process("metafun",{"beginfig(1);",
> "a=.7in; b=0.5in;",
> "z0=(0,0); z1=(a,0); z2=(0,b);",
> "z0=.5[z1,z3]=.5[z2,z4];",
> "draw z1..z2..z3..z4..cycle;",
> "drawarrow z0..z1;",
> "drawarrow z0..z2;",
> "label.top(btex $a$ etex, .5[z0,z1]);",
> "label.lft(btex $b$ etex, .5[z0,z2]);",
> "endfig;"})
> \stoplua
> \stopTEXpage
> \stoptext
> 
> there are no labels, but I believe that it's wrong.

The MPlib library embedded in luatex does not actually
support btex .. etex blocks.

It is planned to intercept such blocks in the mkiv lua
code, but for now, just use textext().

Best wishes,
Taco

___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: missing btex ..etex in mp figure
  2008-05-16  9:49 ` Taco Hoekwater
@ 2008-05-17 15:41   ` Hans Hagen
  2008-05-17 17:41     ` luigi scarso
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2008-05-17 15:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Taco Hoekwater wrote:
> 
> luigi scarso wrote:
>> In
>>
>> \starttext
>> \startTEXpage
>> \startlua
>> metapost.process("metafun",{"beginfig(1);",
>> "a=.7in; b=0.5in;",
>> "z0=(0,0); z1=(a,0); z2=(0,b);",
>> "z0=.5[z1,z3]=.5[z2,z4];",
>> "draw z1..z2..z3..z4..cycle;",
>> "drawarrow z0..z1;",
>> "drawarrow z0..z2;",
>> "label.top(btex $a$ etex, .5[z0,z1]);",
>> "label.lft(btex $b$ etex, .5[z0,z2]);",
>> "endfig;"})
>> \stoplua
>> \stopTEXpage
>> \stoptext
>>
>> there are no labels, but I believe that it's wrong.
> 
> The MPlib library embedded in luatex does not actually
> support btex .. etex blocks.
> 
> It is planned to intercept such blocks in the mkiv lua
> code, but for now, just use textext().

why not use

\starttext
\startMPpage
a=.7in; b=0.5in;
z0=(0,0); z1=(a,0); z2=(0,b);
z0=.5[z1,z3]=.5[z2,z4];
draw z1..z2..z3..z4..cycle;
drawarrow z0..z1;
drawarrow z0..z2;
label.top(btex $a$ etex, .5[z0,z1]);
label.lft(btex $b$ etex, .5[z0,z2]);
endfig;
\stopMPpage
\stoptext

this uses:

metapost.graphic(mpsformat,str,preamble)

which does intercept the btex/etex


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: missing btex ..etex in mp figure
  2008-05-17 15:41   ` Hans Hagen
@ 2008-05-17 17:41     ` luigi scarso
  0 siblings, 0 replies; 4+ messages in thread
From: luigi scarso @ 2008-05-17 17:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Ok.
In next example, f>0 is hide


\starttext
\startTEXpage\startMPcode
%beginfig(2);

h=2in; w=2.7in;
path p[], q[], pp;
for i=1.5,2,4:
  ii := i**2;
  p[i] = (w/ii,h){1/ii,-1}...(w/i,h/i)...(w,h/ii){1,-1/ii};
endfor
for i=.5,1.5:
  q[i] = origin..(w,i*h) cutafter p1.5;
endfor

pp = buildcycle(q0.5, p2, q1.5, p4);

fill pp withcolor .8white;
z0=center pp;
picture lab; lab=thelabel(btex $f>0$ etex, z0);
unfill bbox lab; draw lab;
draw q0.5; draw p2; draw q1.5; draw p4;
makelabel.top(btex $P$ etex, p2 intersectionpoint q0.5);
makelabel.rt(btex $Q$ etex, p2 intersectionpoint q1.5);
%endfig;
\stopMPcode\stopTEXpage
\stoptext

-- 
luigi
it's new .
it's powerful .
it's luatex .
http://www.luatex.org
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2008-05-17 17:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-15 23:42 missing btex ..etex in mp figure luigi scarso
2008-05-16  9:49 ` Taco Hoekwater
2008-05-17 15:41   ` Hans Hagen
2008-05-17 17:41     ` luigi scarso

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