On Sat, 28 Mar 2009, CuriousLearn wrote:
Aditya Mahajan
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