Why is tilde not available out of the box in TeX?

The command you are looking for is \textasciitilde (looks better with

\usepackage[T1]{fontenc}

than the default OT1 encoding, which doesn't include a tilde so uses the accent over an empty base)

But the basic premise of your question seems flawed, all programming languages use some of the "easily accessible" keyboard characters as control constructs. ~ makes a non breakable space so doesn't directly make a ~ just as \ and { and } are used for specific syntax constructs for Tex and do not directly typeset the corresponding character.


You seem to ask two questions: Why doesn't the tilde print a tilde? and Why is the tilde in the default font placed so high?

The first question is answered in the TeX book:

Plain TeX also reserves the six symbols \ { } ^ _ ~, but you probably don't mind losing these, since they don't appear in normal copy.

So Knuth decided to use the tilde for a tie, a non-breaking space, as he thought that people wouldn't need a tilde symbol — quite rightly in my opinion: I can't remember when I last had to type a tilde, but I use non-breaking spaces almost every day.

The second question is why the tilde is so high in the default font. Here one can only speculate. In TeX the tilde is used as a tie and as an accent command, so I guess that Knuth designed it to reflect these functions. In the code examples of the TeX book the tilde looks, to my taste, quite good:

Donald~E. Knuth \~n

But sadly this means that if you want a tilde that is not so high you either has to tweak it with, for example, a \raisebox, or switch to some other font like lmodern:

Donald~E. Knuth \~n


Ulrike asks why the tilde is so high in the default font. The answer, probably, is that that's where a tilde goes. Remember that a tilde is an accent that goes over a letter, as the "n" in Spanish "señor".

The lower symbol "~" being discussed in this thread is properly known a swung dash.

Tags:

Tilde