Message Boards Message Boards

0
|
5740 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

How to write a widehat?

Posted 10 years ago
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