Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say "thank you" to users who helped you. –  Martin Schröder Feb 20 '13 at 8:30

1 Answer 1

up vote 11 down vote accepted

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
share|improve this answer
    
that is only the default log and not really a debugging like \loggingall –  Herbert Feb 20 '13 at 8:38
    
that also gives also no metapost output. Compare it with a mpost <file>.mp –  Herbert Feb 20 '13 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 Feb 20 '13 at 10:25
    
I used the context from TL2012 and there are no infos about mpost in the logfile –  Herbert Feb 20 '13 at 11:06
    
@Herbert Confirmed, no log output on 2012.05.30 11:26. It works with a current version 2013.02.19 19:38. –  Marco Feb 20 '13 at 12:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.