6

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

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

Yields:

enter image description here

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

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

3 Answers 3

10

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:

enter image description here

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

enter image description here

2

Here there is another minimal example.

enter image description here

\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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .