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)
(Continue reading)

- | 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
Dirk Laurie | 14 Mar 15:30 2014

[SOLVED] Getting SVG and EPS output from Metapost

2014-03-14 15:35 GMT+02:00 Daniel H. Luecking <luecking <at>>:

> The manpage should at least say that you can get a list of options using.
>     mpost --help
> Maybe the full list is not there because of the rapid changes lately.
> Unix people would mostly think of --help on their own.

Well, I thought of -h, and it gave me a list of options that start
with -h. 26 of those, and all is revealed? Not quite: if the option
is unique and requires no additional field, it just accepts the
one-letter abbreviation and goes on running mpost.

No SVG or EPS info, though.

But mpman.pdf does give the required information.
Well, most of it.

For SVG output:

$ mpost -s 'outputformat="svg"'

Then rename `code.1` etc to have extension .svg.

For EPS output:

$ mpost

Then feed `code.1` etc to eps2eps, saving the output to
files with extension .eps.

Note: you can't just rename `code.1` to `code.eps`. The drawings
are not properly encapsulated. Good enough for the graphicx
package, yes, but not for export to foreign programs that read EPS.



Dirk Laurie | 14 Mar 10:42 2014

Can't the manpage be more helpful?

The full manpage of `mpost` in the TeXLive distribution starts off thus:

       mpost [options] [commands]

       mpost --dvitomp dvifile[.dvi] [mpxfile[.mpx]]

       MetaPost interprets the MetaPost language and produces PostScript (EPS)
       or Scalable Vector Graphics (SVG) pictures.

However, it gives no information whatsoever on "options". Experimentally
one finds that if you just give it "mpost" it produces files called
"code.1" etc that are in ordinary Postscript (not EPS).

I know it says later on "This manual page is not meant to be exhaustive."
And then directs you to the documentation directory without mentioning
the name or subdirectory of the file you should be reading first.

Surely the manpage, which currently is just over 100 lines long, could:

1. Tell you what to do in order to get EPS or SVG as advertised.
2. Say which file is the starting point when reading the documentation.

without becoming overly bloated?


Christophe Poulain | 8 Mar 08:04 2014

problem with negative's angle ?

I'm a french user of Metapost and i've discovered this problem.


  path cc;
  cc=fullcircle scaled 3cm;
  draw cc;
  for i=0 upto 11:
    label(decimal(i),point(arctime(((90-i*30)/360)*arclength cc) of cc) of cc);


There isn't number if "the angle" is negative.

However, if I compile the code below, there is no problem.


  path cc;
  cc=fullcircle scaled 3cm;
  draw cc;
  for i=0 upto 11:
    label(decimal(12-i),point(arctime(((90+i*30)/360)*arclength cc) of cc) of cc);


I don't understand my mistake...

José Carlos Santos | 24 Feb 13:31 2014

Several intersection points

Hi all,

Today I tried for the first time to obtain in MetaPost all intersection 
points of two lines. And I failed. :-( Here is the code:

----------------------- -----------------------

prologues := 3;
filenametemplate "%j.mps";
   numeric a,cc,cl,t[];
   pair p[],q[];
   path h[];
   a := 5mm;
   cc := 11a;
   cl := 10a;
   ct := 9.5a;
   p1 := (0,0);
   p2 := (cc,0);
   p3 := (cc,cl);
   p4 := (0,cl);
   h1 := (ct,0){up}
   for i=22.5 step 22.5 until 67.5:
   h2 := (0,0)
   for i=1/16 step 1/16 until 1:
   h3 := h2 reflectedabout ((p1+p2)/2,(p3+p4)/2);
   p5 := h1 intersectionpoint h2;
   for i=1 upto 2:
     (t[i],whatever) = h1 intersectiontimes h3;
     q[i] := point t[i] of h1;
   pickup pencircle scaled .8pt;
   for i=1 upto 3:
     draw h[i];
   pickup pencircle scaled 4pt;


The path h1 is a quarter of a circle and the path h3 is part of a 
hyperbola. As you can see, they intersect twice. I tried to define q1 
and q2 as these intersection points, but to MetaPost q1 = q2. That is, 
if I compile the file above, the line "drawdot(q2)" draws one of the 
intersection points, but if I replace it with "drawdot(q1)", then I get 
the _same_ point. What am I doing wrong?

Best regards,

Jose Carlos Santos


Dave Crossland | 20 Feb 00:00 2014

Running mpost as a unix daemon?

Hi! is a font family editor
application, which calls mpost

This means the application is slow, because in
we use the Python standard library's subprocess.Popen and incur a long
startup time each time it is run.

Non-Solution: Jonathan Fine's
looked like it might speed things up, but it seems it won't because it
isn't really a metapostd, but a wrapper that makes metapost appear
like a daemon, but still starts up metapost each time with
subprocess.Popen on

I see 3 options for making this work as a daemon:

Option: Write a new C/C++ unix daemon 'metapostd' in C, to run MPLib
as so there is no start up time

Option: Write a python binding for MPLib, to access metapost
calculations directly from Python

Option: Write a nodejs binding for MPLib, to access metapost
calculations directly from node

I wonder what the metapost community thinks about these options -
which would be most widely useful?

I'd love it if we could make a metapostd in python, but not sure its possible.