# What does symbol ~ do in Latex?

I noticed this symbol in an example. Including or excluding this from the source doesn't change anything. However, if I include \~, it puts a ~ on the first letter of the next word. So, what could be purpose of including ~ in the code? Also, how do I print the ~ only in my document?

As stated in the comments ~ inserts a non-breaking space. This means that you tell the typesetting algorithm that it should not insert a linebreak here. This is useful when making references. For example, if you write

according to the Pythagorean theorem there is a lot to be learned
form a triangle. You might see in equation \eqref{eq:1} there is
some need for


is typeset as

however

according to the Pythagorean theorem there is a lot to be learned
form a triangle. You might see in equation~\eqref{eq:1} there is
some need for


will make sure that equation and (7) stay on the same line