> > > > Hello,
> > > >
> > > > Is it possible to generate multi-line labels in MetaPost?
I have
> > > > naively tried the following hoping to get a line feed
between the
> > > > two words, but it doesn't work!
> > > >
> > > > label.rt( btex One \crlf Two etex, (0,0));
> > >
> > > \defineframed[mplabel][frame=off,align=right,width=fit]
> > >
> > > label.rt(textext("\mplabel{One\\Two}"),origin)
;
> > >
> > > Wolfgang
> >
> > Thank-you for a very elegant solution, Wolfgang, unfortunately
I
> get an error:
> >
> > ! Argument of \dododefinecolor has an extra }.
> >
> > I have fixed this by using:
> >
> > label.rt(textext("\framed[frame=off,align=right]{One\\Two}"),origin);
> >
> > which works okay. It's not as elegant but as the code is generated
> > automatically it does not require any more typing on my part!
>
> Section 4.2 of Mojca's MyWay on sometxt
> http://dl.contextgarden.net/myway/sometxt.pdf
provides another solution.
>
> Aditya
For the record, after reading Mojca's MyWay, and noting
that textext is deprecated
except in certain circumstances, I have ended up with
the following:
\definetextext[mplabel]{\framed[frame=off,align=right,width=fit]}
\startMPcode
label.rt(\sometxt[mplabel]{One\\Two},origin);
\stopMPcode
Thanks everyone.
Richard
Converteam UK Ltd. Registration Number: 5571739 and Converteam Ltd. Registration
Number: 2416188
Registered in England and Wales.
Registered office: Boughton Road, Rugby, Warwickshire, CV21 1BU.
CONFIDENTIALITY : This e-mail and any attachments are confidential and
may be privileged. If you are not a named recipient, please notify the
sender immediately and do not disclose the contents to another person,
use it for any purpose or store or copy the information in any medium.
Please consider the environment before printing this e-mail