# Are there any limitations / changes of mplib vs. METAPOST?

Checked http://www.ntg.nl/maps/36/16.pdf and http://www.tug.org/metapost/src/manual/mplibapi.pdf and not seeing a list of differences, and as @egreg noted, there shouldn't be any.

Posted the following:

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

%filecontents:  parameters.txt
%a=100;
%b=133;
%t=6.35;
%m=12.35;

\begin{mplibcode}
beginfig(1);

input parameters.txt

draw (0, 0)--(b, 0)--(b, a)--(b, 0)--cycle;

endfig;

\end{mplibcode}
\end{document}


And it didn't work.

Turns out it didn't work due to a stupid error on my part (failed to consider that the two tools I'm trying to integrate use different characters for comments). Fixed (and my thanks to @egreg for proving it was my stupid error).

I would still like to know if there are any differences --- suspecting not, but the confirmation would be nice. Edited the title to reflect this, leaving the balance up as a monument to my stupidity. Re-edited, to make clear that it was entirely my mistake.

• I don't think there's any difference: the mpost program is now just an interface to the mplib library. Dec 26, 2016 at 14:16
• glyph didn't work until a very recent build. Dec 27, 2016 at 9:21
• show goes to log only not to terminal. Dec 27, 2016 at 9:24

This is what I get from this input file (TeX Live 2016):

\begin{filecontents*}{parameters.mp}
a=100;
b=133;
t=6.35;
m=12.35;
\end{filecontents*}

\RequirePackage{luatex85}
\documentclass[border=10]{standalone}
\usepackage{luamplib}

\begin{document}

\begin{mplibcode}
beginfig(1);
input parameters.mp;
draw (0, 0)--(b, 0)--(b, a)--(0, a)--cycle;
draw (0, 0)--(b, a);
endfig;
\end{mplibcode}

\end{document}


If I add show a; after input parameters.mp;, the log file shows

Module luamplib Info:
(luamplib)            (Please type a command or say end')
(luamplib)
(luamplib)            (./parameters.mp)
(luamplib)            >> 100
(luamplib)
(luamplib)
(luamplib)            [1]
(luamplib)            (Please type a command or say end')
(luamplib)            on input line 21

• Thanks! Turns out I'd forgotten to account for the other tool which I'm using using // for comments --- fixed and was just coming to edit my query. Dec 26, 2016 at 14:10