The sign \sim
is used in mathematics for equivalence of sequences. How to do it in LaTeX?
I tried
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\isEquivTo}{\sim}
\begin{document}
\[
\sin(n) + n \isEquivTo\limits_{+\infty} n
\]
\end{document}
but the output is not what I am looking for. I would like the +\infty
to be under the \sim
sign. Is it possible to have a command \isEquivTo
that would automatically put the +\infty
under the sign, without even typing \limits
?
Best Answer
If you want an operator to respect
\limits
you should use\DeclareMathOperator*
. However, this is the wrong tool for the required symbol, because it would make an operator rather than a relation symbol, with wrong spacing. Thenseems better for your needs. Note that
\underset
will “know” that\sim
is a relation symbol, so it will use the right spacing around it.On the other hand, setting the subscript under the symbol won't give good results when inline; here's a better definition that uses
\underset
only in display style. Look carefully at the output to see why it's better not using the\underset
form for inline formulas.If you want a syntax like
\isEquivTo_{+\infty}
, you can do it withxparse
:You will see that the first call just does
\sim
.