5

When I use \sim I get:

enter image description here

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.

HappyBee
  • 508

2 Answers2

5

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}

enter image description here

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

enter image description here

from the input

$f\circ g$

$f\smallcirc g$
egreg
  • 1,121,712
  • 1
    Small doubt: since using \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
  • @Manuel Tradition? The chances #2 sets \mathsurround are very small. – egreg Apr 24 '16 at 15:22
  • I was asking in case there was something more to that decision. In any case, since it's so simple, I don't see why tradition has taken us to a different path. – Manuel Apr 24 '16 at 15:31
  • shouldn't the (small) \sim be unary? – barbara beeton Apr 24 '16 at 19:43
  • @barbarabeeton I don't think so; but of course it's possible to make it a unary symbol by doing ${\smallsim}60\%$. – egreg Apr 24 '16 at 21:09
2

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.