From martin.densing at psi.ch Sat Feb 16 13:49:22 2019 From: martin.densing at psi.ch (Densing Martin (PSI)) Date: Sat, 16 Feb 2019 12:49:22 +0000 Subject: [metapost] New numbersystems for the graph package? Message-ID: <7D4340E74A6C8848815563146D838EF8470C78ED@MBX114.d.ethz.ch> 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 test.mp" gives an error on the following file "test.mp", whereas just "mpost test.mp" runs smoothly. Version: MetaPost 2.000 (TeX Live 2017/W32TeX) on MS Windows. File: 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 %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("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. Best, Martin __________________________________________ Paul Scherrer Institut Martin Densing Schweiz E-Mail: martin.densing at psi.ch From luigi.scarso at gmail.com Sat Feb 16 16:30:28 2019 From: luigi.scarso at gmail.com (luigi scarso) Date: Sat, 16 Feb 2019 16:30:28 +0100 Subject: [metapost] New numbersystems for the graph package? In-Reply-To: <7D4340E74A6C8848815563146D838EF8470C78ED@MBX114.d.ethz.ch> References: <7D4340E74A6C8848815563146D838EF8470C78ED@MBX114.d.ethz.ch> Message-ID: On Sat, Feb 16, 2019 at 3:37 PM Densing Martin (PSI) 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 test.mp" gives an error on the following > file "test.mp", whereas just "mpost test.mp" runs smoothly. Version: > MetaPost 2.000 (TeX Live 2017/W32TeX) on MS Windows. > > File: 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 %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("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. > confirmed , looking into it. -- luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From luigi.scarso at gmail.com Sat Feb 16 19:48:48 2019 From: luigi.scarso at gmail.com (luigi scarso) Date: Sat, 16 Feb 2019 19:48:48 +0100 Subject: [metapost] New numbersystems for the graph package? In-Reply-To: <7D4340E74A6C8848815563146D838EF8470C78ED@MBX114.d.ethz.ch> References: <7D4340E74A6C8848815563146D838EF8470C78ED@MBX114.d.ethz.ch> Message-ID: On Sat, Feb 16, 2019 at 3:37 PM Densing Martin (PSI) 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 test.mp" gives an error on the following > file "test.mp", whereas just "mpost test.mp" runs smoothly. Version: > MetaPost 2.000 (TeX Live 2017/W32TeX) on MS Windows. > > File: 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 %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("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/marith.mp: vardef Mabs primary x = x*.5*2 enddef; Can you try with vardef Mabs primary x = x*1 enddef; -- luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From luigi.scarso at gmail.com Mon Feb 18 01:04:01 2019 From: luigi.scarso at gmail.com (luigi scarso) Date: Mon, 18 Feb 2019 01:04:01 +0100 Subject: [metapost] New numbersystems for the graph package? In-Reply-To: References: <7D4340E74A6C8848815563146D838EF8470C78ED@MBX114.d.ethz.ch> Message-ID: On Sat, Feb 16, 2019 at 7:48 PM luigi scarso wrote: > >> In > texmf-dist/metapost/base/marith.mp: > vardef Mabs primary x = x*.5*2 enddef; > > Can you try with > vardef Mabs primary x = x*1 enddef; > > sorry , forget about it . The correct definition is vardef Mabs primary x = x*.5*2 enddef; -- luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From luigi.scarso at gmail.com Mon Feb 18 01:31:34 2019 From: luigi.scarso at gmail.com (luigi scarso) Date: Mon, 18 Feb 2019 01:31:34 +0100 Subject: [metapost] New numbersystems for the graph package? In-Reply-To: References: <7D4340E74A6C8848815563146D838EF8470C78ED@MBX114.d.ethz.ch> Message-ID: This should be ok % 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 %0 1.4 etc. is read by gdata marco until empty line input graph prologues := 3; outputtemplate := "%j-%c.mps"; if numbersystem="decimal": %% numberprecision:=6; vardef Mabs primary x = x/10*10 enddef; fi beginfig(1) draw begingraph(10cm,10cm); path p; gdata("test.mp", $, augment.p(i, scantokens $2);); gdraw p; endgraph; endfig; end -- luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.densing at psi.ch Mon Feb 18 09:21:04 2019 From: martin.densing at psi.ch (Densing Martin (PSI)) Date: Mon, 18 Feb 2019 08:21:04 +0000 Subject: [metapost] New numbersystems for the graph package? In-Reply-To: References: <7D4340E74A6C8848815563146D838EF8470C78ED@MBX114.d.ethz.ch> Message-ID: <7D4340E74A6C8848815563146D838EF8470C7BFB@MBX114.d.ethz.ch> 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 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) 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 %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 From luigi.scarso at gmail.com Mon Feb 18 09:26:29 2019 From: luigi.scarso at gmail.com (luigi scarso) Date: Mon, 18 Feb 2019 09:26:29 +0100 Subject: [metapost] New numbersystems for the graph package? In-Reply-To: <7D4340E74A6C8848815563146D838EF8470C7BFB@MBX114.d.ethz.ch> References: <7D4340E74A6C8848815563146D838EF8470C78ED@MBX114.d.ethz.ch> <7D4340E74A6C8848815563146D838EF8470C7BFB@MBX114.d.ethz.ch> Message-ID: On Mon, Feb 18, 2019 at 9:21 AM Densing Martin (PSI) wrote: > Dear Luigi, > > Thanks for your answer! > > This removes the error, but it destroys the y-axis (no negative labels > anymore). > > hm if you are using vardef Mabs primary x = x enddef; yesm this is wrong, as I have wrote. But this one should be ok if numbersystem="decimal": %% numberprecision:=6; vardef Mabs primary x = x/10*10 enddef; fi -- luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.densing at psi.ch Mon Feb 18 16:51:37 2019 From: martin.densing at psi.ch (Densing Martin (PSI)) Date: Mon, 18 Feb 2019 15:51:37 +0000 Subject: [metapost] New numbersystems for the graph package? In-Reply-To: References: <7D4340E74A6C8848815563146D838EF8470C78ED@MBX114.d.ethz.ch> Message-ID: <7D4340E74A6C8848815563146D838EF8470C7CE3@MBX114.d.ethz.ch> Dear Luigi, Thanks you very much. On my computer, the provided test.mp seems still not to work: The output with numbersystem=decimal is attached (test-1-decimal.mps); the y-axis is still wrong. The usual output is test-1.mps; the y-axis labelling is correct (includes negative values). My point is not this particular example, because I do not need this particular code (by introducing your very good hack). But still, thank you very much for your good help! My point is: It seems that the graph-macros were not tested with the new numbersystems, and because you or Taco Hoekwater have introduced the new numbersystems, it would be nice to have a short comment on this how to proceed regarding the new numbersystems and the graph-macro. Best regards, Martin From: luigi scarso Sent: Montag, 18. Februar 2019 01:32 Cc: metapost at tug.org Subject: Re: [metapost] New numbersystems for the graph package? This should be ok % 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 %0 1.4 etc. is read by gdata marco until empty line input graph prologues := 3; outputtemplate := "%j-%c.mps"; if numbersystem="decimal": %% numberprecision:=6; vardef Mabs primary x = x/10*10 enddef; fi beginfig(1) draw begingraph(10cm,10cm); path p; gdata("test.mp", $, augment.p(i, scantokens $2);); gdraw p; endgraph; endfig; end -- luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test-1.mps Type: application/octet-stream Size: 35780 bytes Desc: test-1.mps URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test-1-decimal.mps Type: application/octet-stream Size: 21669 bytes Desc: test-1-decimal.mps URL: From luigi.scarso at gmail.com Mon Feb 18 16:56:33 2019 From: luigi.scarso at gmail.com (luigi scarso) Date: Mon, 18 Feb 2019 16:56:33 +0100 Subject: [metapost] New numbersystems for the graph package? In-Reply-To: <7D4340E74A6C8848815563146D838EF8470C7CE3@MBX114.d.ethz.ch> References: <7D4340E74A6C8848815563146D838EF8470C78ED@MBX114.d.ethz.ch> <7D4340E74A6C8848815563146D838EF8470C7CE3@MBX114.d.ethz.ch> Message-ID: On Mon, Feb 18, 2019 at 4:52 PM Densing Martin (PSI) wrote: > Dear Luigi, > > > > Thanks you very much. On my computer, the provided test.mp seems still > not to work: > > > > The output with numbersystem=decimal is attached (test-1-decimal.mps); the > y-axis is still wrong. > > The usual output is test-1.mps; the y-axis labelling is correct (includes > negative values). > > > ok, thank you . I will check them later. > My point is not this particular example, because I do not need this > particular code (by introducing your very good hack). But still, thank you > very much for your good help! > > My point is: It seems that the graph-macros were not tested with the new > numbersystems, and because you or Taco Hoekwater have introduced the new > numbersystems, it would be nice to have a short comment on this how to > proceed regarding the new numbersystems and the graph-macro. > > > Ok I will see what I can do. -- luigi -------------- next part -------------- An HTML attachment was scrubbed... URL: