5

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?

10

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

enter image description here

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

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.