如何在“Verbatim”環境中停用“commandchars”?

如何在“Verbatim”環境中停用“commandchars”?

如果我之前將其設定為全域選項,如何停用特定commandchars環境?我正在嘗試這個:Verbatim\fvset

\documentclass{article}
\usepackage{fancyvrb}
\fvset{commandchars=+\{\}}
\begin{document}
\begin{Verbatim}
Hello, +textbf{world}!
\end{Verbatim}
Now, I want to disable command chars:
\begin{Verbatim}[commandchars=]
Hello, +textbf{world}!
\end{Verbatim}
\end{document}

我越來越:

! Improper alphabetic constant.
<to be read again>
                   \relax
l.9 \begin{Verbatim}[commandchars=]

答案1

commandchars=none

\documentclass{article}
\usepackage{fancyvrb}
\fvset{commandchars=+\{\}}
\begin{document}
\begin{Verbatim}
    Hello, +textbf{world}!
\end{Verbatim}
Now, I want to disable command chars:
\begin{Verbatim}[commandchars=none]
    Hello, +textbf{world}!
\end{Verbatim}
\end{document}

在此輸入影像描述

相關內容