Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
    
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
1  
@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
show 3 more comments

2 Answers

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.

share|improve this answer
add comment

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

grid1

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

grid2

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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