2
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Something like Text@TableForm@MapThread[PlusMinus, {{m1}, {m2}}, 3]? $\endgroup$ – akater May 27 '14 at 5:34
  • $\begingroup$ That works... I need a little more flexibility... in terms of text size for matrices... I'll add color to the Question. $\endgroup$ – Pam May 27 '14 at 5:47
2
$\begingroup$
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

$\endgroup$
  • $\begingroup$ 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 $\endgroup$ – Pam May 27 '14 at 10:19
  • $\begingroup$ @Pam Be careful next time :) is this ok? :) $\endgroup$ – Kuba May 27 '14 at 10:30
  • $\begingroup$ Wonderful... Thanks Kuba! $\endgroup$ – Pam May 27 '14 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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