[metapost] different bounding boxes for identical figures

Sanjoy Mahajan sanjoy at mrao.cam.ac.uk
Thu Jan 26 08:11:18 CET 2006

This metapost file 

  dotlabel(btex etex, (2,6));
  label.bot (btex a etex, origin);

  dotlabel(btex etex, (2,6));
  label.bot (btex a etex, origin);


should produce two identical figures.  However, their bounding boxes are
not the same [using MetaPost 0.641 (Web2C 7.5.4) from teTeX on linux i386]:

  %%BoundingBox: -2.49065 -7.2895 3.5 7.5 
  %%BoundingBox: -2.49065 -7.2895 4.49065 8.14474 

If I comment out the first figure, then the second figure's bounding box

  %%BoundingBox: -2.49065 -7.2895 3.5 7.5 

(i.e. like the first one's in the original example).  The eps files are
identical except for the bounding boxes:

%%BoundingBox: -2.49065 -7.2895 3.5 7.5 
%%Creator: MetaPost
%%CreationDate: 2006.01.26:0205
%%Pages: 1
%*Font: cmr10 9.96265 9.96265 61:8
%%Page: 1 1
 0 3 dtransform truncate idtransform setlinewidth pop [] 0 setdash 1 setlinecap
 1 setlinejoin 10 setmiterlimit
newpath 2 6 moveto 0 0 rlineto stroke
-2.49065 -7.2895 moveto
(a) cmr10 9.96265 fshow

This example came from a 1000-line file (showing two percolation
processes).  I wrote a program to randomly delete lines one at a time as
long as the deletion preserved the mismatch.  I was surprised when it
found such a short file with the mismatch.


`A society of sheep must in time beget a government of wolves.'
   - Bertrand de Jouvenal

More information about the metapost mailing list