[luatex] Reusable Code (LuaLaTeX + LuaMPlib)
Dohyun Kim
nomosnomos at gmail.com
Thu Jun 1 14:19:47 CEST 2017
2017-05-31 11:37 GMT+09:00 Troy Henderson <thenders at gmail.com>:
> Apologies, but I forgot to paste my code. Here it is:
>
> \documentclass{article}
> \usepackage{luamplib}
>
> \mplibtextextlabel{enable}
> \mplibcodeinherit{enable}
>
> \begin{document}
> \begin{center}
> \begin{mplibcode}
> picture p;
> beginfig(0);
> draw (-36,0)--(36,0);
> label.bot(textext("Hello"),origin);
> p:=currentpicture;
> endfig;
> \end{mplibcode}
> \end{center}
>
> \begin{center}
> \begin{mplibcode}
> beginfig(1);
> currentpicture:=p;
> endfig;
> \end{mplibcode}
> \end{center}
>
> \end{document}
Please download and unzip:
https://github.com/lualatex/luamplib/releases/download/v2.12.0/luamplib.tds.zip
Then grab luamplib.{sty,lua} and drop them into current working directory.
Insert the following line in the preamble of source TeX file:
\mplibglobaltextext{enable}
If no problem found, I will upload the new release to ctan in a few days.
--
Dohyun Kim
Seoul, Republic of Korea
More information about the luatex
mailing list