[luatex] METAPOST labels in Lualatex: illegal unit of measure

Dohyun Kim nomosnomos at gmail.com
Fri May 3 03:18:47 CEST 2013

2013/5/3 Jean <J2N-FORGET at orange.fr>:
> When I typeset the following file:
> --- beginning of copy-paste
> \documentclass[a4paper]{article}
> \usepackage{luamplib}
> \begin{document}
> \begin{mplibcode}
> beginfig(1);
> z0 = ( 0, 40); dotlabel.top("Solar noon", z0);
> z1 = ( 0, 20); dotlabel.top("Mean noon",  z1);
> z2 = (80, 40); dotlabel.top("Midi solaire",  z2);
> z3 = (80, 20); dotlabel.top("Midi moyen",  z3);
> z4 = (80,  0); dotlabel.top("J 90",  z4);
> z5 = ( 0,  0); dotlabel.top("J+90",  z5);
> endfig;
> \end{mplibcode}
> \end{document}
> --- end of copy-paste
> I obtain a curious result with the "Midi moyen" and
> "J+90" string: first they trigger two error messages each,
> then they appear in the PDF file with "e-05 bp" unwanted
> prefix. And because of this prefix, the label is not centered
> as it should be.
> The two error messages are:
> ! Illegal unit of measure (pt inserted).
> ! A <box> was supposed to be here.

This issue seems to be caused by the inclusion of lua 5.2 into new
luatex engine. In the end, there should be an update of luamplib
package to fix this.

For the time being, you can use luatexko-mplib which I uploaded to
another mainling list to suggest an adoption into luamplib.  Download
the attchment at
and change the line \usepackage{luamplib} into
then recompile it.  I get no error message.

BTW, without \usepackage{fontspec}, I get "undefined control sequence"
error at \pdfstrcmp. I haven't noticed that before, as I always loaded
fontspec package. However, fontspec is a too heavy a package for
\pdfstrcmp command only. Could anybody tell me what package is
suitable for this purpose? I tried \usepackage{pdftexcmds}, but of no

Dohyun Kim

More information about the luatex mailing list