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 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] := 
 RowBox[{SubscriptBox["\!\(\*
 StyleBox[OverscriptBox[
 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
share|improve this question
    
It seems to me Word 2013 uses FromCharacterCode[770] instead of FromCharacterCode[94] (i.e. the ordinary ^) for the overhat. –  Silvia Feb 1 '13 at 17:24
    
how to fix it in word 2010? What is charactercode? –  Pipe Feb 1 '13 at 17:29
    
I don't have 2010 aside. But I think they can use the same MathML syntax. –  Silvia Feb 1 '13 at 17:37

1 Answer 1

up vote 3 down vote accepted

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:

Cell[BoxData[
 FormBox[
  TagBox[
   SubscriptBox[
    OverscriptBox["A", "^",
     DiacriticalPositioning->True], 
    SubscriptBox["c", "2"]],
   "MathMLPresentationTag",
   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.

share|improve this answer
    
Thank you very much Silvia! –  Pipe Feb 1 '13 at 18:20
    
@Pipe You're welcome :) Thanks for accepting. –  Silvia Feb 1 '13 at 18:28
    
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 :) –  Pipe Feb 1 '13 at 19:04
    
@Pipe Yes I think the principle behind is the same. MathML is a very useful intermediary for transferring formulas. –  Silvia Feb 2 '13 at 4: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.