[metapost] Multiple line LaTeX

Stephan Hennig mailing_list at arcor.de
Sun Feb 22 12:50:04 CET 2009


Steve Checkoway schrieb:
> As an example of the usage, foo.mp contains:
> 
> input latexmp;
> input latexmphelper;% The above code and a call to setupLaTeXMP
> prologues:=3;
> beginfig(0);
> % The vbox is because \shipout\hbox is used to write the text.
> label( texmultiline("\vbox{\begin{verbatim}",
> 		    "This is some",
> 		    "verbatim text.",
> 		    "\end{verbatim}",
> 		    "}"), (0,100) );
> label( texmultiline("\begin{lstlisting}",
> 		    "ld sp,hl",
> 		    "ret",
> 		    "\end{lstlisting}"), (0,50) );
> label( texmultiline("\def\blah{4}%",
> 		    "\ifnum\blah=0 zero\else nonzero\fi"), origin );
> endfig;
> end

Nice!

Jens-Uwe, would it be possible to add this to the latexmp package?

Taco et al., does mplib offer better ways to handle this situation?

Best regards,
Stephan Hennig


More information about the metapost mailing list