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.

The same error happens with "label" instead of "dotlabel" and
with any other position ("bot", "rt", "llft", etc) instead
of "top".

A wild guess: all labels are preceded with a length string such
as "0pt", "1bp", "2cm" and the like. For some reason, the computation
for "Midi moyen" and "J+90" does not yield exactly 0, but 
1/100000 bp. So this generates a prefix "1e-05 bp" instead of
"0 bp". Then, the interpreter scans the string "1e-05 bpJ+90",
extracts the number 1 and then gags on the "e", which it cannot
interpret as a length unit. So, as explained in the log file,
the interpreter insert its preferred unit "pt" and rescans
the updated string "1pte-05 bpJ+90", extract the length
prefix "1pt" and typeset the remainder of the string "e-05 bpJ+90".

This error happens with a recent version of luatex:

--- beginning of copy-paste
This is LuaTeX, Version beta-0.76.0-2013042400  (TeX Live 2013) (rev
4627)

Execute  'luatex --credits'  for credits and version details.

There is NO warranty. Redistribution of this software is covered by
the terms of the GNU General Public License, version 2 or (at your
option)
any later version. For more information about these matters, see the
file
named COPYING and the LuaTeX source.

Copyright 2013 Taco Hoekwater, the LuaTeX Team.
--- end of copy-paste

With an older version of luatex (from the Ubuntu 12.04 repository),
there
is a Lua error about an invalid argument sent to the "format" function
within the "module_log" function in modutils.lua, but since I have
installed the version above, I am more concerned with the
"e-05 bp" bug.

I have searched the Metapost mailing-list archive at
http://tug.org/pipermail/metapost/
and the Luatex mailing-list archive at
http://tug.org/mailman/mmsearch/luatex
with "illegal unit measure", and I have found nothing.

I include the source file and the log file if you want
to experiment.

So what is the problem? Does anyone know how to fix it?

Thank you in advance,

Jean Forget
% -*- encoding: utf-8 -*-
\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}
This is LuaTeX, Version beta-0.76.0-2013042400 (rev 4627)  (format=lualatex 2013.5.1)  2 MAY 2013 18:42
 restricted \write18 enabled.
**bug-mp.tex
(./bug-mp.tex
LaTeX2e <2011/06/27>
LuaTeX adaptation of babel <v3.8m-luatex-1.5> and hyphenation patterns for engli
sh, dumylang, nohyphenation, loaded.
(/home/jf/tex-live/2013/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/home/jf/tex-live/2013/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/home/jf/tex-live/2013/texmf-dist/tex/luatex/luamplib/luamplib.sty
Package: luamplib 2011/12/09 v1.09 mplib package for LuaTeX

(/home/jf/tex-live/2013/texmf-dist/tex/luatex/luatexbase/luatexbase-modutils.st
y
Package: luatexbase-modutils 2013/04/13 v0.5 Module utilities for LuaTeX
 (/home/jf/tex-live/2013/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX detected.
)
(/home/jf/tex-live/2013/texmf-dist/tex/luatex/luatexbase/luatexbase-loader.sty
Package: luatexbase-loader 2013/04/13 v0.5 Lua module loader for LuaTeX

(/home/jf/tex-live/2013/texmf-dist/tex/luatex/luatexbase/luatexbase-compat.sty
Package: luatexbase-compat 2011/05/24 v0.4 Compatibility tools for LuaTeX
)
(/home/jf/tex-live/2013/texmf-dist/tex/luatex/luatexbase/luatexbase.loader.lua))
(/home/jf/tex-live/2013/texmf-dist/tex/luatex/luatexbase/modutils.lua))
(/home/jf/tex-live/2013/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
Package: fancyvrb 2008/02/07

Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix 
<2008/02/07> (tvz)
(/home/jf/tex-live/2013/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
)
\FV@CodeLineNo=\count87
\FV@InFile=\read1
\FV@TabBox=\box26
\c@FancyVerbLine=\count88
\FV@StepNumber=\count89
\FV@OutFile=\write3
)
(/home/jf/tex-live/2013/texmf-dist/tex/luatex/luamplib/luamplib.lua)
Lua module: luamplib 2011/11/09 1.09 Lua package to typeset Metapost with LuaTeX
's MPLib.
\mplibscratchbox=\box27
)
(./bug-mp.aux)
LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
luamplib: flushing figure 1
! Illegal unit of measure (pt inserted).
<to be read again> 
e
l.18 \end{mplibcode}
                  
? 
! A <box> was supposed to be here.
<to be read again> 
e
l.18 \end{mplibcode}
                  
? 
! Illegal unit of measure (pt inserted).
<to be read again> 
e
l.18 \end{mplibcode}
                  
? 
! A <box> was supposed to be here.
<to be read again> 
e
l.18 \end{mplibcode}
                  
? 
[1

{/home/jf/tex-live/2013/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./bug-mp.aux) )

Here is how much of LuaTeX's memory you used:
 716 strings out of 494762
 100000,89155 words of node,token memory allocated
 263 words of node memory still in use:
   2 hlist, 1 vlist, 1 rule, 2 glue, 40 glue_spec, 1 write nodes
   avail lists: 1:1,2:12,3:49,4:50,6:63,7:1,9:70
 4415 multiletter control sequences out of 65536+600000
 21 fonts using 599119 bytes
 39i,4n,21p,172b,110s stack positions out of 5000i,500n,10000p,200000b,100000s
</home/jf/tex-live/2013/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on bug-mp.pdf (1 page, 14801 bytes).

PDF statistics: 12 PDF objects out of 1000 (max. 8388607)
 7 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 131072)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

Reply via email to