Re: SetOptions with Column
- To: mathgroup at smc.vnet.net
- Subject: [mg64509] Re: SetOptions with Column
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Sun, 19 Feb 2006 06:29:10 -0500 (EST)
- Organization: The University of Western Australia
- References: <dt49ib$3k3$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <dt49ib$3k3$1 at smc.vnet.net>,
Rob Munger <rob.munger at yahoo.com> wrote:
> I am trying to use Mathematica to typeset homework assignments. I'm trying
> to use GridBoxes to format multi-line equations of the following sort:
> a = b
> = c
> = d
> = e
> = f
I assume that this is a GridBox of the form
Cell[BoxData[
FormBox[GridBox[{
{"\[Placeholder]"},
{"\[Placeholder]"},
{"\[Placeholder]"}
}], TraditionalForm]], "Input"]
where you have filled the placeholders, and not just a mult-line
expression?
> Because I use formulas like this a lot, it would be nice if I could get
> Mathematica to make the default alignment for the columns of GridBoxes to be
> "Left," instead of "Center."
I too do this all the time. Actually, I think what you really want to do
is get alignment of = (actually, I prefer to use "\[LongEqual]" instead
of = since the latter evaluates to Set whereas the former evaluates to
Equal -- which is the mathematical meaning required here).
Here is an example:
Cell[BoxData[
FormBox[GridBox[{
{
RowBox[{
RowBox[{
"\[LeftAngleBracket]", "P", "\[RightAngleBracket]"}],
"\[LongEqual]",
RowBox[{
FractionBox["1", "2"],
SubscriptBox["\[ScriptCapitalI]", "max"],
SubscriptBox["V", "max"], " ",
RowBox[{"(",
RowBox[{
UnderscriptBox[
UnderscriptBox[
RowBox[{"cos", "(", "\[Phi]", ")"}],
"\[UnderBrace]"], "constant"], "-",
UnderscriptBox[
UnderscriptBox[
RowBox[{"cos", "(",
RowBox[{
RowBox[{"2", "\[Omega]", " ", "t"}], "-",
"\[Phi]"}], ")"}], "\[UnderBrace]"],
RowBox[{
"Averages", " ", "to", " ", "0", " ", "over",
" ", "T"}]]}], ")"}]}]}]},
{
RowBox[{"\[LongEqual]",
RowBox[{
FractionBox["1", "2"],
SubscriptBox["\[ScriptCapitalI]", "max"],
SubscriptBox["V", "max"],
RowBox[{"cos", "(", "\[Phi]", ")"}]}]}]},
{
RowBox[{"\[LongEqual]",
RowBox[{
OverscriptBox["\[ScriptCapitalI]", "~"],
OverscriptBox["V", "~"],
RowBox[{"cos", "(", "\[Phi]", ")"}]}]}]},
{
RowBox[{"\[LongEqual]",
RowBox[{
OverscriptBox[
StyleBox["\[ScriptCapitalI]",
FontWeight->"Bold"], "~"],
StyleBox["\[CenterDot]",
FontWeight->"Bold"],
OverscriptBox[
StyleBox["V",
FontWeight->"Bold"], "~"]}]}]}
}], TraditionalForm]], "DisplayFormula",
GridBoxOptions->{ColumnAlignments->{"\[LongEqual]"},
ColumnLines->True}]
> However, when I try to use SetOptions to
> accomplish this, I get:
>
> In:
> SetOptions[GridBox,ColumnAlignments->{Left}]
> Options[GridBox,ColumnAlignments]
>
> Out:
> {ColumnAlignments->{Center}}
>
> In:
> SetOptions[GridBox,ColumnAlignments->Left]
> Options[GridBox,ColumnAlignments]
>
> Out:
> {ColumnAlignments->{Center}}
Select the Cell (though actually modifying the StyleSheet of the
Notebook to make this automatic for all cells of the same type -- such
as DisplayFormula or NumberedEquation -- is better) and open the Option
Inspector. Show option values for selection and modify ColumnAlignments
to be "=" (or "\[LongEqual]").
Cheers,
Paul
_______________________________________________________________________
Paul Abbott Phone: 61 8 6488 2734
School of Physics, M013 Fax: +61 8 6488 1014
The University of Western Australia (CRICOS Provider No 00126G)
AUSTRALIA http://physics.uwa.edu.au/~paul