lualatex / luamplib

generic TeX package - including MetaPost code in LuaTeX documents
http://ctan.org/pkg/luamplib
16 stars 11 forks source link

Fix compat with Lua 5.3 based LuaTeX #77

Closed minux closed 5 years ago

minux commented 5 years ago

dash pattern offset is very likely not an integer, so use %f instead of %i to format it.

To reproduce this problem, use LuaTeX built with lua 5.3 to build the following plain TeX file:

\input luamplib.sty
\mplibcode
beginfig(0);
draw ((0,0)--(100,100)) dashed withdots;
endfig;
\endmplibcode
\end
dohyunkim commented 5 years ago

Thank you for testing against Lua 5.3, which I've not tried yet. BTW, ConTeXt is using %.6F instead of %f. See https://github.com/contextgarden/context-mirror/blob/beta/tex/context/base/mkiv/mlib-pdf.lua#L59 . How do you think about it?

minux commented 5 years ago

I've chosen %f to match with what the rest of the file is using, though.

https://github.com/lualatex/luamplib/blob/53e3c08ac20b04068ce7a94e72207414d5f7f877/luamplib.dtx#L921