France Dacar | 20 Aug 17:15 2014

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


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

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


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


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
Vadim Radionov | 15 Jul 18:03 2014

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.


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



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

Hartmut Henkel | 14 May 23:29 2014

Experiment: Bézier Arc Length Calculation by Elliptic Integrals


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:

Regards, Hartmut
Hartmut Henkel | 13 May 23:00 2014

metapost 1.999 Semicolon Weirdness


the following program runs fine with MetaPost Version 1.999:

  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;
  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;

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


Samuel Bronson | 22 Apr 01:38 2014

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)
  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 ( text/x-metapost, 2760 bytes

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

... under MetaPost 1.803:

% mpost -numbersystem=decimal
This is MetaPost, version 1.803 (kpathsea version 6.1.1)
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.) (./
Dangerous bend sign
! This can't happen (token).
<for( BAD)> ...el(str(SUFFIX0),z(SUFFIX0)); ENDFOR

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
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 <>
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:
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
warning: Could not load shared library symbols for
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/".
This is MetaPost, version 1.999 (TeX Live 2014/dev) (kpathsea version 6.1.1)
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.) (./
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}

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!
- | 4 Apr 11:23 2014

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

Hartmut Henkel | 2 Apr 21:10 2014

arclength() tolerances


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;
p:=fullcircle scaled 10000;

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

Regards, Hartmut


Franck Pastor | 1 Apr 10:18 2014

Units unaccuracy with numbersystem set to double


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)
( (/usr/local/texlive/2013/texmf-dist/metapost/base/
Preloading the plain mem file, version 1.005) )
*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

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


Daniel H. Luecking | 17 Mar 14:30 2014

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


Daniel H. Luecking
Department of Mathematical Sciences
University of Arkansas
Fayetteville, Arkansas
From: burkhard <at> [burkhard <at>] on behalf of Walt Burkhard [burkhard <at>]
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 Burkhard | 14 Mar 17:29 2014

quick question

Hello all,

I  have just learned of eps2eps!  So I tried it on one of
my metapost created files and to my surprise the eps file created
contained only one quarter of the original image.    The original
image symmetric about both the x and y axes.   

I have attached the original metapost created file here.   wheel.1

Many thanks in advance for any insights.

Attachment (wheel.1): application/octet-stream, 34 KiB