I am trying to get the luamplib to work with the luatex-plain -format.

I installed BasicTeX2014, and then did tlmgr install context. Then I did luatex --ini /usr/local/texlive/2014basic/texmf-dist/tex/generic/context/luatex/luatex-plain.tex, and moved the generated .fmt to ~/Library/texlive/2014basic/texmf-var/web2c/luatex. I already had a soft link in my ~/bin/luatex-plain to /usr/texbin/luatex from last year.

Now, with a TeX document such as

label.rt("sup", origin);


I get Illegal unit of measure (pt inserted). in the log file, pointing to the expansion of the macro \MPLIBtextext as

l.4 ...{s}\hbox{u}\hbox{p}}{0}{-2.9448582181895e-05}

Surrounding the sup with btex/etex instead of double quotes, I get an error message informing me I should use those only with files, so I assume double quotes is the way to go.

Can you tell if I am doing something wrong here?

  • 1
    Your example compiles without error on a fresh MacTex installation (ie the whole 2.3G bytes of TL2014), so it looks like BasicTex is missing something else you need. Did you install luamplib? Any reason you can't do a full install?
    – Thruston
    Jul 21, 2014 at 22:22
  • @Thruston: I think luamplib is included via the luatex-plain format. I don't have very much disk space, so I'd rather not install 2.3Gb of stuff I won't be doing anything with.
    – morbusg
    Jul 22, 2014 at 9:34

1 Answer 1


I've been using the following for mplib with OpenType fonts in luatex (no format):

\input luaotfload.sty
\input luamplib.sty
%\mplibsetformat{metafun} % optional use of metafun extensions

label.rt(btex sup etex, origin);
label.top("test", origin);

%%%% Example Using an OpenType font %%%%
\font\bigfont = "[texgyreschola-regular]:mapping=tex-text;script=latn;+tlig" at 20pt

\mplibtextextlabel{enable} % use current font for label text

label.rt("bigtest", origin);


When trying to use the luatex-plain format, I received the same error as you. I get the impression that the .sty files are the most current way to use mplib and opentype fonts with luatex, though I could be wrong.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .