enter image description here

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.

  • $\begingroup$ Have you tried //TableForm? Does it help? $\endgroup$
    – Rod
    Commented Jul 4, 2013 at 2:30
  • $\begingroup$ @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. $\endgroup$ Commented Jul 4, 2013 at 2:39
  • $\begingroup$ So you want actually to "type" aligned or "show" aligned? $\endgroup$
    – Rod
    Commented Jul 4, 2013 at 2:40
  • $\begingroup$ @RodLm "Show" aligned, maybe after finishing typing them, and then click one button, they'are shown aligned, of course better could "aligned" when typing. $\endgroup$ Commented Jul 4, 2013 at 2:42
  • 1
    $\begingroup$ @RodLm Ok, I found the matrix typed is with GridBox, so I can adjust them with options of Grid $\endgroup$ Commented Jul 4, 2013 at 3:02

2 Answers 2


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]}};



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

enter image description here

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

enter image description here

ColumnsEqual -> True option can also be useful.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.