[metapost] Bug with in-box test alignment

luigi scarso luigi.scarso at gmail.com
Fri Dec 31 19:09:18 CET 2021


On Fri, Dec 31, 2021 at 6:51 PM Sebastiano Vigna <sebastiano.vigna at unimi.it>
wrote:

>
>
> > On 30 Dec 2021, at 01:02, luigi scarso <luigi.scarso at gmail.com> wrote:
> >
> > > On 29 Dec 2021, at 07:42, Sebastiano Vigna <sebastiano.vigna at unimi.it>
> wrote:
> > >
> > > The following Metapost program
> > >
> > > outputtemplate := "%j-%c.mps";
> > >
> > > input boxes
> > >
> > > beginfig(1);
> > >       circleit.n0(btex $0$ etex);
> > >       drawboxed(n0)
> > > endfig;
> > >
> > > bye
> > >
> > >
> > > generates a circle with a 0 label inside, but the label is not
> centered (I'm converting the output of Metapost with mptopdf).
>
> > You can test with
> > mpost -debug test.mp
> > that preserves temp. files
>
> Thanks, that highlighted the problem:
>
> 1,2c1,2
> < \gdef\mpxshipout{\shipout\hbox\bgroup%
> <   \setbox0=\hbox\bgroup}%
> ---
> > \gdef\mpxshipout{\shipout\hbox\bgroup
> >   \setbox0=\hbox\bgroup}
>
> For some reason, one installation (Linux) puts a % at the end of these two
> lines, the other (MacPorts) doesn't. The result is a space in the output
> that moves the label out of place. The difference propagates to the dvi
> files.
>
> This the difference of the dvi files generated by the temporary dvi files
> passed through dvitomp:
>
> < setbounds _p to (0,0.0000)--(4.9813,0.0000)--
> <  (4.9813,6.4204)--(0,6.4204)--cycle;
> ---
> > setbounds _p to (0,0.0000)--(8.3022,0.0000)--
> >  (8.3022,6.4204)--(0,6.4204)--cycle;
>
> This appears to be a difference in behavior of Metapost, but I really do
> not know what to do next. Does this ring any bell? Maybe there's a subtle
> web2c configuration option that is different in the two installations?
>

aha... it was a bug introduced with a patch of mine to mpx_copy_mpto for
troff.
But Metapost 2.01 in TeXLive 2021 should be ok....  perhaps MacPorts has an
old version ?


-- 
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/metapost/attachments/20211231/59aa6a66/attachment.html>


More information about the metapost mailing list.