Toby Thurston | 1 Sep 16:25 2014

Bug with "odd" primitive?

The "odd" primitive appears to return "false" for all negative numbers.  This behaviour is significantly
different from Metafont. 
Can we get it corrected?  Or at least documented?  Thanks Toby

Test program:

    show(odd -3); end

result with Metafont:

    This is METAFONT, Version 2.7182818 (TeX Live 2014) (preloaded base=mf)
    (test.mf 
    >> true )  
    Transcript written on test.log.

result with Metapost

    This is MetaPost, version 1.902 (TeX Live 2014) (kpathsea version 6.2.0)
    (/usr/local/texlive/2014/texmf-dist/metapost/base/mpost.mp
    (/usr/local/texlive/2014/texmf-dist/metapost/base/plain.mp
    Preloading the plain mem file, version 1.005) ) (./test.mf
    >> false )
    Transcript written on test.log.

Thanks T.
--
http://tug.org/metapost/

France Dacar | 20 Aug 17:15 2014
Picon
Picon

Troubles rendeting text in PNG output

Hello there.

I am using MetaPost version 1.803 (mpost in MiKTeX 2.9).
I searched the Web, and in particular the MetaPost site, but could not find
the answer to my problem. The following test file

---------------------------------------
verbatimtex
\documentclass[11pt]{article}
\begin{document}
etex

outputformat := "png";
outputtemplate := "%j-%c.%o";

beginfig(1);
label(btex $(hs,f(s)t)$ etex, (0,0));
label(btex abracadabra etex, (0,-20));
endfig;

verbatimtex
\end{document}
etex
end
---------------------------------------

produces the expected result, though it spews out 20 warnings like

     Warning: invalid entry for `pkol0': unknown name `store' ignored

(Continue reading)

Walt Burkhard | 18 Aug 21:04 2014

quick question

Hello,

Does the current mpost 1.902 from texlive run with "large" integer/double
values?    I am using  something on the order of   97*360  within
the sind and cosd functions.    

If not, what command line option do I need.

Many thanks in advance.

Walt Burkhard
--
http://tug.org/metapost/
Vadim Radionov | 15 Jul 18:03 2014
Picon

dependencies bug

Dear all, 

My colleague found a bug in Metapost 1.803 which I would lile to report.  In the following minimal example, showdependencies shows something inappropriate, which gives "This can't happen (dep)" error later.  But if I move the third s-relation after setting z[4,6,8], everything works fine.

Vadim

def s(expr A,B,C,D)=
D-C=B-A=((B-D) rotated 90)
enddef;

beginfig(1);
s(z3,z4,z7,z8);
s(z4,z5,z6,z11);
s(z6,z12,z8,z10);

showdependencies;

z4 = (0,0);
z6 = (1cm,0);
z8 = (0,1cm);


endfig;
bye
--
http://tug.org/metapost/
Hartmut Henkel | 14 May 23:29 2014
Picon
Picon

Experiment: Bézier Arc Length Calculation by Elliptic Integrals

Hi,

i have done a bit of spare time experimenting with Bézier arc length
calculation, particularly trying out elliptic integrals. You can find a
write-up here: http://www.circuitwizard.de/metapost/arclength.pdf

Regards, Hartmut
--
http://tug.org/metapost/
Hartmut Henkel | 13 May 23:00 2014
Picon
Picon

metapost 1.999 Semicolon Weirdness

Hi,

the following program runs fine with MetaPost Version 1.999:

prologues:=3;
  beginfig(1);
  path p;
  z1 = (0.000000,0.000000);
z2 = (10.000000,0.000000);
z3 = (10.000000,10.000000);
z4 = (0.000000,0.000000);
p := z1 .. controls z2 and z3 .. z4;
  message(decimal(arclength(p)));
  pickup pencircle scaled 0.050000;  drawdot z1 withcolor red;
  drawdot z2 withcolor red;
  drawdot z3 withcolor red;
  drawdot z4 withcolor red;
  pickup pencircle scaled 0.010000   draw (z1--z2--z3--z4) withcolor red;
  draw p;
  currentpicture := currentpicture scaled 10;
  endfig;
  end;

Now i wonder why, since by accident there is no semicolon in line 14
between "pickup pencircle scaled 0.010000" and "draw (z1--z2...".
Shouldn't this give an error?

Regards, Hartmut

--
http://tug.org/metapost/

Samuel Bronson | 22 Apr 01:38 2014
Picon

decimal: The impossible/a segfault happened

Package: texlive-metapost
Version: 2013.20140314-1
Severity: normal

Dear Implementors,

I've discovered a way to get either:
  1. a "! This can't happen (token)." error (MetaPost 1.803 from Debian)
or 
  2. a segfault (MetaPost ~1.999 from SVN r2007)

[Note: I've abused debian-bug.el to include some information on package
version numbers.]

Unfortunately, most of the stuff I tried trimming out of my input makes
both go away; the former disappears if I so much as use "tracingall".

Here's the input file:

Attachment (decimal-fail.mp): text/x-metapost, 2760 bytes

