In this question a nice custom \widehat is made. The relevant code is below. I wanted to use this code to make a similar one for \widetilde but replacing \widehatsym by \widetildesym does not work. Since I have zero knowledge of the subtleties of tex I am stuck at this point. How does one modify this code to get a \widetilde?
\documentclass{article}
\usepackage{amsmath,accents}
\DeclareMathSymbol{\widehatsym}{\mathord}{largesymbols}{"62}
\newcommand\lowerwidehatsym{%
\text{\smash{\raisebox{-1.3ex}{%
$\widehatsym$}}}}
\newcommand\fixwidehat[1]{%
\mathchoice
{\accentset{\displaystyle\lowerwidehatsym}{#1}}
{\accentset{\textstyle\lowerwidehatsym}{#1}}
{\accentset{\scriptstyle\lowerwidehatsym}{#1}}
{\accentset{\scriptscriptstyle\lowerwidehatsym}{#1}}
}
\begin{document}
$\fixwidehat{k}\fixwidehat{M}\fixwidehat{x}$
\[ \fixwidehat{abc} \]
$\fixwidehat{ab}^{\fixwidehat{ab}}$
\end{document}
Best Answer