11

I have a METAPOST program that works fine with mpost, but fails when I try to run it inline in ConTeXt. In order to debug it, I would like to see the usual METAPOST logging and/or to use the METAPOST "message" primitive.

However, whenever I add "loggingall;" or a message statement to my ConTeXt file, I encounter errors like this

metapost        > initializing instance 'metafun' using format 'metafun'
metapost        > loading 'metafun': D:/texlive/2012/texmf-dist/metapost/context/base/metafun.mpiv
! terminal:

What is the appropriate way to debug problems with inline METAPOST code in ConTeXt?

My example file is:

\loggingall

\starttext
\framed{Hello world.}
This is a simple_test.

\startMPpage
loggingall;
fill fullcircle scaled 1in withcolor blue;
label.top(btex This is a test. etex, origin);
\stopMPpage

\stoptext

I am using TeXLive 2012 on Windows.

I apologize for any vagueness in this question. I’m not really sure how the various pieces fit together.

1

1 Answer 1

12

By default MetaPost does not display the messages injected with message. However, the messages can be enabled using \enabletrackers.

To enable verbose debug output use tracingall, which prints plenty of debugging output to the console and the log file. Here's a complete example:

\enabletrackers
  [metapost.showlog]

\starttext
  \startMPpage
    tracingall;
    message "This is a debug message.";
    fill fullcircle scaled 1in withcolor blue;
    label.top(btex This is a test. etex, origin);
  \stopMPpage
\stoptext
13
  • that is only the default log and not really a debugging like \loggingall
    – user2478
    Commented Feb 20, 2013 at 8:38
  • that also gives also no metapost output. Compare it with a mpost <file>.mp
    – user2478
    Commented Feb 20, 2013 at 10:16
  • @Herbert On my system I get a 23K log file with plenty of info. The message shows up as well as all assignments. What exactly is missing?
    – Marco
    Commented Feb 20, 2013 at 10:25
  • I used the context from TL2012 and there are no infos about mpost in the logfile
    – user2478
    Commented Feb 20, 2013 at 11:06
  • 1
    @Herbert Confirmed, no log output on 2012.05.30 11:26. It works with a current version 2013.02.19 19:38.
    – Marco
    Commented Feb 20, 2013 at 12:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .