ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Trouble making basic MetaPost graphics using ConTeXt Minimals
@ 2011-07-15  0:59 Kevin D. Robbins
  2011-07-15  1:04 ` luigi scarso
  2011-07-15  7:13 ` Mojca Miklavec
  0 siblings, 2 replies; 10+ messages in thread
From: Kevin D. Robbins @ 2011-07-15  0:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Using a fresh install of ConTeXt Minimals today (ConTeXt version
2011.07.14 16:09, luatex version beta-0.70.1-2011051918) I am trying
to build the following MetaPost graphics:

---8<--- file: test.mp
fontmapfile "=lm-math.map" ;

beginfig(1)
  draw fullcircle scaled 3cm ;
endfig ;

beginfig(2) ;
  fill fullcircle scaled 5cm withcolor red ;
endfig ;

beginfig(3);
  numeric u;
  u = 1cm;
  draw (0,2u)--(0,0)--(4u,0);
  pickup pencircle scaled 1pt;
  draw (0,0){up}
    for i=1 upto 8: ..(i/2,sqrt(i/2))*u endfor;
  label.lrt(btex $\sqrt x$ etex, (3,sqrt 3)*u);
  label.bot(btex $x$ etex, (2u,0));
  label.lft(btex $y$ etex, (0,u));
endfig;

end .
---8<---

Building the file using "mpost test.mp" I get the following:

