Tilde in LaTeX (\tilde{x})

x~\tilde{x}
LaTeX command
\tilde{x}
Package
No package needed: built into LaTeX
Mode
Math mode only

Where it is used

Puts a small wavy tilde over a single symbol, often marking an approximation, transform or modified variable.

A tilde over a letter usually signals a related but altered object: \tilde{x} for a perturbed or approximate solution, \tilde{f} for a Laplace or other transform, \tilde{O}(n) for soft-O complexity that hides log factors, or \tilde{X} for a universal cover in topology. Like \hat, it has a fixed width, so over two or more letters use \widetilde. Do not confuse it with \sim, which is a relation symbol placed between terms (X \sim N(0,1)), nor with the text-mode accent \~{n} used for words like señor. For dotless letters write \tilde{\imath}.

Minimal compilable example

Paste this into an empty .tex file and compile it with pdfLaTeX, XeLaTeX or LuaLaTeX.

O~(nlog⁡n)⊆O(nlog⁡2n)\tilde{O}(n \log n) \subseteq O(n \log^2 n)
\documentclass{article}
\begin{document}
Tilde: $\tilde{x}$

\[ \tilde{O}(n \log n) \subseteq O(n \log^2 n) \]
\end{document}

Related symbols

All التشكيل والمعدّلات →

Frequently asked questions

How do I write Tilde in LaTeX?
Type \tilde{x} in math mode, for example $\tilde{O}(n \log n) \subseteq O(n \log^2 n)$. It works in plain LaTeX without loading any package.
Which package do I need for \tilde{x}?
None. \tilde{x} is part of standard LaTeX, so it compiles with nothing in the preamble but the document class.
Can I use \tilde{x} in text mode, or only in math mode?
Only in math mode. Outside $...$ LaTeX stops with "Missing $ inserted", so write $\tilde{x}$ in running text.
Math poweredاكتب LaTeX باستخدام الذكاء الاصطناعي

أفضل محرر LaTeX بالذكاء الاصطناعي، بديل Overleaf

يساعد Octree الباحثين من أكثر من 15 جامعة على كتابة أوراق البحث بشكل أسرع باستخدام الذكاء الاصطناعي

  • أنشئ رسوم TikZ جميلة باستخدام الذكاء الاصطناعي
  • ارفع صورة وحولها إلى LaTeX بسلاسة
  • احصل على مساعدة فورية في كتابة وتنسيق أوراق البحث