Similar To in LaTeX (\sim)
- LaTeX command
\sim- Package
- No package needed: built into LaTeX
- Mode
- Math mode only
- Copy the Unicode character
- ∼
U+223C
Where it is used
Tilde relation for distributed as, asymptotically equal, similar, or equivalent under a relation.
In probability X \sim \mathcal{N}(0, 1) reads X is distributed as a standard normal. In asymptotics f \sim g means f/g \to 1, as in Stirling's formula. Algebra uses x \sim y for an equivalence relation, and geometry uses it for similar triangles. As a relation it has spacing on both sides; for a tilde accent on a letter use \tilde{x}. Close cousins are \simeq (asymptotically equal or homotopy equivalent), \approx (approximately), and \thicksim, a bolder version. As a prefix meaning approximately, as in \sim 10^3, the spacing can look odd; write {\sim}10^3.
Also listed under: Probability & Statistics, Geometry
Minimal compilable example
Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.
\documentclass{article}
\begin{document}
Similar To: $\sim$
\[ n! \sim \sqrt{2\pi n} \left( \frac{n}{e} \right)^{n} \]
\end{document}Related symbols
- Congruent
\cong - Proportional To
\propto - Subset
\subset - Equivalent
\equiv - Subset or Equal
\subseteq - Approximately Equal
\approx
Frequently asked questions
- How do I write Similar To in LaTeX?
- Type \sim in math mode, for example $n! \sim \sqrt{2\pi n} \left( \frac{n}{e} \right)^{n}$. It works in plain LaTeX without loading any package.
- Which package do I need for \sim?
- None. \sim is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
- Can I use \sim in text mode, or only in math mode?
- Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\sim$ in running text. If you only need the glyph in text, paste the Unicode character ∼ instead (with XeLaTeX or LuaLaTeX and a font that has it).
Best AI LaTeX Editor, Overleaf Alternative
Octree helps researchers from 15+ universities write research papers faster using AI
- Generate beautiful TikZ diagrams using AI
- Upload image and convert it to LaTeX seamlessly
- Get instant assistance with writing and formatting research papers