[NTG-context] Can't use MetaFun with mplib anymore

luigi scarso luigi.scarso at gmail.com
Thu Mar 14 08:51:10 CET 2019


On Thu, Mar 14, 2019 at 5:56 AM Henri Menke <henrimenke at gmail.com> wrote:

>
> Dear list,
>
> Something has changed in MetaFun and it can no longer be used in plain
> LuaTeX,
> with neither of
>
>     luatex test.tex
>     mtxrun --script plain test.tex
>
> This is the error:
>
>     >> LUATEXFUNCTIONALITY
>     >> "mp.print(LUATEXFUNCTIONALITY)"
>     ! Equation cannot be performed (numeric=string).
>
> MWE is below, as always.
>
> Cheers, Henri
>
> ---
>
> \directlua{
> local mpkpse = kpse.new(arg[0], "mpost")
>
> local function finder(name, mode, ftype)
>     if mode == "w" then
>         return name
>     else
>         return mpkpse:find_file(name,ftype)
>     end
> end
>
> local mpx = mplib.new {
>     find_file = finder
> }
> local ret = mpx:execute[[
> boolean mplib ; mplib := true ;
> input metafun.mp ;
> ]]
>
> print(ret.log)
> }
> \bye
>
>
in mp-mlib.mpiv it seems that we should have
string  LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY :=
runscript("mp.print(LUATEXFUNCTIONALITY)") ;
instead of
numeric LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY :=
runscript("mp.print(LUATEXFUNCTIONALITY)") ;

Now I have
tex/texmf-context/metapost/context/base/mpiv$ grep -r LUATEXFUNCTIONALITY
mp-mlib.mpiv:%numeric LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY :=
runscript("mp.print(LUATEXFUNCTIONALITY)") ;
mp-mlib.mpiv:string  LUATEXFUNCTIONALITY ; LUATEXFUNCTIONALITY :=
runscript("mp.print(LUATEXFUNCTIONALITY)") ;

and your example looks ok.

-- 
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20190314/72f1a49e/attachment-0001.html>


More information about the ntg-context mailing list