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.

When I write:

Overscript[PQ, \[RightVector]], 

the arrow is placed too close to the P and Q. Is there a way to modify the default distance used by Overscript?

share|improve this question
    
Quick fix is to select PQ or overscript and ALT+UpArrow/DownArrow. –  Kuba Aug 5 '13 at 11:29
    
@kuba ...also the best fix –  Mike Honeychurch Aug 5 '13 at 12:15

1 Answer 1

up vote 6 down vote accepted

I see the problem of close spacing only for OverVector, not for the input with Overscript (where in your example I had to add quotation marks around the arrow symbol to avoid getting an error).

So I'm now assuming you're actually referring to the following issue:

OverVector[PQ]

vec

This could be remedied by adding an AdjustmentBox around the arrow with the help of a formatting command like this:

OverVector /: MakeBoxes[OverVector[x_], _] := 
 OverscriptBox[ToBoxes[x], 
  AdjustmentBox["\[RightVector]", BoxBaselineShift -> -0.5]]

OverVector[PQ]

vec2

This enlarged spacing will work by default in StandardForm and TraditionalForm output.

Edit

For backward compatibility with Mathematica version 7, Mr. Wizard pointed out that it's good to add another option:

OverVector /: MakeBoxes[OverVector[x_], _] := 
 OverscriptBox[ToBoxes[x], 
  AdjustmentBox["\[RightVector]", BoxBaselineShift -> -0.5, 
   BoxMargins -> {{0, 0}, {0.5, 0}}]]
share|improve this answer
1  
@Mr.Wizard Yes, that seems to cover all versions and works fine. I also just checked that it works in version 9. –  Jens Aug 7 '13 at 23:10

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.