My question is related to the following two
- How to have straight single quotes in lstlistings
- In the minted package, how do I enforce straight single quotes?
but I'm specifically asking about double-quote characters (ASCII decimal code 34). They appear curly in my listings. How can I get straight double quotes instead?
MWE:
\documentclass{article}
\usepackage{textcomp,upquote,listings}
\lstset{upquote=true}
\begin{document}
\begin{lstlisting}
echo "Hello, world!"
\end{lstlisting}
\end{document}
produces
I understand that the upquote package only applies to single quotes. How can I make it apply to double quotes as well?


listings.styfile actually only handles single quotes, but your example does compiles to straight double quotes. However, I ran into a failed example as well. – wlnirvana Oct 25 '18 at 01:25\setmonofont{Consolas}voids the effects. How do I fix it? – Gqqnbig Feb 29 '20 at 02:08