A tilde symbol is a wavy line ( ~ ) that can be used as a symbol or appears on the head of an alphabet or symbol, \(\tilde{p}\). You may ask how one can write a tilde symbol in LaTeX? short answer: writing a tilde in LaTeX over a letter can be achieved easily using the command \tilde{symbol} or as a symbol within the text (or math mode) using \textasciitilde (or $\sim$), respectively.
In this post, we will present various methods to include a tilde symbol in our LaTeX document. Let start with a tilde over a letter or a symbol!
1. Tilde over letter
A tilde over a letter can be obtained using the command \tilde{letter}
, here is an illustrative example:
% Simple tilde over text \documentclass{article} \begin{document} These are alphabets with a tilde symbol, $\tilde{a}$, $\tilde{A}$, $\tilde{p}$. \end{document}
compiling this code yields the following output:
\( \text{These are alphabets with a tilde symbol}, \tilde{a}, \tilde{A}, \tilde{p}. \)
However, this command does not change with respect to its content, for example \( \tilde{ab}\). The next section addresses the wide tilde symbol in LaTeX.
2. Long tilde in LaTeX
To remedy the above issue, we can use \widetilde
command instead of \tilde{}
. Here is an illustrative example:
% wide tilde over text \documentclass{article} \begin{document} These is an expression with a wide tilde over it: $\widetilde{ab}$. \end{document}
compiling this code yields:
\( \text{These is an expression with a wide tilde over it: } \widetilde{ab} \)
3. How to type tilde as a symbol (~) in LaTeX
A tilde in LaTeX is a special symbol that when using it will force a non-breaking space between the left and right text. To create a tilde in LaTeX, we can use one of the following commands:
- Math mode: we can use
$\sim$
command - Text mode: we can use
\textasciitilde
command or\texttildelow
.
\( \text{This is obtained by \sim command: } \sim \)
and here is the tilde symbol obtained by text-mode commands:
At this level, we reached the end of this tutorial, for more LaTeX symbols, check this post!