and here's what happens when I run it ...

... under MetaPost 1.803:

% mpost -numbersystem=decimal decimal-fail.mp
This is MetaPost, version 1.803 (kpathsea version 6.1.1)
(mfplain.mp
Preloading the plain base, version 0.99: preliminaries,
 basic constants and mathematical macros,
 macros for converting units,
 macros and tables for various modes of operation,
 macros for drawing and filling,
 macros for proof labels and rules,
 macros for character and font administration,
and a few last-minute items.) (./decimal-fail.mp
Dangerous bend sign
! This can't happen (token).
<for( BAD)> ...el(str(SUFFIX0),z(SUFFIX0)); ENDFOR

labels->...XT3):makelabel(SUFFIX2)(str$,z$);endfor
                                                  .fi.endgroup
l.74 labels(38)
               ;
Transcript written on decimal-fail.log.

... under MetaPost 1.999 (under GDB) and poke around a bit:

% gdb --args ../metapost/build/texk/web2c/mpost -numbersystem=decimal decimal-fail.mp
GNU gdb (GDB) 7.6.1 (Debian 7.6.1-1)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/naesten/hacking/texmf/metapost/build/texk/web2c/mpost...done.
(gdb) run
Starting program: /home/naesten/hacking/texmf/dbend/../metapost/build/texk/web2c/mpost
-numbersystem=decimal decimal-fail.mp
warning: Could not load shared library symbols for linux-gate.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/i686/cmov/libthread_db.so.1".
This is MetaPost, version 1.999 (TeX Live 2014/dev) (kpathsea version 6.1.1)
(/usr/share/texlive/texmf-dist/metapost/base/mfplain.mp
Preloading the plain base, version 0.99: preliminaries,
 basic constants and mathematical macros,
 macros for converting units,
 macros and tables for various modes of operation,
 macros for drawing and filling,
 macros for proof labels and rules,
 macros for character and font administration,
and a few last-minute items.) (./decimal-fail.mp
Dangerous bend sign
Program received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x10000) at malloc.c:2891
2891    malloc.c: No such file or directory.
(gdb) bt
#0  __GI___libc_free (mem=0x10000) at malloc.c:2891
#1  0x080c3eb2 in mp_free_number (mp=0x82c6788, n=0xbfffef5c)
    at ../../../source/texk/web2c/mplibdir/mpmathdecimal.w:618
#2  0x080d395a in mp_gr_choose_scale (mp=mp <at> entry=0x82c6788, p=p <at> entry=0x8e75858)
    at ../../../source/texk/web2c/mplibdir/psout.w:6004
#3  0x080dc819 in mp_gr_ship_out (hh=hh <at> entry=0x8e74a78, qprologues=0, qprocset=qprocset <at> entry=0,
    standalone=standalone <at> entry=0) at ../../../source/texk/web2c/mplibdir/psout.w:6141
#4  0x0809598c in mp_shipout_backend (mp=0x82c6788, voidh=0x8daab00)
    at ../../../source/texk/web2c/mplibdir/mp.w:34121
#5  0x080b4dea in mp_ship_out (h=0x8daab00, mp=0x82c6788)
    at ../../../source/texk/web2c/mplibdir/mp.w:34095
#6  mp_do_ship_out (mp=0x82c6788) at ../../../source/texk/web2c/mplibdir/mp.w:31244
#7  mp_do_statement (mp=mp <at> entry=0x82c6788) at ../../../source/texk/web2c/mplibdir/mp.w:28473
#8  0x080b64c7 in mp_scan_primary (mp=mp <at> entry=0x82c6788)
    at ../../../source/texk/web2c/mplibdir/mp.w:22642
#9  0x080b8d67 in mp_scan_secondary (mp=mp <at> entry=0x82c6788)
    at ../../../source/texk/web2c/mplibdir/mp.w:23444
#10 0x080b8e67 in mp_scan_tertiary (mp=mp <at> entry=0x82c6788)
    at ../../../source/texk/web2c/mplibdir/mp.w:23500
#11 0x080a20df in mp_scan_expression (mp=mp <at> entry=0x82c6788)
    at ../../../source/texk/web2c/mplibdir/mp.w:23544
#12 0x080b31f9 in mp_do_statement (mp=mp <at> entry=0x82c6788)
    at ../../../source/texk/web2c/mplibdir/mp.w:28383
#13 0x080bdcc5 in mp_main_control (mp=<optimized out>)
    at ../../../source/texk/web2c/mplibdir/mp.w:29239
#14 mp_run (mp=mp <at> entry=0x82c6788) at ../../../source/texk/web2c/mplibdir/mp.w:29259
#15 0x0804b401 in main (argc=3, argv=0xbffff9f4)
    at ../../../source/texk/web2c/mplibdir/mpost.w:1385
(gdb) up
#1  0x080c3eb2 in mp_free_number (mp=0x82c6788, n=0xbfffef5c)
    at ../../../source/texk/web2c/mplibdir/mpmathdecimal.w:618
