3

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.

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

1 Answer 1

2

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}

enter image description here

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
1
  • 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.
    – WillAdams
    Dec 26, 2016 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.