[metapost] a problem of label when using metapost

Nicola nvitacolonna at gmail.com
Thu Nov 17 11:58:40 CET 2011


In article 
<CAAzVxgP5WjYR7N27LKyjkh5mSR0z2M1nxiYjfYkO-xjP3UEgLQ at mail.gmail.com>,
 source liu <sourceonly at gmail.com> wrote:

> Its really nice of you
> 
> > A minimal MetaPost file for me using LaTeX labels and embedding fonts (so 
> > that
> > the resulting output is self-contained) might look like:
> 
> > === begin cut here ===
> >
> > prologues:=3;
> > verbatimtex
> > %&latex
> > \documentclass{minimal}
> 
> which i used is *article* or *book* rather than
> yours minimal,  and i do find reference on manuals or blogs
> to support my choice.
> 
> 
> > \begin{document}
> > etex
> 
> almost the same, expect for my prologue goes here, after etex.
> 
> 
> > beginfig(0);
> > ...
> > label(btex *somethinghere* etex,origin);
> > ...
> > endfig;
> >
> > end
> >
> > === end cut here ===
> 
> 
> > This should work.  If it doesn't you might try manually making sure that 
> > MetaPost
> > is being called to use LaTeX to typeset the labels by
> >
> > mpost -tex=latex foo.mp
> 
> i've tried it,  it halt when it first came to \documentclass, it seem
> not to recognize the control
> sequence.

Going on guessing: which version of mpost are you using? If by chance it happens 
to be 1.501, note that mpost 1.501 has a bug related to %&latex, which you 
circumvent by either passing '-tex latex' to mpost, or write

verbatimtex%&latex

without any space between verbatimtex and %&. Note that this is exclusive or: if 
you pass '-tex latex' on the command line, remove %&latex from the source file.

Nicola



More information about the metapost mailing list