[luatex] luamplib + picture
nomosnomos at gmail.com
Tue May 26 15:23:53 CEST 2015
2015-05-26 20:57 GMT+09:00 Troy Henderson <thenders at gmail.com>:
> Why does luamplib indicate that the btex/etex has length 1, and why does
> that picture have only 1 stroked token?
btex ... etex is not allowed in mplib module. If you try to use that
in an mplib session, you will get an error message such as:
! You can only use `btex' or `verbatimtex' in a file.
Therefore, you can only use an independent .mp file to get a textual
element from btex ... etex.
As a workaround to use btex ... etex, luamplib has a code as follows
that translates btex ... etex into a unitsquare picture:
image( addto currentpicture doublepath unitsquare; ) ...
and after the end of mplib session, luamplib replaces the unitsqaure
picture with a relevant TeX box which is scaled and/or transformed
according to the result of scaling and transformation of the
In a word, btex ... etex is just a unitsqaure in the eyes of mplib
module; ie. 1 stroked element.
AFAIK, the only way to get a textual picture in an mplib session is
using infont operator:
pct:="a b" infont "cmr10";
But in this case you would get just one textual element, not two.
Seoul, Republic of Korea
More information about the luatex