Wie deaktiviere ich „Befehlszeichen“ in einer „Verbatim“-Umgebung?

Wie deaktiviere ich „Befehlszeichen“ in einer „Verbatim“-Umgebung?

Wie kann ich es commandcharsfür eine bestimmte VerbatimUmgebung deaktivieren, wenn ich es zuvor als globale Option festgelegt habe \fvset? Ich versuche Folgendes:

\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}

Ich erhalte:

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

Antwort1

Satz 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}

Bildbeschreibung hier eingeben

verwandte Informationen