This is MetaPost, version 1.504 (kpathsea version 6.0.0)
(mpost.mp (/opt/tools/ConTeXt/beta/tex/texmf/metapost/base/plain.mp
Preloading the plain mem file, version 1.004))
(./test.mp{pdftex.map}{lm-math.map} [1]
[2]/opt/tools/ConTeXt/beta/tex/texmf-context/scripts/context/ruby/base/switch.rb:570:in
`locateseries': undefined method `each' for "tex":String
(NoMethodError)
	from /opt/tools/ConTeXt/beta/tex/texmf-context/scripts/context/ruby/base/switch.rb:397:in
`block in expand'
	from /opt/tools/ConTeXt/beta/tex/texmf-context/scripts/context/ruby/base/switch.rb:392:in
`each'
	from /opt/tools/ConTeXt/beta/tex/texmf-context/scripts/context/ruby/base/switch.rb:392:in
`expand'
	from /opt/tools/ConTeXt/beta/tex/texmf-context/scripts/context/ruby/texexec.rb:789:in
`<main>'


>> test.mp
>> test.mpx
! Unable to make mpx file.
l.18   label.lrt(btex
                      $\sqrt x$ etex, (3,sqrt 3)*u);
2 output files written: test.1 .. test.2

The first two graphics are produced correctly, but there is no output
for the third graphic with the labels.

Building the file using "texexec --mptex test.mp" all three graphics
are produced, but the label $\sqrt x$ does not produce the square root
symbol.

Am I doing something obviously wrong? Can anyone reproduce this?

Thanks,

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

* Re: Trouble making basic MetaPost graphics using ConTeXt Minimals
  2011-07-15  0:59 Trouble making basic MetaPost graphics using ConTeXt Minimals Kevin D. Robbins
@ 2011-07-15  1:04 ` luigi scarso
  2011-07-15  7:44   ` Hans Hagen
  2011-07-15 16:24   ` Kevin D. Robbins
  2011-07-15  7:13 ` Mojca Miklavec
  1 sibling, 2 replies; 10+ messages in thread
From: luigi scarso @ 2011-07-15  1:04 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Jul 15, 2011 at 2:59 AM, Kevin D. Robbins
<krobbins@alumni.princeton.edu> wrote:
> Using a fresh install of ConTeXt Minimals today (ConTeXt version
> 2011.07.14 16:09, luatex version beta-0.70.1-2011051918) I am trying
> to build the following MetaPost graphics:
>
> ---8<--- file: test.mp
> fontmapfile "=lm-math.map" ;
>
> beginfig(1)
>  draw fullcircle scaled 3cm ;
> endfig ;
>
> beginfig(2) ;
>  fill fullcircle scaled 5cm withcolor red ;
> endfig ;
>
> beginfig(3);
>  numeric u;
>  u = 1cm;
>  draw (0,2u)--(0,0)--(4u,0);
>  pickup pencircle scaled 1pt;
>  draw (0,0){up}
>    for i=1 upto 8: ..(i/2,sqrt(i/2))*u endfor;
>  label.lrt(btex $\sqrt x$ etex, (3,sqrt 3)*u);
>  label.bot(btex $x$ etex, (2u,0));
>  label.lft(btex $y$ etex, (0,u));
> endfig;
>
> end .
> ---8<---
>
> Building the file using "mpost test.mp" I get the following:
>
> This is MetaPost, version 1.504 (kpathsea version 6.0.0)
> (mpost.mp (/opt/tools/ConTeXt/beta/tex/texmf/metapost/base/plain.mp
> Preloading the plain mem file, version 1.004))
> (./test.mp{pdftex.map}{lm-math.map} [1]
> [2]/opt/tools/ConTeXt/beta/tex/texmf-context/scripts/context/ruby/base/switch.rb:570:in
> `locateseries': undefined method `each' for "tex":String
> (NoMethodError)
>        from /opt/tools/ConTeXt/beta/tex/texmf-context/scripts/context/ruby/base/switch.rb:397:in
> `block in expand'
>        from /opt/tools/ConTeXt/beta/tex/texmf-context/scripts/context/ruby/base/switch.rb:392:in
> `each'
>        from /opt/tools/ConTeXt/beta/tex/texmf-context/scripts/context/ruby/base/switch.rb:392:in
> `expand'
>        from /opt/tools/ConTeXt/beta/tex/texmf-context/scripts/context/ruby/texexec.rb:789:in
> `<main>'
>
>
>>> test.mp
>>> test.mpx
> ! Unable to make mpx file.
> l.18   label.lrt(btex
>                      $\sqrt x$ etex, (3,sqrt 3)*u);
> 2 output files written: test.1 .. test.2
>
> The first two graphics are produced correctly, but there is no output
> for the third graphic with the labels.
>
> Building the file using "texexec --mptex test.mp" all three graphics
> are produced, but the label $\sqrt x$ does not produce the square root
> symbol.
>
> Am I doing something obviously wrong? Can anyone reproduce this?
>
> Thanks,
>
> Kevin
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>
This is one of the preferrred way to deal with metapost in mkiv
\starttext
\startMPpage
numeric u;
 u = 1cm;
 draw (0,2u)--(0,0)--(4u,0);
 pickup pencircle scaled 1pt;
 draw (0,0){up}
   for i=1 upto 8: ..(i/2,sqrt(i/2))*u endfor;
 label.lrt(btex $\sqrt x$ etex, (3,sqrt 3)*u);
 label.bot(btex $x$ etex, (2u,0));
 label.lft(btex $y$ etex, (0,u));
\stopMPpage
\stoptext

It's ok with latest minimals
-- 
luigi
___________________________________________________________________________________
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] 10+ messages in thread

* Re: Trouble making basic MetaPost graphics using ConTeXt Minimals
  2011-07-15  0:59 Trouble making basic MetaPost graphics using ConTeXt Minimals Kevin D. Robbins
  2011-07-15  1:04 ` luigi scarso
@ 2011-07-15  7:13 ` Mojca Miklavec
  2011-07-15  7:42   ` Hans Hagen
  2011-07-15 16:28   ` Kevin D. Robbins
  1 sibling, 2 replies; 10+ messages in thread
From: Mojca Miklavec @ 2011-07-15  7:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I'm not able to reproduce the problem, but there is one weird thing
(unrelated to your problem):

The original file "test.mp" is copied to "test.mp.keep" and a new file
"test.mp" is created with a newer timestamp and two additional blank
lines at the end.

So repeating the compilation hundred times leads me to a file with 200
blank lines at the end and I cannot recover the original file back (in
each run the .keep file is overwritten).

Hans - would it be possible to fix that please?

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

* Re: Trouble making basic MetaPost graphics using ConTeXt Minimals
  2011-07-15  7:13 ` Mojca Miklavec
@ 2011-07-15  7:42   ` Hans Hagen
  2011-07-15 16:28   ` Kevin D. Robbins
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2011-07-15  7:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mojca Miklavec

On 15-7-2011 9:13, Mojca Miklavec wrote:
> I'm not able to reproduce the problem, but there is one weird thing
> (unrelated to your problem):
>
> The original file "test.mp" is copied to "test.mp.keep" and a new file
> "test.mp" is created with a newer timestamp and two additional blank
> lines at the end.
>
> So repeating the compilation hundred times leads me to a file with 200
> blank lines at the end and I cannot recover the original file back (in
> each run the .keep file is overwritten).
>
> Hans - would it be possible to fix that please?

hm, I though that it was fixed, was a catch for older mp's

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

* Re: Trouble making basic MetaPost graphics using ConTeXt Minimals
  2011-07-15  1:04 ` luigi scarso
@ 2011-07-15  7:44   ` Hans Hagen
  2011-07-15  7:47     ` Mojca Miklavec
  2011-07-15 16:24   ` Kevin D. Robbins
  1 sibling, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2011-07-15  7:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 15-7-2011 3:04, luigi scarso wrote:

>> Building the file using "texexec --mptex test.mp" all three graphics

how about "context --mp test.mp" ?

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

* Re: Trouble making basic MetaPost graphics using ConTeXt Minimals
  2011-07-15  7:44   ` Hans Hagen
@ 2011-07-15  7:47     ` Mojca Miklavec
  2011-07-15  7:50       ` luigi scarso
  2011-07-15  8:54       ` Hans Hagen
  0 siblings, 2 replies; 10+ messages in thread
From: Mojca Miklavec @ 2011-07-15  7:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Jul 15, 2011 at 09:44, Hans Hagen <pragma@wxs.nl> wrote:
> On 15-7-2011 3:04, luigi scarso wrote:
>
>>> Building the file using "texexec --mptex test.mp" all three graphics
>
> how about "context --mp test.mp" ?

> context --mp test

metapost        | loading 'metafun.mp' (experimental metapost version
two)Error in mp.find_file:
...text/tex/texmf-context/tex/context/base/mlib-run.lua:75: attempt to
call field 'checktexts' (a nil value)

metapost        | processing 'test.mp'Error in mp.find_file:
...text/tex/texmf-context/tex/context/base/mlib-run.lua:75: attempt to
call field 'checktexts' (a nil value)
Error in mp.find_file:
...text/tex/texmf-context/tex/context/base/mlib-run.lua:75: attempt to
call field 'checktexts' (a nil value)

metapost        | error: Warning: cannot open font map file pdftex.map
Warning: cannot open font map file lm-math.map

(Please type a command or say `end')

[1]
(Please type a command or say `end')

[2]
(Please type a command or say `end')

! You can only use `btex' or `verbatimtex' in a file.
<*>   label.lrt(btex
                     $\sqrt x$ etex, (3,sqrt 3)*u);
! Missing `,' has been inserted.
<to be read again>
                   sqrt
<*>   label.lrt(btex $\sqrt
                            x$ etex, (3,sqrt 3)*u);
___________________________________________________________________________________
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] 10+ messages in thread

* Re: Trouble making basic MetaPost graphics using ConTeXt Minimals
  2011-07-15  7:47     ` Mojca Miklavec
@ 2011-07-15  7:50       ` luigi scarso
  2011-07-15  8:54       ` Hans Hagen
  1 sibling, 0 replies; 10+ messages in thread
From: luigi scarso @ 2011-07-15  7:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Jul 15, 2011 at 9:47 AM, Mojca Miklavec
<mojca.miklavec.lists@gmail.com> wrote:
> On Fri, Jul 15, 2011 at 09:44, Hans Hagen <pragma@wxs.nl> wrote:
>> On 15-7-2011 3:04, luigi scarso wrote:
>>
>>>> Building the file using "texexec --mptex test.mp" all three graphics
>>
>> how about "context --mp test.mp" ?
>
>> context --mp test
>
> metapost        | loading 'metafun.mp' (experimental metapost version
> two)Error in mp.find_file:
> ...text/tex/texmf-context/tex/context/base/mlib-run.lua:75: attempt to
> call field 'checktexts' (a nil value)
>
> metapost        | processing 'test.mp'Error in mp.find_file:
> ...text/tex/texmf-context/tex/context/base/mlib-run.lua:75: attempt to
> call field 'checktexts' (a nil value)
> Error in mp.find_file:
> ...text/tex/texmf-context/tex/context/base/mlib-run.lua:75: attempt to
> call field 'checktexts' (a nil value)
>
> metapost        | error: Warning: cannot open font map file pdftex.map
> Warning: cannot open font map file lm-math.map
>
> (Please type a command or say `end')
>
> [1]
> (Please type a command or say `end')
>
> [2]
> (Please type a command or say `end')
>
> ! You can only use `btex' or `verbatimtex' in a file.
> <*>   label.lrt(btex
>                     $\sqrt x$ etex, (3,sqrt 3)*u);
> ! Missing `,' has been inserted.
> <to be read again>
>                   sqrt
> <*>   label.lrt(btex $\sqrt
>                            x$ etex, (3,sqrt 3)*u);

Even with mkiv metapost depends to pdftex ora some files from pdftex.
That's way  \startMPpage..\stopMPpage is better.

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

* Re: Trouble making basic MetaPost graphics using ConTeXt Minimals
  2011-07-15  7:47     ` Mojca Miklavec
  2011-07-15  7:50       ` luigi scarso
@ 2011-07-15  8:54       ` Hans Hagen
  1 sibling, 0 replies; 10+ messages in thread
From: Hans Hagen @ 2011-07-15  8:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Mojca Miklavec

On 15-7-2011 9:47, Mojca Miklavec wrote:
> On Fri, Jul 15, 2011 at 09:44, Hans Hagen<pragma@wxs.nl>  wrote:
>> On 15-7-2011 3:04, luigi scarso wrote:
>>
>>>> Building the file using "texexec --mptex test.mp" all three graphics
>>
>> how about "context --mp test.mp" ?
>
>> context --mp test
>
> metapost        | loading 'metafun.mp' (experimental metapost version
> two)Error in mp.find_file:
> ....text/tex/texmf-context/tex/context/base/mlib-run.lua:75: attempt to
> call field 'checktexts' (a nil value)

hm, i'll look into it later

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

* Re: Trouble making basic MetaPost graphics using ConTeXt Minimals
  2011-07-15  1:04 ` luigi scarso
  2011-07-15  7:44   ` Hans Hagen
@ 2011-07-15 16:24   ` Kevin D. Robbins
  1 sibling, 0 replies; 10+ messages in thread
From: Kevin D. Robbins @ 2011-07-15 16:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Jul 14, 2011 at 7:04 PM, luigi scarso <luigi.scarso@gmail.com> wrote:
> This is one of the preferrred way to deal with metapost in mkiv
> \starttext
> \startMPpage
> numeric u;
>  u = 1cm;
>  draw (0,2u)--(0,0)--(4u,0);
>  pickup pencircle scaled 1pt;
>  draw (0,0){up}
>   for i=1 upto 8: ..(i/2,sqrt(i/2))*u endfor;
>  label.lrt(btex $\sqrt x$ etex, (3,sqrt 3)*u);
>  label.bot(btex $x$ etex, (2u,0));
>  label.lft(btex $y$ etex, (0,u));
> \stopMPpage
> \stoptext
>
> It's ok with latest minimals

Thanks, Luigi. This works on my system, too.

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

* Re: Trouble making basic MetaPost graphics using ConTeXt Minimals
  2011-07-15  7:13 ` Mojca Miklavec
  2011-07-15  7:42   ` Hans Hagen
@ 2011-07-15 16:28   ` Kevin D. Robbins
  1 sibling, 0 replies; 10+ messages in thread
From: Kevin D. Robbins @ 2011-07-15 16:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Jul 15, 2011 at 1:13 AM, Mojca Miklavec
<mojca.miklavec.lists@gmail.com> wrote:
> The original file "test.mp" is copied to "test.mp.keep" and a new file
> "test.mp" is created with a newer timestamp and two additional blank
> lines at the end.
>

I hadn't noticed this yesterday, but I see the same behavior, but only
when building with "texexec --mptex test.mp".

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

end of thread, other threads:[~2011-07-15 16:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-15  0:59 Trouble making basic MetaPost graphics using ConTeXt Minimals Kevin D. Robbins
2011-07-15  1:04 ` luigi scarso
2011-07-15  7:44   ` Hans Hagen
2011-07-15  7:47     ` Mojca Miklavec
2011-07-15  7:50       ` luigi scarso
2011-07-15  8:54       ` Hans Hagen
2011-07-15 16:24   ` Kevin D. Robbins
2011-07-15  7:13 ` Mojca Miklavec
2011-07-15  7:42   ` Hans Hagen
2011-07-15 16:28   ` Kevin D. Robbins

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