# Using \sim with \overset with elegant vertical and horizontal spacing

I would like to have have an equation like a \in \overset{\sim}{\mathcal{G}}, where the vertical spacing between G and \sim is lessened but where horizontal spacing between G and other elements in the equation is maintained.

I've tried using combinations of \stackrel and \smash, which work fine for vertical spacing but not the horizontal spacing.

• Why not just \widetilde, e.g. \documentclass{article} \usepackage{amsmath} \begin{document} $a \in \widetilde{\mathcal{G}}$ \end{document}?
– user194703
Dec 7 '19 at 1:03
• This is a good alternative! Though it's not the optimal aesthetic I'm hoping to achieve. Dec 7 '19 at 1:07
• Can you perhaps add a sketch that explains how that should look like in detail?
– user194703
Dec 7 '19 at 1:12

You can use the accents package:

\documentclass{article}

\usepackage{amsmath}
\usepackage{accents}

\begin{document}

$a \in \accentset{{\sim}}{\mathcal{G}}$

$a \in \accentset{{\scriptstyle\sim}}{\mathcal{G}}$

\end{document}


• That did it - thank you! Dec 7 '19 at 1:16