Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Aligning Typeset Math on Equal Signs

679 views
Skip to first unread message

Gregory Lypny

unread,
Sep 15, 2011, 4:43:57 AM9/15/11
to
Hello everyone,

How can align my typeset equations on the equal signs? I'm doing the typesetting in Text cells.

Gregory=

Thomas Dowling

unread,
Sep 16, 2011, 5:51:42 AM9/16/11
to
Hello,

I think what you probably require is AlignmentMarker, esc am esc (or
\[AlignmentMarker]

See here ("Math Typsetting Options and Tweaking", )

http://reference.wolfram.com/mathematica/guide/MathTypesettingOptionsAndTweaking.html

I do it something like this (I am using Mathematica 7 on a Mac) which I learned from
an old Mathgroup post (I cannot locate the original source)

1. From within the text cell, open an inline cell (Insert-> Typesetting->
Start Inline Cell on a Mac with Mathematica 7)
2. Type in the equations putting an alignment marker before each equals
sign (ie "esc am esc =" ..)
3. Close inline cell
4. Select the text WITHIN THE INLINE CELL, and choose TextAlignment ->
OnAlignmentMarker from the Format menu.
5 Click anywhere outside the inline cell.
6 Thats it!


You end up with something like this (should cut-and-paste)

Cell[TextData[{
"This is a text cell\n",
Cell[BoxData[{
FormBox[
RowBox[{
RowBox[{"a", "+", "b", "+", "c", "+", "d"}], "\[AlignmentMarker]", "=",
"50"}], TraditionalForm], "\[IndentingNewLine]",
FormBox[
RowBox[{"a", "\[AlignmentMarker]", "=", "50"}], TraditionalForm]}],
TextAlignment->AlignmentMarker,
FormatType->"TraditionalForm"]
}], "Text",
CellChangeTimes->{{3.5250825627116632`*^9, 3.525082650843917*^9}}]


I also have this from somewhere (again not originally mine) which might be
of use:

eqns = {a == b + c + d + e, a + b == c + d + e, a + b + c == d + e, a + b +
c + d == e};
Grid[List /@ eqns, Alignment -> "=="]



On Thu, Sep 15, 2011 at 9:39 AM, Gregory Lypny
<gregor...@videotron.ca>wrote:

Tomas Garza

unread,
Sep 16, 2011, 5:50:40 AM9/16/11
to
I think perhaps it's better to do the typesetting in an input cell, convert then the cell to traditional form, and copy-paste into the text cell in the desired position. The only hitch is that traditional form will give everything in bold type, but this may be easily fixed with Format, either on the whole contents of the cell or on individual characters. The equal signs and other similar stuff will be nicely aligned.
-Tomas

> Date: Thu, 15 Sep 2011 04:39:02 -0400
> From: gregor...@videotron.ca
> Subject: Aligning Typeset Math on Equal Signs
> To: math...@smc.vnet.net

Tom

unread,
Sep 17, 2011, 6:25:46 AM9/17/11
to

> > Hello everyone,
>
> > How can align my typeset equations on the equal signs? I'm doing the typesetting in Text cells.
>
> > Gregory

HI, there are always lots of ways to do things. Not sure if this is
useful....

Below is a text cell with three lined up equations. You can copy and
paste this into Mathematica, then use the cell Menu and Show
Expression to view it normally.

Cell[TextData[Cell[BoxData[
FormBox[GridBox[{
{GridBox[{
{
RowBox[{
RowBox[{
RowBox[{"2", "x"}], "-",
RowBox[{"3", "y"}]}], "=", "5"}]},
{
RowBox[{
RowBox[{
RowBox[{
FractionBox["1", "2"], "x"}], "-", "y"}], "=", "1"}]},
{
RowBox[{
RowBox[{
RowBox[{"2", "x"}], "-", "5"}], "=", "12"}]}
},
GridBoxAlignment->{"Columns" -> {{"="}}}]}
},
GridBoxItemSize->{"Columns" -> {{
Scaled[1]}}}], TraditionalForm]]]], "Text"]




Hit control and return to add a new line

I keep that handy for when I am typing systems, etc.

TOM

Kevin J. McCann

unread,
Sep 18, 2011, 4:21:04 AM9/18/11
to
Hi Tom,

Nice example. I have a question though. Did you actually type all the
GridBox's and RowBox's in the example below? If so, I would submit that
this is a really, really slow way to get from here to there. Personally,
I would not be willing to type all that stuff just to get the equals
signs to line up. Maybe I am lazy, but there it is.

I would hope that I could type up the three equations as one usually
does and then execute some alignment command to make it "look nice".

Kevin
0 new messages