Latex - backslash and tilde symbols in latex



What is latex symbols

  • The Comprehensive LaTeX Symbol List helps to achieve the same.
  • \textbackslash and \textasciitilde are found in Table 2 of the list, and page 101 has some other options for the tilde
  • $\sim$ and \texttildelow from the textcomp package, possibly using some font other than Computer Modern to get a nice vertically centered tilde
  • It also suggests using the url package if you are typesetting URL's or Unix file names. In case you use these in a text, do like so: bar\textasciitilde{}foo.

Sample code:

\begingroup
  \catcode `~=11
  \gdef\mytilde{~}
  \catcode `\|=0
  \catcode `\\=11
  |gdef|mybs{\}
|endgroup

  • Below code may help you further,
This is a tilde: \mytilde
This is a backslash: \mybs


\textbackslash
 \texttt{\char`\~} or $\sim$

  • use the "plain TeX" method of indexing the actual ascii character in the current font:
\char`\\
\char`\~

  • For the tilde, you can use empty curly brace pair. That puts the "over the letter" tilde over an "empty" letter, so it's placed upward.
My tilde\~{}here 

Related Searches to backslash and tilde symbols in latex