[metapost] Question: [MPLib, MetaFun, ConTeXt, LuaTeX] metapost logging and message primitive?

Hans Hagen pragma at wxs.nl
Tue Feb 26 09:18:14 CET 2013

On 2/26/2013 7:39 AM, Colin Fraizer wrote:
> Aditya, thank you for your kind response. I fear I did not completely
> understand it, being Lua-illiterate.
> My problem (this is mostly contextual information):
> 1. I have a METAPOST program of modest complexity that runs fine with
>     regular mpost version 1.504 (from TeXLive 2012).

keep in mind that mp's after that date are somewhat different in the 
sense that they have scaled and double mode and that (unless you use the 
really latest version) there are bugs

> 2. I would like to use ConTeXt to generate both my figures and my
>     document. (Two reasons: I'd prefer a single source file and I would
>     like to be able to use OpenType fonts in my labels.)
> 3. When run within ConTeXt, my document fails to generate the correct
>     figure.  I suspect this is because of the "extrapass" mechanism,
>     but it is difficult to tell for sure without being able to see the
>     METAPOST logging.

so, do you have a small example showing this problem?

> 4. When running with TeXLive 2012's ConTeXt, "loggingall;" didn't
>     work.
> 5. I installed stand-alone ConTeXt which improved some things, but
>     generated only blank figures when "loggingall;" or "tracingall;
>     tracingonline:=0;" was added to the METAPOST.  If
>     "tracingonline:=1;" is added, then the figures contain the
>     appropriate graphics. Most importantly, the log files and the
>     screen show all the METAPOST info I need.
> BOTTOM LINE (i.e., the problem I currently face):
> When "tracingonline:=1;", the program runs unbearable slower! A run
> that takes 20 seconds in stand-alone METAPOST takes more than AN HOUR
> in ConTeXt. I believe much of this is related to I/O and occurs even
> when the STDOUT is redirected to /dev/null (CygWin) or NUL: (Windows
> CMD equivalent).


is probably faster to get the raw mp code

> Does anyone know of a way to:
> 1. make ConTeXt/MPLIB *not* generate blank figures when "loggingall;"
>     is used; AND/OR

not without example

> 2. make "tracingall;" not take *forever*?

it all depends on how much expansion goes on; using tracingall only 
makes sense for small bits of code


                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl

More information about the metapost mailing list