# In the minted package, how do I enforce straight single quotes?

Basically I want

\mint{python}|'banana'|


to produce straight single quotes, rather than the curly ones it normally produces (in pdflatex).

-
 Not quite related to the q., but searching for the problem led me here: Outside of verbatim, you can use \char18 and \char13 to get modified  and ' characters. – Mohan Nov 20 '12 at 11:12

## 1 Answer

You can use the package upquote. Note the package loads the package textcomp

The package upquote works also with listings.

% !TEX program  = pdflatex --shell-escape

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{minted}
\usepackage{upquote}
\begin{document}
\mint[fontfamily=tt]{python}|'banana'|
\end{document}


The result:

-
Awesome. Thanks! – nt01 Mar 9 '12 at 22:49
For anyone who comes across this later: the upquote package modifies all verbatim text (\verb and the verbatim environment) to render ' and  as the upright versions, not the “smart” ‘ and ’. Since (as I understand it) minted and listings rely on fancyvrb, which itself calls out to verbatim text under the hood, this has the desired effect. – Antal S-Z Sep 27 '12 at 6:02