[metapost] a problem of label when using metapost

source liu sourceonly at gmail.com
Thu Nov 24 04:45:31 CET 2011

On Thu, Nov 24, 2011 at 3:14 AM, Dan Luecking <luecking at uark.edu> wrote:
> At 08:25 PM 11/23/2011, Source Liu wrote:
>> Hi all
>> Now i'm wondering whether it is possible to use enumerate in metapost. (i
>> mean, like \begin{enumerate} in latex, which automatic enum the coming item
>> a number).
>> I used the
>> ==============================
>> verbatimtex
>> \documentclass{article}
>> \begin{document}
>> \begin{enumerate}
>> etex
>> *somethings here*
>> verbatimtex
>> \end{enumerate}
>> \end{document}
>> etex
>> ==============================
>> after that, I tried to set a new counter, which still failed to work.
> You can use enumerate, provided the entire enumerate environment
> is in a \parbox and that is inside a single btex/etex.
> If you want separate btex/etex groups to be sequentially numbered,
> then you will have to arrange for the numbering your self.
> For example:
> ============================
> verbatimtex
>  \documentclass{article}
>  \newcounter{mynum}
>  \newcommand{\nextmynum}{\stepcounter{mynum}\themynum}
>  \begin{document}
> etex
> % somethings here
> label(btex \nextmynum. First item. etex, z1);
> % something else
>  label(btex \nextmynum. Second second. etex, z2);
> % etc.
> end
> ============================

Yes, you always on my point, cheer!
I did this as your recommended.
The solution is almost the same at my first thought,  if this could work,
then i must have something error in setting up my utility counter.

It make sense.

Thank you!!

> Note: there is no need to put \end{document} in your metapost
> file. Metapost adds that automatically.

expect for the environment {CJK}, you know, CJK encoding is always
bringing in something strange problems, which
you would never get evolved, but at least it do support Chinese.

Btw, my rxvt displays sucks even with rxvt-unicode, there are two many
encode, (gb2312, gb18030, UTF8, etc), thus my
mutt hasn't got all things done in showing Chinese characters right.
( Of course, little business to do with metapost, this topic ^_^)

Thus I keep a habit to end the CJK environment if I need to type in
some Chinese.

Btw, I'd like to close something myself, even their is an automatic way.  :)

> Regards,
> Dan
> Daniel H. Luecking
> Department of Mathematical Sciences
> Fayetteville, Arkansas
> http://www-cs-faculty.stanford.edu/~knuth/iaq.html

Liu An
Institution of modern physics, Shanghai, China

More information about the metapost mailing list