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.
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).
최고의 AI LaTeX 편집기, Overleaf 대안
Octree는 15개 이상의 대학의 연구자들이 AI를 사용하여 논문을 더 빠르게 작성하도록 도움
- AI로 아름다운 TikZ 다이어그램 생성
- 이미지를 업로드하고 LaTeX로 원활하게 변환
- 논문 작성 및 서식에 대한 즉각적인 지원 받기