[metapost] Use metaflow.mp in lualatex using mplib?

Daniel H. Luecking luecking at uark.edu
Mon Dec 1 21:32:29 CET 2014


Now I can truly say there was no problem whan I tried
compiling your MWE.

I have:
  LuaTeX, Version beta-0.79.1 (TeX Live 2014/W32TeX) (rev 4971)
  ...
  Compiled with libpng 1.6.10; using 1.6.10
  Compiled with zlib 1.2.8; using 1.2.8
  Compiled with poppler version 0.25.2
  Compiled with mplib version 1.902
  ...
  luamplib.sty    2014/07/04 v2.8.1 mplib package for LuaTeX
  luatexbase-modutils.sty    2013/05/11 v0.6 Module utilities for LuaTeX
  ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
  luatexbase-loader.sty    2013/05/11 v0.6 Lua module loader for LuaTeX
  luatexbase-compat.sty    2011/05/24 v0.4 Compatibility tools for LuaTeX

If you have some other version(s), the message looks like
there may be a problem with the expression (str @#) when
@# is empty. However, I don't know enough about metaflow
to suggest a work-around.

Cheers,

Daniel H. Luecking [luecking at uark.edu]
Graduate Coordinator
Department of Mathematical Sciences
1 University of Arkansas
Fayetteville, AR, USA 72701-1201

________________________________________
From: William Adams [will.adams at frycomm.com]
Sent: Monday, December 01, 2014 10:20 AM
To: Daniel H. Luecking
Cc: metapost at tug.org
Subject: Re: [metapost] Use metaflow.mp in lualatex using mplib?

On Nov 21, 2014, at 3:42 PM, Daniel H. Luecking wrote:

> Oops, I didn't notice the reference to mplib. Forget what I
> said about having no trouble. Still, an MWE would be useful.

Okay. I'm trying to do the first example.

It works as two separate files:

===========chart.mp============
input metaflow
prologues := 2;
filenametemplate "%j-%c.mps";
beginfig(1)
z1c = (0,0);
draw rect1(btex experiment etex);
putitem2 20right of 1;
draw oval2(btex results etex);
drawarrow connector(1,2,right,right);
putitems(2,3) like (1,2);
z3s = (55,30);
draw diamond3(btex evaluate etex);
drawarrow connector(2,3,right,right);
drawarrow connector1(3,1,down,up);
z4um = point 1.5 of cp1;
drawopen rect4(btex revise etex);
putitems(3,5) like (1,2);
drawopen rect5(btex success etex);
drawarrow connector(3,5,right,right);
endfig;
end
========end=chart.mp============

===========test.tex=============
\documentclass{article}
\usepackage{graphicx}
\begin{document}
Here is a nice diagram:
\begin{center}
\includegraphics
[width=.7\hsize]
{chart-1.mps}
\end{center}
\end{document}
========end=test.tex============

Trying to put them together and process them using lualatex and mplib:


\documentclass{article}
\usepackage{luamplib}
\begin{document}
Here is a nice diagram:
\begin{center}
\begin{mplibcode}
input metaflow
prologues := 2;
filenametemplate "%j-%c.mps";
beginfig(1)
z1c = (0,0);
draw rect1(btex experiment etex);
putitem2 20right of 1;
draw oval2(btex results etex);
drawarrow connector(1,2,right,right);
putitems(2,3) like (1,2);
z3s = (55,30);
draw diamond3(btex evaluate etex);
drawarrow connector(2,3,right,right);
drawarrow connector1(3,1,down,up);
z4um = point 1.5 of cp1;
drawopen rect4(btex revise etex);
putitems(3,5) like (1,2);
drawopen rect5(btex success etex);
drawarrow connector(3,5,right,right);
endfig;
\end{mplibcode}
\end{center}
\end{document}

fails w/ the error messages:

./testmpl.tex:27: LuaTeX error ...texlive/2013/texmf-dist/tex/luatex/luamplib/lu
amplib.lua:177: Module luamplib error:
(luamplib)
(luamplib)
(luamplib)
(luamplib)
(luamplib)
(luamplib)
(luamplib)
(luamplib) (./metaflow.mp)
(luamplib) ! Incomplete string token has been flushed.
(luamplib) <*> ...warrow connector(3,5,right,right); endfig;
(luamplib)
(luamplib)
(luamplib)
(luamplib) no-error

stack traceback:
[C]: in function 'error'
...xlive/2013/texmf-dist/tex/luatex/luatexbase/modutils.lua:26: in function 'mo
dule_error_int'
...xlive/2013/texmf-dist/tex/luatex/luatexbase/modutils.lua:49: in function 'er
r'
...texlive/2013/texmf-dist/tex/luatex/luamplib/luamplib.lua:177: in function <.
..texlive/2013/texmf-dist/tex/luatex/luamplib/luamplib.lua:169>
(...tail calls...)
[string "\directlua "]:1: in main chunk.
\ltxdomplibcodefinally ...luamplib.process(data) }
\end {mplibcode}\else \tok...
l.27 \end{mplibcode}

William

--
William Adams
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/metapost/attachments/20141201/dafc003f/attachment.html>


More information about the metapost mailing list