I am trying to incorporate programming examples in a LaTeX document.
The document renders nicely with pdflatex; however, the single quotes get transformed into U+2019, a right-single-quotation mark. And, a backtick renders as U+2018, a left-single-quotation-mark.
What I need is a U+0027 real apostrophe so that the code can be successfully cut-and-pasted from the PDF into actual source code.
\documentclass{article}
\usepackage{alltt}
\usepackage{color}
\usepackage{fullpage}
\begin{document}
\center{\LARGE{hello.py}}
\begin{alltt}
{\color{red}print} 'hello world'
\end{alltt}
\end{document}
The same issue exists also with straight typewriter fonts: \tt{don't worry, be happy}
. I'm unclear how to control the exact unicode character that is produced.