TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
For instance $\skew{5.5}\widehat{\widehat{f}}$ or $\skew{1.2}\widehat{\widehat{g}}$. I'm afraid that one has to fine tune them by hand. – egreg May 6 '12 at 22:32
BTW, TL2012 versions of LuaTeX and XeTeX will support proper positioning for stacked accents like this (for OpenType math fonts only in case of XeTeX). – Khaled Hosny May 6 '12 at 22:41
up vote 19 down vote accepted

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.



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


\def\@tempb#1>#2#3 #4\@nil#5{%
      Unable to redefine math accent \string#5}%


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.
share|improve this answer
Also \hat{\hat{f}} works. The capitalized version remains for compatibility, but double accents are treated well with the normal commands. – egreg May 6 '12 at 22:44
@egreg, so it does, the code also seems to work reasonably with widehat as well, see updated answer – David Carlisle May 6 '12 at 22:50
Out of votes, ATM. :) Maybe @barbarabeeton can take note. – egreg May 6 '12 at 22:52
Thanks for the responses! For completion, I should remark that if I have \usepackage{amsmath, amssymb} in the preamble instead, the above trick reverts to the standard behavior of \widehat{\widehat{f}} that occurs when you do nothing. To get around this, it seems that at least for double widehat-ing single letters one does \widehat{\widehat{f\, }} with the code in the answer above. However, for multiple letters like abcd, using amssymb doesn't affect the output of \widehat{\widehat{abcd}} – ADF May 7 '12 at 0:18
Well no actually, maybe you should give that as an answer. If you use f\, then you don't need the redefinition at all as if the argument to (any) accent command isn't a single character it breaks the automatic shifting due to italic correction, so both accents are simply centered so they line up naturally. – David Carlisle May 7 '12 at 0:51

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


$\widehatdown{2.5pt}{\widehat{A+B+C+D+E+F+G }}$

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.

share|improve this answer

Your Answer


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.