12

Trying out another example I saw that with the metafun format (luatex version) the arrow tips are no longer filled. The following document (to be compile with lualatex) shows the problem:

\documentclass{article}
\usepackage{luamplib}
\begin{document}

\begin{mplibcode}
beginfig(1);
drawarrow (0,0)--(10,10);
endfig;
\end{mplibcode}

\mplibsetformat{metafun}
\begin{mplibcode}
beginfig(1);
drawarrow (0,0)--(10,10);
endfig;
\end{mplibcode}

\end{document}

enter image description here

I have the problem on windows with TeXlive 2016, 2017 and miktex. In TeXlive 2015 it worked correctly. If I copy the metafun files from texlive\2017\texmf-dist\metapost\context to texlive 2015 it fails there too.

Can someone reproduce the problem and has an idea what could be the source?

Edit

I identified a problematic definition in mp-tool.mpiv (but I don't know yet why the fillup doesn't work, in context there seem to be no problem):

\documentclass{article}
\usepackage{luamplib}
\begin{document}

\begin{mplibcode}
beginfig(1);
drawarrow (0,0)--(10,10);
endfig;
\end{mplibcode}

\mplibsetformat{metafun}
\begin{mplibcode}
beginfig(1);
drawarrow (0,0)--(10,10);
endfig;
\end{mplibcode}

\begin{mplibcode}
def mfun_draw_arrow_path text t =
    if autoarrows :
        set_ahlength(t) ;
    fi
    draw arrowpath mfun_arrow_path t ;
    fill arrowhead mfun_arrow_path t ; %changed fillup to fill
    endgroup ;
enddef ;
beginfig(1);
drawarrow (0,0)--(10,10);
endfig;
\end{mplibcode}

\end{document}

enter image description here

Edit 2

Imho some important code is missing (my guess is that in context it is in mlib-pdf.lua) and so luamplib needs to be updated.

Edit 3

On the metapost mailing list, Hans Hagen confirm that new code is needed. He wrote

i have added some code to the luatex-mplib.lua module and it works in plain now so when i post a new context beta someone has to make sure it's also used in latex

and I added an issue to https://github.com/lualatex/luamplib/issues/71

11
  • Same problem here using TeXlive 2017 on Linux Mint 18. – Sigur Dec 30 '17 at 19:32
  • You were previously right. I had some old Metafun files in my home texmf (don't remember how they landed there). I've just removed them and now I've got the same problem as you, with TeX Live 2017 (MacTeX)… – Franck Pastor Dec 30 '17 at 19:54
  • Not an idea about the source of the problem, but here is a workaround: to use the mparrows package and issue the setarrows(default); command. The arrow head is then filled, as it should. ctan.mines-albi.fr/graphics/metapost/contrib/macros/mparrows/… – Franck Pastor Dec 30 '17 at 20:01
  • I took the liberty to send a message to the MetaPost mailing list, telling them about this problem. I'm curious about the answers… – Franck Pastor Dec 30 '17 at 20:15
  • 4
    I'm voting to close this question as off-topic because this question is about a bug which has since been fixed. – Henri Menke May 13 '18 at 5:47

Browse other questions tagged or ask your own question.