Re: typesetting piecewise function

*To*: mathgroup at smc.vnet.net*Subject*: [mg19817] Re: typesetting piecewise function*From*: Paul Abbott <paul at physics.uwa.edu.au>*Date*: Fri, 17 Sep 1999 01:36:58 -0400*Organization*: University of Western Australia*References*: <7rnkf4$elv@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Henrik Weimer wrote: > I use Mathematica 4 for a lot of my technical writing. One common > problem I have is defining a piecewise function. In mathematical > notation one commonly uses a large opening curly brace with all the > cases listed to the right. In Mathematica I can try to do this but the > curly brace does not scale to the full hight of the matrix of cases on > the right. Here is an example: > > \!\(\* > RowBox[{\(\[ScriptCapitalN][\[ScriptX]]\), "=", > RowBox[{"{", GridBox[{ > {"1", > RowBox[{ > RowBox[{ > RowBox[{ > StyleBox["if", > "Text"], " ", "0"}], "<", "\[ScriptX]", "<=", "1"}], > > ","}]}, > {"0", > StyleBox["otherwise", > "Text"]} > }]}]}]\) > > If I use a regular opening paren instead of the curly brace it scales > fine (I guess Mathematica thinks this is a matrix). Is there a way of > getting this to look right with a large opening curly brace or something > similar? I don't know why the curly brace and the paren behave differently. However, if you select the curly brace, go into the Option Inspector and type in Span you will see the Spanning Character Options. If you change the SpanMinSize you can make the curly brace scale correctly. You also might want to change the SpanMaxSize, e.g., \!\(\*FormBox[ RowBox[{\(\[ScriptCapitalN][\[ScriptX]]\), "=", RowBox[{ StyleBox["{", SpanMinSize->3.3, SpanMaxSize->12], GridBox[{ {"1", RowBox[{ RowBox[{ RowBox[{ StyleBox["if", "Text"], " ", "0"}], "<", "\[ScriptX]", "<=", "1"}], ","}]}, {"0", StyleBox["otherwise", "Text"]} }]}]}], TraditionalForm]\) I cannot see how to make this automatic though. Cheers, Paul ____________________________________________________________________ Paul Abbott Phone: +61-8-9380-2734 Department of Physics Fax: +61-8-9380-1014 The University of Western Australia Nedlands WA 6907 mailto:paul at physics.uwa.edu.au AUSTRALIA http://physics.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________