4

How can I disable commandchars for a particular Verbatim environment, if I set it as a global option via \fvset earlier? I'm trying this:

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

I'm getting:

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

1 Answers1

4

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

enter image description here

DG'
  • 21,727