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.

I have a rather simple question that has me flummoxed.

Let's say I have two matrices:

m1 = {{a1, a2}, {b1, b2}};
m2 = {{u1, v1}, {u2, v2}};

I am looking to typeset m1 ± m2 similar to:

Text@TableForm[m1 + "\[PlusMinus]" m2 ] 
  • Works for the most part, but I want to remove the + sign from the output
  • I also want to control the text sizes for the m1 and m2 independently so that the a1, a2 etc appear in a larger text and u1, v1 appear in a smaller text

I tried:

Text@TableForm[m1 + "\[PlusMinus]" m2 ] /. "+" -> "x"

But that does not seem to work. Help much appreciated.

share|improve this question
    
Something like Text@TableForm@MapThread[PlusMinus, {{m1}, {m2}}, 3]? –  Akater May 27 at 5:34
    
That works... I need a little more flexibility... in terms of text size for matrices... I'll add color to the Question. –  Pam May 27 at 5:47

1 Answer 1

up vote 2 down vote accepted
Grid[
 MapThread[PlusMinus, {m1, m2}, 2],
 BaseStyle -> 15, 
 ItemStyle -> {{Red, Blue}, {}, {1, 1} -> {18, Bold}}]

enter image description here

DisplayForm@RowBox[{"(", #, ")"}] & [%]

enter image description here


Edit

m1 = Map[Style[#, 18, Bold] &, {{a1, a2}, {b1, b2}}, {2}];
m2 = {{u1, v1}, {u2, v2}};

Grid@MapThread[PlusMinus, {m1, m2}, 2]

enter image description here

share|improve this answer
    
Sorry if I wasn't clear. I wanted to typeset it such that a1, a2 b1,b2 are in large type and u1, U2, v1,v2 are in small type –  Pam May 27 at 10:19
    
@Pam Be careful next time :) is this ok? :) –  Kuba May 27 at 10:30
    
Wonderful... Thanks Kuba! –  Pam May 27 at 10:42

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.