ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Incompatibility - metafun and graph
@ 2002-03-26 23:07 Nigel King
  2002-03-27  1:16 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Nigel King @ 2002-03-26 23:07 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 756 bytes --]

Hi all,
There appears to be an incompatibility between the MetaPost graphing
functions and MetaFun.

The Œtestmp.tex¹ file is a nearly minimum file to test the various metapost
creations. The first two graphics produce the expected result while the
third does not produce a result.

The MetaPost log file Œtestmp-mpgraph.log¹ reveals that the number
formatting routine is in trouble.

Running mpost mem=mpost on testmp-mpgraph.mp creates the correct graphic
which can then be incorporated. This Œwork around¹ only works because the
graph is the last graphic.

BTW it would be nice if the failure of MetaPost was reported back to the
texexec log file. The message received is of missing pictures rather than
execution failure.
-- 
Nigel

[-- Attachment #2: testmp.tex --]
[-- Type: text/plain, Size: 424 bytes --]

\starttext
\startuseMPgraphic{testabc}
label(btex abcdef etex,origin);
\stopuseMPgraphic
test btex..etex  
\useMPgraphic{testabc}
\startuseMPgraphic{testxyz}
label("xyz",origin);
\stopuseMPgraphic

test ``xyz'' 
\useMPgraphic{testxyz}
\startuseMPgraphic{testgraphlabel}
input graph
draw begingraph(3in,2in);
setrange(origin,2,2);
endgraph;
\stopuseMPgraphic

Test of graph with labels
\useMPgraphic{testgraphlabel}
\stoptext

[-- Attachment #3: testmp-mpgraph.log --]
[-- Type: application/octet-stream, Size: 836 bytes --]

This is MetaPost, Version 0.641 (Web2C 7.3.1) (mem=metafun 2002.3.26)  26 MAR 2002 21:44
**testmp-mpgraph
(testmp-mpgraph.mp
{randomseed:=4063}
write0 = `testmp-mpgraph.mpo'.

 (/sw/share/texmf/metapost/base/graph.mp
(/sw/share/texmf/metapost/base/marith.mp
(/sw/share/texmf/metapost/base/string.mp))
(/sw/share/texmf/metapost/base/format.mp
(/sw/share/texmf/metapost/base/string.mp)
(/sw/share/texmf/metapost/base/texnum.mp
>> /sw/share/texmf/metapost/base/texnum.mp
>> texnum.mpx
! Unable to make mpx file.
l.14 init_numbers(btex
                      $-$etex, btex$1$etex, btex${\times}10$etex,
The two files given above are one of your source files
and an auxiliary file I need to read to find out what your
btex..etex blocks mean. If you don't know why I had trouble,
try running it manually through MPto -tex, TeX, and DVItoMP.



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

* Re: Incompatibility - metafun and graph
  2002-03-26 23:07 Incompatibility - metafun and graph Nigel King
@ 2002-03-27  1:16 ` Hans Hagen
       [not found]   ` <B8C784EF.798C%king@dircon.co.uk>
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2002-03-27  1:16 UTC (permalink / raw)
  Cc: ntg-context

At 11:07 PM 3/26/2002 +0000, Nigel King wrote:
>Hi all,
>There appears to be an incompatibility between the MetaPost graphing
>functions and MetaFun.
>
>The Œtestmp.tex¹ file is a nearly minimum file to test the various metapost
>creations. The first two graphics produce the expected result while the
>third does not produce a result.
>
>The MetaPost log file Œtestmp-mpgraph.log¹ reveals that the number
>formatting routine is in trouble.
>
>Running mpost mem=mpost on testmp-mpgraph.mp creates the correct graphic
>which can then be incorporated. This Œwork around¹ only works because the
>graph is the last graphic.
>
>BTW it would be nice if the failure of MetaPost was reported back to the
>texexec log file. The message received is of missing pictures rather than
>execution failure.

Don't ask me why, but the following works (the problem is that metafun has 
an adapted format.tex file); if you make me a couple of examples i can see 
how i can support graph.mp in a better way (the point is that i want to 
bypass the texnum stuff and provide real texing instead of the pseudo 
texing in format.mp)

\startMPinclusions
write "" to "texnum.mp" ; batchmode ; input graph ;
init_numbers
   (textext("$-$"),
    textext("$1$"),
    textext("${\times}10$"),
    textext("${}^-$"),
    textext("${}^2$"));
Fe_base := textext("$10$") ;
\stopMPinclusions

\startuseMPgraphic{testgraphlabel}
draw begingraph(3in,2in);
setrange(origin,2,2);
endgraph;
\stopuseMPgraphic

-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-ade.nl
-------------------------------------------------------------------------


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

* Re: Incompatibility - metafun and graph
       [not found]   ` <B8C784EF.798C%king@dircon.co.uk>
@ 2002-03-27 14:18     ` Nigel King
  2002-03-27 14:49       ` Hans Hagen
  2002-03-30 18:55     ` Hans Hagen
  1 sibling, 1 reply; 5+ messages in thread
From: Nigel King @ 2002-03-27 14:18 UTC (permalink / raw)


>> Hi all,
>> There appears to be an incompatibility between the MetaPost graphing
>> functions and MetaFun.
> 
> Don't ask me why, but the following works (the problem is that metafun has
> an adapted format.tex file); if you make me a couple of examples i can see
> how i can support graph.mp in a better way (the point is that i want to
> bypass the texnum stuff and provide real texing instead of the pseudo
> texing in format.mp)
> 
> \startMPinclusions
> write "" to "texnum.mp" ; batchmode ; input graph ;
> init_numbers
>  (textext("$-$"),
>   textext("$1$"),
>   textext("${\times}10$"),
>   textext("${}^-$"),
>   textext("${}^2$"));
> Fe_base := textext("$10$") ;
> \stopMPinclusions
> 
This has certainly worked in the four documents that were unreliable that I
was working on.

I am a fairly new user of graph.mp and thus am not sure what you might want
in the way of examples. The reason why I had the two versions of pictures in
testmp.tex before the problem graph was because the btex...etex method of
text inclusion in metapost is quite different than the "..." method of text
inclusion and can cause different problems (particularly the mp to tex to
dvi to mp process), thus my test file for context installation included both
forms.

Thanks again
Nigel King


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

* Re: Incompatibility - metafun and graph
  2002-03-27 14:18     ` Nigel King
@ 2002-03-27 14:49       ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2002-03-27 14:49 UTC (permalink / raw)
  Cc: ntg-context

At 02:18 PM 3/27/2002 +0000, Nigel King wrote:
> >> Hi all,
> >> There appears to be an incompatibility between the MetaPost graphing
> >> functions and MetaFun.
> >
> > Don't ask me why, but the following works (the problem is that metafun has
> > an adapted format.tex file); if you make me a couple of examples i can see
> > how i can support graph.mp in a better way (the point is that i want to
> > bypass the texnum stuff and provide real texing instead of the pseudo
> > texing in format.mp)
> >
> > \startMPinclusions
> > write "" to "texnum.mp" ; batchmode ; input graph ;
> > init_numbers
> >  (textext("$-$"),
> >   textext("$1$"),
> >   textext("${\times}10$"),
> >   textext("${}^-$"),
> >   textext("${}^2$"));
> > Fe_base := textext("$10$") ;
> > \stopMPinclusions
> >
>This has certainly worked in the four documents that were unreliable that I
>was working on.
>
>I am a fairly new user of graph.mp and thus am not sure what you might want
>in the way of examples. The reason why I had the two versions of pictures in
>testmp.tex before the problem graph was because the btex...etex method of
>text inclusion in metapost is quite different than the "..." method of text
>inclusion and can cause different problems (particularly the mp to tex to
>dvi to mp process), thus my test file for context installation included both
>forms.

the problem is that in graph (and the associated format) btex/etex calls 
are embedded, while metafun (texexec) handles this in its own way (as less 
calls to tex as possible and so)

Also, the idea behind a format replacement is that we can let graph adapt 
itself to style changes

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-ade.nl
-------------------------------------------------------------------------


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

* Re: Incompatibility - metafun and graph
       [not found]   ` <B8C784EF.798C%king@dircon.co.uk>
  2002-03-27 14:18     ` Nigel King
@ 2002-03-30 18:55     ` Hans Hagen
  1 sibling, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2002-03-30 18:55 UTC (permalink / raw)
  Cc: ntg-context

Hi Nigel,

The following hackery loading of graph also works:

\startMPinclusions
batchmode ; input graph ; initialize_numbers ;
\stopMPinclusions

(at least here)

\startMPcode
draw begingraph(3in,2in);
setrange(origin,2,2);
endgraph;
\stopMPcode

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-ade.nl
-------------------------------------------------------------------------


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

end of thread, other threads:[~2002-03-30 18:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-26 23:07 Incompatibility - metafun and graph Nigel King
2002-03-27  1:16 ` Hans Hagen
     [not found]   ` <B8C784EF.798C%king@dircon.co.uk>
2002-03-27 14:18     ` Nigel King
2002-03-27 14:49       ` Hans Hagen
2002-03-30 18:55     ` 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).