618       free(n->data.num);
(gdb) print *n
$1 = {data = {num = 0x10000, dval = 1.1670980088217614e-312, val = 65536}, type = mp_scaled_type}
(gdb)

So, um, it seems to be trying to use the code in mpmathdecimal.w to free
a plain-old "scaled" number, for some reason ...

After this, I did some more poking around with valgrind vgdb only to
discover that I could have just typed "up" and gotten nearly as much
information, at least if I knew what free_number(ret) meant -- which is
to say, I found out that this mp_free_number() has been passed a pointer
to mp_gr_choose_scale()'s local variable "ret" in frame #2.

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.11-2-686-pae (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages texlive-metapost depends on:
ii  dpkg              1.17.5
ii  tex-common        4.04
ii  texlive-base      2013.20140314-1
ii  texlive-binaries  2013.20130729.30972-2+b2

--

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!
--
http://tug.org/metapost/
- | 4 Apr 11:23 2014
Picon

I cannot use metapost (mpost)

 I am trying to compose a lecture, by means of metapost figures. I use a linux computer with UBUNTU, and composed a file example.mp as is described in a paper of Andr'e Heck on "Learning Metapost by doing" , NTG vol.32,2005. When as prescribed, I typed 'mpost example' I got the message: sudo apt-get install texlive - binaries. After some time Texlive was loaded and again I typed 'mpost example'. Now I got the message: Sorry, I can't find the 'mpost' preload file, will try 'plain'. And then: I can't find the 'plain' preload file!

How should I proceed to use metapost? Thanks, when you can help me.

Wim Maaskant

--
http://tug.org/metapost/
Hartmut Henkel | 2 Apr 21:10 2014
Picon
Picon

arclength() tolerances

Hi,

in metapost there seem to be absolute tolerance values for iterative
algorithms like arclength() even in the double numbersystem:

path p;
p:=fullcircle scaled 0.01;
message(decimal(arclength(p)));
p:=fullcircle scaled 10000;
message(decimal(arclength(p)));

This is MetaPost, version 1.803 (kpathsea version 6.1.1)
(mpost.mp (/usr/local/texlive/2013/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.005) ) (./xx.mp
0.03147739887362138
31415.99535777498)

Regards, Hartmut

--
http://tug.org/metapost/

Franck Pastor | 1 Apr 10:18 2014
Picon

Units unaccuracy with numbersystem set to double

Hello,

Since floating points numerics are available in MetaPost when setting the numbersystem variable to
"double", I've used them regularly. Only recently I noticed something wrong with it: the MetaPost unit
values are unchanged whether "numbersystem" is set to "double" or "scaled". 

Here is a sample, for the centimeter (cm), millimeter(mm) and point (pt) units:

iMacIntel20-4:~ fp$ mpost -numbersystem=double
This is MetaPost, version 1.803 (kpathsea version 6.1.1)
**null
(mpost.mp (/usr/local/texlive/2013/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.005) )
(/usr/local/texlive/2013/texmf-dist/metapost/misc/null.mp)
*show cm;
>> 28.34645
*show mm;
>> 2.83464
*show pt;
>> 0.99626
*
Thus we've got exactly the same accuracy as with the scaled number system, whereas I had expected much more
decimals. As an example, Asymptote, which uses floating-point arithmetics by default, returns this
definition of the centimeter unit:

Welcome to Asymptote version 2.23 (to view the manual, type help)
> cm
28.3464566929134
> 

Is MetaPost not supposed to have the same kind of accuracy when numbersystem is set to "double"?

NB: I'm still using the MetaPost version (1.803) that comes with TeX Live, not being able to install
MetaPost 1.9 on my own. Maybe this problem has been solved in this last version.

Thanks for having read this!

Franck Pastor

--
http://tug.org/metapost/

Daniel H. Luecking | 17 Mar 14:30 2014
Picon

Re: quick question

[Copying the list]

The problem is that the EPS which metapost produces by
default is not self-contained. The fonts are not
embedded. TeX-relatex software like dvips, dvipdfmx
and pdflatex know how to handle that, but programs
like ghostscript need the fonts either in the EPS
file or in the system.

If you include the line

    prologues := 3;

in your .mp file before any figures, MP will embed all
the fonts you use (provided it can find them, but that
includes all fonts installed in the TeX system).

See sections 3 and 8.1 of mpman.pdf (pages 5 and 24
in my version).

Dan

Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
Fayetteville, Arkansas
From: burkhard <at> eng.ucsd.edu [burkhard <at> eng.ucsd.edu] on behalf of Walt Burkhard [burkhard <at> cs.ucsd.edu]
Sent: Sunday, March 16, 2014 7:09 PM
To: Daniel H. Luecking
Subject: quick question

Hello Dan,

I just tried eps2eps  on a metapost created file that contains  measurements
expressed in the font cmss10.   Howver, I get an error message

Error: /undefined in cmss10

What fonts might I use in metapost that won't throw eps2eps off?

Many thanks in advance,

Walt


--
http://tug.org/metapost/

Gmane