[metapost] New numbersystems for the graph package?

Densing Martin (PSI) martin.densing at psi.ch
Mon Feb 18 09:21:04 CET 2019


Dear Luigi,

Thanks for your answer!

This removes the error, but it destroys the y-axis (no negative labels anymore).

>From my limited perspective, the problem seems to be: The graph-macro depends in several places on the finite, original numbersystem because of the Mlog transformation (which would be not needed with higher precision arithmetic). 
Until there is a fix, perhaps an innocent user should be made aware by a conditional errormessage based on the numbersystem at the beginning of the graph-macro, or a note in the documentation?

Best,
Martin


From: luigi scarso <luigi.scarso at gmail.com> 
Sent: Samstag, 16. Februar 2019 19:49
Cc: metapost at tug.org
Subject: Re: [metapost] New numbersystems for the graph package?



On Sat, Feb 16, 2019 at 3:37 PM Densing Martin (PSI) <mailto:martin.densing at psi.ch> wrote:
Dear metapost experts,

Many thanks to the metapost-coders for the introduction of the new numbersystems!

How can we ensure that the new numbersystems work with the existing, very helpful macros that are available with the usual TeX-disitributions? Most relevant would be the graph macros of John Hobby. Hence: Would it be possible to make the graph macros (and all the auxiliary macros, e.g. format etc.) work with all numbersystems?

Example: 

"mpost -numbersystem=decimal http://test.mp" gives an error on the following file "http://test.mp", whereas just "mpost http://test.mp" runs smoothly. Version: MetaPost 2.000 (TeX Live 2017/W32TeX) on MS Windows.

File: http://test.mp
% 0  1.4
% 1  3.2
% 2  -4.5
% 3  8.0
% 4  9.0
% 5  4.0

% Data-file for graph can be included at beginning of source-file,
% because %<space>0 1.4 etc. is read by gdata marco until empty line

input graph

prologues := 3;
outputtemplate := "%j-%c.mps";

beginfig(1)  
  draw begingraph(10cm,10cm);
    path p;
    gdata("http://test.mp", $, augment.p(i, scantokens $2););
    gdraw p;
  endgraph;
endfig;

end
-----------------end file

Metapost's log (if numbersystem=decimal):
-----------------------------------------------------------

! Logarithm of -7000.000523787821841175847573036896 has been replaced by 0.
Gipick_->...i=1upto.mlog(xpart.Gmhh_-xpart.Gmll_)/
....

This is just one of several issues, for example the auxiliary "format" macro has also problems with the new numbersystems.

Thank you very much for your help.
 
In 

texmf-dist/metapost/base/http://marith.mp: 
vardef Mabs primary x = x*.5*2 enddef;

Can you try with 
vardef Mabs primary x = x*1 enddef;


-- 
luigi



More information about the metapost mailing list