When I use \sim I get:
Is there a way to make the \sim sign smaller with respect to the text?
I looked online but did not find what I was looking for.
Thanks.
When I use \sim I get:
Is there a way to make the \sim sign smaller with respect to the text?
I looked online but did not find what I was looking for.
Thanks.
With \mathpalette trickery we can choose the smaller size.
\documentclass{article}
\newcommand{\smallsim}{\smallsym{\mathrel}{\sim}}
\makeatletter
\newcommand{\smallsym}[2]{#1{\mathpalette\make@small@sym{#2}}}
\newcommand{\make@small@sym}[2]{%
\vcenter{\hbox{$\m@th\downgrade@style#1#2$}}%
}
\newcommand{\downgrade@style}[1]{%
\ifx#1\displaystyle\scriptstyle\else
\ifx#1\textstyle\scriptstyle\else
\scriptscriptstyle
\fi\fi
}
\makeatother
\begin{document}
exchange $\sim 60\%$ and $\sim 15\%$
exchange $\smallsim 60\%$ and $\smallsim 15\%$
\end{document}
I defined a generic \smallsym command in case you need other symbols to be made smaller in a similar way. For instance, with
\newcommand{\smallcirc}{\smallsym{\mathbin}{\circ}}
you get
from the input
$f\circ g$
$f\smallcirc g$
\m@th is a good practice, why is it so commonly used at the begining of math mode $\m@th#1#2$ rather than at the end $#1#2\m@th$?
– Manuel
Apr 24 '16 at 14:45
${\smallsim}60\%$.
– egreg
Apr 24 '16 at 21:09
You could try {\small \sim}, {\scriptsize \sim} or {\footnotesize \sim} for example. See e. g. What point (pt) font size are \Large etc.? for more font size related commands.