如何在 verbatim、minted、listings 和 texttt 中打印引号字形?

如何在 verbatim、minted、listings 和 texttt 中打印引号字形?

假设代码中所需的引号被称为字形,如何根据需要打印左引号和右引号,因为它是在 verbatim、minted、listings 环境和 texttt 中的“monster”中打印的?

\documentclass{article}
\usepackage{minted}
\usepackage{listings}
\begin{document}

Is the right quote printed as desired ' Yep.

Is the left quote printed as desired  ` Yep.
\begin{verbatim}
Is it printed in verbatim as desired? '  I don't think so.
\end{verbatim}

\begin{minted}{c++}
// Here's a C code called `monster'
// Is it printed as desired? Nope.
\end{minted}

\begin{lstlisting}[language=c++]
// Here's a C code called `monster'
// Is it printed as desired? Nope.
\end{lstlisting}

\texttt{Let's try our last chance using texttt: `monster' No luck!}\\

It just doesn't print `monster' as desired\\

It keeps on printing those ugly looking \texttt{`} and \texttt{'} instead.\\

How to print the left \& the right quotes as it's printed in `monster'
inside the verbatim, minted, listing environments \& the texttt? 
\end{document}

在此处输入图片描述

相关内容