In MetaPost, the following code produces
2 "textual" "textual"
as expected.
% Begin code %
picture pct;
pct:=btex{a\,b}etex;
show length pct;
for tkn within pct:
for str="bounded", "clipped", "filled", "stroked", "textual":
if scantokens str tkn: show str; fi
endfor
endfor
beginfig(0)
endfig;
end
% End code %
However, using luamplib (with lualatex), the following code produces
1 "stroked"
which is unexpected.
\begin{mplibcode}
picture pct;
pct:=btex a\,b" etex;
show length pct;
for tkn within pct:
for str="bounded", "clipped", "filled", "stroked", "textual":
if scantokens str tkn: show str; fi
endfor
endfor
beginfig(0)
endfig;
\end{mplibcode}
Why does luamplib indicate that the btex/etex has length 1, and why does
that picture have only 1 stroked token?
Troy Henderson