So, I know there are a lot of posts about this already, with answers like \textasciitilde
, \texttildelow
and $\sim$
and they all seam to work in their own way. But what I've found is that they look like tilde when typeset, but when you highlight the character, copy it and paste it into a terminal window, it's a completely different character.
I've found that \texttildelow
is the only command that creates an "actual" tilde-character, when copied and pasted into a terminal. However, it is printed very low in the pdf when used, and it looks like something else.
I need help managing all these ways to type tilde. I want to type tilde in both verbatim text and in normal text mode. What I would like is for the characters to look like a normal tilde when typeset, and also be the "real" tilde when copied into the terminal window. This is to simplify the process of using the commands I write. I don't think a sample text is necessary in this particular post, but if needed I can edit that in.
\documentclass[11pt]{paper}
\usepackage{hyperref, xcolor, graphicx, textcomp}
\hypersetup{colorlinks=true, urlcolor=blue}
\setlength\parindent{0pt}
\newenvironment{accs}
{\color{black}
\begin{tt}
\fontsize{11pt}{11pt}\selectfont}
{\end{tt}}
\title{Resequencing Analysis}
\begin{document}
\maketitle
~/glob/gatk
\begin{accs}
$ mkdir ~/glob/gatk
\end{accs}\\
\end{document}
I have now solved a part of the problem by using the environment
\newenvironment{vtim}
{\verbatim
\fontsize{11pt}{11pt}\selectfont}
{\endvarbatim}
instead, but the tilde character still looks weird in the .pdf as it is raised up... If I use the $\sim$ it can't be copied into the terminal :/
\texttildelow
is defined for exampleaccsupp
package, with something like\BeginAccSupp{ActualText={~}}\textasciitilde\EndAccSupp{}
would work, but it does not: you can have two different symbols, one printed and one copy/pastable, but in that specific case it yield\protect\unhbox\voidb@x\penalty\@M\{}
!