From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/52288 Path: news.gmane.org!not-for-mail From: richard.stephens@converteam.com Newsgroups: gmane.comp.tex.context Subject: Re: Multi-line labels in MetaPost Date: Fri, 14 Aug 2009 09:54:14 +0100 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0662410400==" X-Trace: ger.gmane.org 1250240122 16628 80.91.229.12 (14 Aug 2009 08:55:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Aug 2009 08:55:22 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Aug 14 10:55:15 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.50) id 1MbsZ2-0003Nu-I2 for gctc-ntg-context-518@m.gmane.org; Fri, 14 Aug 2009 10:55:08 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DC651C9AAD; Fri, 14 Aug 2009 10:55:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id a-d5aClI+PfX; Fri, 14 Aug 2009 10:55:02 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0B107C9A8A; Fri, 14 Aug 2009 10:55:02 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8DCFFC9A8A for ; Fri, 14 Aug 2009 10:55:01 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 0E-VBDXgqtL6 for ; Fri, 14 Aug 2009 10:54:59 +0200 (CEST) Original-Received: from mail.converteam.com (mail.converteam.com [212.155.191.29]) by balder.ntg.nl (Postfix) with ESMTP id 9CE82C9A86 for ; Fri, 14 Aug 2009 10:54:59 +0200 (CEST) In-Reply-To: X-Disclaimed: 5002 X-Mailer: Lotus Notes Release 7.0.3 September 26, 2007 X-MIMETrack: Serialize by Router on G-WWH20/SRV/ALSTOM(Release 7.0.3|September 26, 2007) at 14/08/2009 10:56:48, Serialize complete at 14/08/2009 10:56:48 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:52288 Archived-At: --===============0662410400== Content-Type: text/html; charset="US-ASCII"

> > > > 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



--===============0662410400== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0662410400==--