[metapost] different bounding boxes for identical figures

Sanjoy Mahajan sanjoy at mrao.cam.ac.uk
Thu Jan 26 20:01:23 CET 2006


I just updated mpost to 0.901 and followed the INSTALL instructions.
The bug in the slimmed-down example is gone.  But the original larger
mp file shows it, but only if it's called 'd.mp' in a particular
directory.  Which is very very strange.

In the transcript below, the figures d.1 and d.2 should have the same
bounding boxes (basically a 20x20 lattice at 0.15in spacing, with a
tex label at the bottom), although they are slightly different.  I use
this 'testit' script to check for problems:

$ cat testit
#!/bin/bash -ex

mpost -recorder $1
grep '^%%HiResBoundingBox:' ${1}.1 ${1}.2

$ testit d
+ mpost -recorder d
This is MetaPost, Version 0.901 (Web2C 7.5.3)
(d.mp [1] [2] [3] [4] [5] [6] )
6 output files written: d.1 .. d.6
Transcript written on d.log.
+ grep '^%%HiResBoundingBox:' d.1 d.2
d.1:%%HiResBoundingBox: -1.5 -36.41 206.70006 206.70006 
d.2:%%HiResBoundingBox: -43.0636 -49.865 248.26366 220.15506 

[So the bounding boxes are different, very strange.]

$ cp -p d.mp dd.mp
$ md5sum d.mp dd.mp
10861e77922302129896d371b3fa51a8  d.mp
10861e77922302129896d371b3fa51a8  dd.mp

[So d.mp and dd.mp are identical.  But:]

$ testit dd
+ mpost -recorder dd
This is MetaPost, Version 0.901 (Web2C 7.5.3)
(dd.mp [1] [2] [3] [4] [5] [6] )
6 output files written: dd.1 .. dd.6
Transcript written on dd.log.
+ grep '^%%HiResBoundingBox:' dd.1 dd.2
dd.1:%%HiResBoundingBox: -1.5 -36.4101 206.70006 206.70006 
dd.2:%%HiResBoundingBox: -1.5 -36.4101 206.70006 206.70006 

[This time the bounding boxes are correct, and not the same as the
dd.* bounding boxes!]

$ diff d.1 dd.1 
3c3
< %%HiResBoundingBox: -1.5 -36.41 206.70006 206.70006 
---
> %%HiResBoundingBox: -1.5 -36.4101 206.70006 206.70006 

[d.2 and dd.2 have a lot more differences, but even the above change
is strange.]

$ sed 's/dd/d/' dd.fls | diff - d.fls
[ so they are reading and writing the same files except for the d->dd change]
$ ls -l /var/lib/texmf/web2c/mpost.mem
-rw-r--r--  1 root root 68028 2006-01-26 13:51 /var/lib/texmf/web2c/mpost.mem

[it's the one from running 'fmtutil-sys --refresh' after doing the
mpost upgrade, to regenerate all .mem files]

It's Debian's i386 tetex 3.0-13 packages with the mpost compiled from
source.

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
         --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.



More information about the metapost mailing list