TransWikia.com

How does one make a double widehat?

TeX - LaTeX Asked by ADF on April 19, 2021

To depict the Fourier transform of the Fourier transform of a function f, I want to make two widehats over each other as in widehat{widehat{f}}, however, this makes the widehats not immediately over each other. How would one make the widehats immediately above each other?

3 Answers

Do you need the wide version? AMS provides Hat accent that shifts when doubled, but the package doesn't provide a wide version that does this.

documentclass{article}
usepackage{amsmath}
begin{document}

[
Hat{Hat{f}}
]
end{document}

enter image description here

Actually amsmath contains code to make stacked widehat work but it is commented out for some reason. If you copy the code and uncomment widehat you get:

enter image description here

documentclass{article}
usepackage{amsmath}


makeatletter
def@tempa#1{@xp@tempbmeaning#1@nil#1}
def@tempb#1>#2#3 #4@nil#5{%
  @xpifxcsname#3endcsnamemathaccent
    @tempc#4?"7777@nil#5%
  else
    PackageWarningNoLine{amsmath}{%
      Unable to redefine math accent string#5}%
  fi
}
def@tempc#1"#2#3#4#5#6@nil#7{%
  chardef@tempd="#3relaxset@mathaccent@tempd{#7}{#2}{#4#5}}


@tempawidehat
makeatother
begin{document}
[
widehat{widehat{f}}
widehat{widehat{abcd}}
]
end{document}

The amsmath documentation actually mentions why widehat is omitted, but I think if you don't needed the wider wide hats provided by the amsfonts definition, using the amsmath stacking version is OK.

For widehat and
widetilde, we need to avoid clobbering the definitions done by the
pkg{amsfonts} package. Arbitrating the contention between
pkg{amsmath} and pkg{amsfonts} to allow doubling a widetilde
accent looks tricky, so for the time being [mjd,1999/07/19] we just
leave cn{widehat} and cn{widetilde} alone.

Correct answer by David Carlisle on April 19, 2021

The MathTime Professional 2 package (mtpro2 for short) provides methods for producing really really wide-hat symbols (as well as wide-tilde and wide-check symbols) and stacking these symbols, i.e., producing doubled widehat symbols.

enter image description here

documentclass{article}
usepackage{mtpro2}
begin{document}
$widehatdown{1.5pt}{widehat{aceuvw}}$

bigskip
$widehatdown{2.5pt}{widehat{A+B+C+D+E+F+G }}$
end{document}

I must confess I hope you have no need for the lower of the two examples... Note also that the mtpro2 package produces Times Roman-type math fonts, which may or may not be a look you like.

Answered by Mico on April 19, 2021

$widehat{widehat{f,}}!!$ seems to work somehow.

(Based on comments by David Carlisle and ADF.)

Answered by Fornost on April 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP