I want to have wide hat and wide tilde in the same file and thus I use the following codes
\documentclass{article}
\usepackage{wasysym}
\usepackage{scalerel,stackengine}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%(1)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand\reallywidetilde[1]{\ThisStyle{%
\setbox0=\hbox{$\SavedStyle#1$}%
\stackengine{-.1\LMpt}{$\SavedStyle#1$}{%
\stretchto{\scaleto{\SavedStyle\mkern.2mu\AC}{.5150\wd0}}{.6\ht0}%
}{O}{c}{F}{T}{S}%
}}
\def\test#1{$%
\reallywidetilde{#1}\,
% \scriptstyle\reallywidetilde{#1}\,
% \scriptscriptstyle\reallywidetilde{#1}
$\par}
\parskip 1ex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%(2)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\stackMath
\newcommand{\reallywidehat}[1]{%
\savestack{\tmpbox}{\stretchto{%
\scaleto{%
\scalerel*[\widthof{\ensuremath{#1}}] {\kern-.6pt\bigwedge\kern-.6pt}%
{\rule[-\textheight/2]{1ex}{\textheight}}%WIDTH-LIMITED BIG WEDGE
}{\textheight}%
}{0.5ex}}%
\stackon[1pt]{#1}{\tmpbox}%
}
\parskip 1ex
\begin{document}
\reallywidetilde{A}
\test{abcdefghijklm}
\test{abcdefghijk}
\end{document}
where the codes I use from the previous posts Really wide hat symbol
part (1) and (2) all work nicely, yet when put together, they conflict and the \reallywidetilde no longer work. Is there a way to make them compatible?

tabstackenginepackage: http://ctan.org/pkg/tabstackengine – Steven B. Segletes Nov 07 '16 at 17:55\SavedStyle#1in lieu of$\SavedStyle#1$. The above MWE will not typeset unless I wrap two$around\SavedStyle#1. Thanks! – RosesBouquet May 29 '23 at 08:28\stackMathglobally is to wrap a given stack in\ensurestackMath{...stack macro...}to make just that particular stacking command to operate in math mode. – Steven B. Segletes May 29 '23 at 15:24scalerelpackage treats its arguments in math mode by default. This would apply to\ThisStyle{}arguments. With nesting of these things, yes, it can get confusing. – Steven B. Segletes May 29 '23 at 15:50