I have problem with output traditional form of sign above the constant. When I copy/paste in word it is far away up. Is there solution for this?

 BB /: MakeBoxes[BB[n_], TraditionalForm] := 
 StyleBox[\"A\",\nFontFamily->\"Times New Roman\",\n\
 FontWeight->\"Plain\",\nFontSlant->\"Italic\"], \"^\"],\nFontFamily\
 ->\"Times New Roman\",\nFontWeight->\"Plain\",\nFontSlant->\"Italic\"\
  ]\)", RowBox[{Sequence @@ 
   Riffle[Table["\!\(\*SubscriptBox[\(c\), \(1\)]\)", {1}], 2]}]]}]

BB[1] // TraditionalForm
BB[2] // TraditionalForm
  • $\begingroup$ It seems to me Word 2013 uses FromCharacterCode[770] instead of FromCharacterCode[94] (i.e. the ordinary ^) for the overhat. $\endgroup$ – Silvia Feb 1 '13 at 17:24
  • $\begingroup$ how to fix it in word 2010? What is charactercode? $\endgroup$ – Pipe Feb 1 '13 at 17:29
  • $\begingroup$ I don't have 2010 aside. But I think they can use the same MathML syntax. $\endgroup$ – Silvia Feb 1 '13 at 17:37

I don't have a Word 2010 aside. But I think the MathML syntax would be the some. The following method works for my Word 2013.

Create the desired formula in Word with the built-in formula editor:

Mathematica graphics

Then copy and paste it into Mathematica:

Mathematica graphics

Check the cell expression:

    OverscriptBox["A", "^",
    SubscriptBox["c", "2"]],
   AutoDelete->True], TraditionalForm]], "Input"]

So we have our magic spell, an OverscriptBox with the option of DiacriticalPositioning -> True!

Thus a definition like the following should work fine with MS Word:

BB /: MakeBoxes[BB[n_], TraditionalForm] := 
 SubscriptBox[OverscriptBox["A", "^", DiacriticalPositioning -> True],
   SubscriptBox["c", n]]

Mathematica graphics

Simply Ctrl+c or Copy As -> MathML, then paste in Word.

  • $\begingroup$ @Pipe You're welcome :) Thanks for accepting. $\endgroup$ – Silvia Feb 1 '13 at 18:28
  • $\begingroup$ Perfect, congrats. I can male similar code for brackets also? Instead of traditional form u(v(r(b))) to get this u{v[r(b)]}, I am not sure how to recognize order of brackets? Thank you very much in any case. Regards, Pipe :) $\endgroup$ – Pipe Feb 1 '13 at 19:04
  • $\begingroup$ @Pipe Yes I think the principle behind is the same. MathML is a very useful intermediary for transferring formulas. $\endgroup$ – Silvia Feb 2 '13 at 4: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.