How does one make a double widehat?

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\@tempb\meaning#1\@nil#1}
\def\@tempb#1>#2#3 #4\@nil#5{%
  \@xp\ifx\csname#3\endcsname\mathaccent
    \@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="#3\relax\set@mathaccent\@tempd{#7}{#2}{#4#5}}


\@tempa\widehat
\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.

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.

Tags:

Symbols