# How can I adjust matrices into the same ItemSize and aligned well in Notebook?

I typed three matrices, but they are not aligned well, and the Items in one matrix are also not aligned well and with differenct ItemSize.

How can I adjust them into the same ItemSize?

Better is that I can click the buttons/menus to do the thing something like align paragraph in writing assistant.

And I found the matrix typed is GridBox, so I can adjust them by options of Grid.

-
Have you tried //TableForm? Does it help? – Rod Jul 4 '13 at 2:30
@RodLm I haven't tried that, I'll try that, I wonder whether there are some palletes such like writing assistant or buttons or menus to do such align or adjust things. – HyperGroups Jul 4 '13 at 2:39
So you want actually to "type" aligned or "show" aligned? – Rod Jul 4 '13 at 2:40
@RodLm "Show" aligned, maybe after finishing typing them, and then click one button, they'are shown aligned, of course better could "aligned" when typing. – HyperGroups Jul 4 '13 at 2:42
@RodLm Ok, I found the matrix typed is with GridBox, so I can adjust them with options of Grid – HyperGroups Jul 4 '13 at 3:02

Grid will do the job. First Join all the matrices and then use Grid.

Y = {{Cos[u], Sin[u], 0}, {-Sin[u], Cos[u], 0}, {0, 0, 1}};
P = {{Cos[v], 0, -Sin[v]}, {0, 1, 0}, {Sin[v], 0, Cos[v]}};
R = {{1, 0, 0}, {0, Cos[w], -Sin[w]}, {0, Sin[w], Cos[w]}};

Grid[Join[Y,P,R]]


You can use TableForm also.

Now when you want to put the name, its a bit different. What I have done here is adding an extra column to each matrices with their mane and then Join and Grid.

tag[name_] := {"", name, ""};
(*the length of this row must be equal to column length of the matrix*)
matname[name_, mat_] := MapThread[Insert, {mat, tag[name], Table[1, {Length[mat]}]}];

Grid[Join[matname["Y =", Y], matname["P =", P], matname["R =", R]]]


-

As you mention in the comments you can use GridBox:

GridBox[{{1, 1}, {1, 1000}}, ColumnWidths -> 2.5] // DisplayForm


Then you can copy&paste it, add parentheses and additional columns and rows with Ctrl+, and Ctrl+Enter respectively:

ColumnsEqual -> True option can also be useful.

-