From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/48865 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Linebreak in Metapost/Metafun Label Date: Fri, 27 Mar 2009 20:33:54 -0400 (EDT) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1238200807 4028 80.91.229.12 (28 Mar 2009 00:40:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 Mar 2009 00:40:07 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Mar 28 01:41:25 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1LnMc1-0002Qt-Fr for gctc-ntg-context-518@m.gmane.org; Sat, 28 Mar 2009 01:41:25 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0F1851FC7B; Sat, 28 Mar 2009 01:39:58 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06732-02; Sat, 28 Mar 2009 01:39:26 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 30D3E1FC3E; Sat, 28 Mar 2009 01:39:26 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B3B4A1FC3E for ; Sat, 28 Mar 2009 01:39:23 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 02868-03 for ; Sat, 28 Mar 2009 01:39:12 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by ronja.ntg.nl (Postfix) with ESMTP id D944A1FC36 for ; Sat, 28 Mar 2009 01:39:11 +0100 (CET) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n2S0d8tO002280 for ; Sat, 28 Mar 2009 01:39:10 +0100 Original-Received: FROM [192.168.2.8] (c-71-234-195-113.hsd1.ct.comcast.net [71.234.195.113]) BY hackers.mr.itd.umich.edu ID 49CD7085.E7C81.5095 ; 27 Mar 2009 20:34:14 -0400 In-Reply-To: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.14.81; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 200363980 - 654d1e7bb986 - 20090328 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:48865 Archived-At: On Sat, 28 Mar 2009, CuriousLearn wrote: > Aditya Mahajan umich.edu> writes: > > >>> >>> Any ideas why it may not be working for me? >> >> Because I did not test before posting :) >> >> Try \framed[align=normal, width=5cm, frame=no]{....} >> >> Aditya > > Awesome! That works great. Before asking I tried searching a lot in metafun > manual and on the web but could not find anything. I am not yet clear about the > logic. When I saw that I could color labels using the \color[red]{red} command > by putting it between btex...etex, it seemed to me that any context command > would work if put in there. So I tried \crlf to get a linebreak and that did not > work. So I thought maybe only very few specific commands work. Now after seeing > your solution, again I am wondering, what determines which commands work and > which do not. Anyhow, I am not asking for an explanation, because it will most > probably beyond me and may be a long one for someone to explain. But I > appreciate the solution. Here is a simplified picture. Basically, anything inside btex ... etex (or textext(...) or \sometxt{...}) is in what is known as TeX's horizontal mode. Think of this as what you will get if you put the same argument in a \hbox (see the TeXbook or TeX for the impatient for details). To get multiple lines you need tex to be in the vertical mode, a \vbox. A vanilla \framed is like a \hbox. Framed with align=normal is like a \vbox. So, for most purposes you can you \framed. There are some commands that need to know the width of the box (like \start stop formula). In those cases you need to specify width=something to \framed. Of course, certain objects like floats, footnotes, marginpars, will never work inside metapost. (I think you can get floats and footnotes to work, but that will require some hackery) Aditya ___________________________________________________________________________________ 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 ___________________________________________________________________________________