7

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?

5

1 Answer 1

13

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 ensure that equation and (1) stay on the same line.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .