如何逐字取得直單引號和程式碼範例

如何逐字取得直單引號和程式碼範例

我的文件中有類似 的內容print('abc'),但它被轉換為print(’abc’)(注意更改後的引用),這會破壞編譯。

我怎樣才能創建環境\begin{codeexample}\begin{verbatim}(獎勵)列印真實的報價? (請注意,我仍然希望原始檔案包含 true ',因為我仍然希望能夠從比 PDF 更可靠的來源檔案複製/貼上內容)。

微量元素:

\documentclass[a4paper,doc2]{ltxdoc} % doc2 is needed to force the old version, or links get colored in a weird red way even with hidelinks. https://github.com/latex3/latex2e/issues/822

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Packages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Warning: if you compile and get:
%% ERROR: Argument of \tikz@lib@matrix@with@options has an extra }.
%% make sure to fix catcodes around it as | is given a different meaning in ltxdoc.

\usepackage{amsmath}
\usepackage[margin=3cm]{geometry}
\usepackage{calc}
\usepackage{tikz}
\input{pgfmanual-en-macros.tex}

\usepackage{tikz-cd}

\usepackage[hidelinks]{hyperref}
\usepackage{cleveref}

\begin{document}

\tableofcontents

\begin{verbatim}
Hey, see this is'nt copy/pastable due to the simple 'quotes' (but "double quotes" seem to be fine).
\end{verbatim}

\begin{codeexample}[code only]
Hey, see this is'nt copy/pastable due to the simple 'quotes' (but "double quotes" seem to be fine).
\end{codeexample}

\end{document}

相關內容