Message Boards Message Boards

GROUPS:

How to write a widehat?

Posted 9 years ago
4957 Views
|
1 Reply
|
1 Total Likes
|

In LateX if we want to insert a widehat over some word we just need to write: \widehat{ABCD}.

In Mathematica, as far as I can see, we can only insert: OverHat[ABCD], which does not puts really a widehat, but a small hat in the middle of the word..

Anyone knows if it is possible to do as we do in LateX?

Regards, Álvaro

POSTED BY: Alvaro Almeida

On http://mathematica.stackexchange.com/questions/2788/hat-not-big-enough I found this:

OverHat /: MakeBoxes[OverHat[a_], form_] := 
 With[{s = First[Rasterize[a, "RasterSize"]], ab = MakeBoxes[a]}, 
  With[{sl = N[2 Log[2 s]]}, 
   InterpretationBox[
    OverscriptBox[ab, 
     TagBox[GraphicsBox[LineBox[{{-s, 0}, {0, sl}, {s, 0}}], 
       ImageSize -> {s, Automatic}], "LongOverHat", 
      Selectable -> False]], OverHat[a]]]]

If you then type

OverHat[ABCD]

it gives:

enter image description here

Cheers,

Marco

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract