I am trying to use the metaflow
macro set for metapost
. It and its documentation can be obtained from:
https://personal.utdallas.edu/~hamlen/projects.html
The relevant definition that I'm having some trouble with is
538 vardef connector@#(suffix $,$$)(expr dsrc,ddst) =
539 if (str @#)="":
540 numeric x[]cp.tmp, y[]cp.tmp;
541 path cp.tmp;
542 _connector.tmp
543 else:
544 if known cp@#:
545 errmessage("redundant connector name: " & (str @#));
546 fi;
547 _connector@#
548 fi($,$$,dsrc,ddst)
549 enddef;
Which is expecting a pair of suffixes for the first two arguments. Is there any way that I can pass the values of some variables to this macro? I tried expandafter
s but failed.
\documentclass{article}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
input metaflow.mp;
beginfig(0);
z1c=origin;
z2c=(5cm,0);
draw rrect1("1");
draw rrect2("2");
%draw connector(1,2,right,right);% <=====works
a:=1;
b:=2;
draw connector(a,b,right,right);
endfig;
\end{mplibcode}
\end{document}
scantokens("draw connector(" & decimal a & "," & decimal b & ",right,right);");
? (untested)