# Spacing around \tilde{=}

How can I get proper spacing when using tilde over operator symbols?

\begin{align*}
x &= y\\
x &\tilde{=} b
\end{align*}


Yields:

But I would like the tilde version to have the same kind of spacing as normal equality

• Why don't you use \simeq or \cong instead? – Werner Jan 7 at 20:59

You can make arbitrary symbol a relation by wrapping it into \mathrel{}. For example: \mathrel{\tilde{=}} will use the correct spaces around it. There are other ways: \stackrel{}{} (as Herbert noted), or use of a predefined symbol like \cong. They all have different looks. Chose what you prefer:

\documentclass{article}
\usepackage{amsmath}
\newcommand\teq{\mathrel{\tilde{=}}}
\newcommand\seq{\stackrel{\sim}{=}}
\begin{document}
\begin{align*}
x &= y\\
x &\teq b\\
x &\seq b\\
x &\cong b\\
\end{align*}
\end{document}


The result:

\begin{align*}
x &= y\\
x &\stackrel{\sim}{=} b
\end{align*}


Here there is another minimal example.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}

\begin{align*}
x &= y\\
x &\overset{\sim}{=} b
\end{align*}

\begin{align*}
x &= y\\
x &\overset{\thicksim}{=} b
\end{align*}

\end{document}