[luatex] TexLive 2012 LuaLaTeX segmentation fault

Taco Hoekwater taco at elvenkind.com
Mon Jul 23 10:08:36 CEST 2012


Hi,

On 07/22/2012 01:00 PM, Dirk Laurie wrote:
> I have Ubuntu 12.04 without any TeX package.  All my TeX is off the DVD
> image downloaded from tug,org, installed by tl-install with default settings.

> The binaries are i386-linux.

This crash is a mplib bug, and as such not really a lualatex problem
(it would happen in any case).

> This is the input file 'sample.tex':
>
> \documentclass{article}
> \begin{document}
> \directlua{
>    mp=mplib.new{}
>    mp:execute[[
> beginfig(1);
> fill fullcircle scaled 5cm withcolor green;
> draw fullcircle scaled 4.5cm;
> endfig;
> ]]}
> \end{document}

Sorry about the crash, but this won't work, ever. Mplib does not know
out of the box how to find input files that are not in the current
directory. You'll need to write a find_file function for it. The
simplest solution looks like this:

\documentclass{article}
\begin{document}
\directlua{
   local function find(a) return kpse.find_file(a,'mp') end
   mp=mplib.new{mem_name = find('plain'),
                find_file = find}
   mp:execute[[
beginfig(1);
fill fullcircle scaled 5cm withcolor green;
draw fullcircle scaled 4.5cm;
endfig;
]]}
\end{document}

Even so, this will not actually output anything. You need to intercept
the generated results and convert those into pdf operators also. All in
all, it is much easier to use a package like luamplib:

\documentclass{article}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
fill fullcircle scaled 5cm withcolor green;
draw fullcircle scaled 4.5cm;
\end{mplibcode}
\end{document}

Best wishes,
Taco




More information about the luatex mailing list