4 Jul 2011 21:02

## mplibcode inside a command?

Hi all,

I was wondering what would be the best way to pack metapost-code so I
can use a LaTeX-command to typeset it. But I fail due to fancy verb (I
guess …), assume the following code:

\documentclass{minimal}
\usepackage{luamplib}
\def\foo{
\begin{mplibcode}
beginfig(1)
draw (0,0) -- (7,2);
endfig
\end{mplibcode}
}
\begin{document}
\foo
\end{document}

This results in the error:

Paragraph ended before \FV <at> BeginScanning was complete.

So … any suggestions how I can circumvent that problem?

Thanks and cheers,
Arno



Gmane