I just did a small recherche on both characters (after being quite shocked that I need to escape ^
which, while documented, I never needed so far yet), and I found out that switching the font looks like a good solution.
For serif (default/roman) fonts, I only looked at the default cmr and found both tilde and caret ugly but usable. (Most documents I deal with are set in sans-serif for body text… not my decision to make, though.)
For sans-serif fonts, I looked at the default cmss (ugly but usable, too), pxss (looking perfect; this is from the pxfonts
package, though I recommend against using it and in favour of just adding \renewcommand{\sfdefault}{pxss}%
to your document). I’ve also looked at the nōn-free fonts museo (via .ttf
) and pfr (via Type1 glue); both are good but not quite as good as pxss.
For teletype fonts, I looked at cmtt (default, extremely ugly) and inconsolata (perfect; this font is my favourite ever since I discovered it for having a slashed 0 “the right way”; \usepackage[varqu,varl]{inconsolata}%
to activate it).
Specifically for this answer, I looked at whether pxfont’s roman flavour is just as good as its sans-serif flavour (yes, it is).
With all fonts, I looked at \textasciitilde
, \textasciicircum
and \verb|X|
, but the “verb” one was always inferior, so I now use the stock \textasciitilde
and \textasciicircum
macros to quote these characters.
Therefore, I recommend you to add the following to your document preamble…
\renewcommand{\rmdefault}{pxr}%
\renewcommand{\sfdefault}{pxss}%
\usepackage[varqu,varl]{inconsolata}%
… and then use either of these three fonts as it suits you. (However, I fully understand if you don’t want to switch fonts (.oO(except avoiding Inconsolata, which I can’t understand) ☻☺), and refer to the other answers to the question for that then.)