This is the code that fails to compile:
\documentclass{article}
\usepackage{fancyvrb}
\NewDocumentCommand\foo{v}{\texttt{#1}}
\catcode`\|\active
\AtBeginDocument{\catcode`\|\active\def|{\foo|}}
\catcode`\| 12 %
\begin{document}
\section{Hello, |world|!}
\end{document}
Is it at all possible to fix it, having in mind that ltxdoc also fails with similar code (but with a different error message):
\documentclass{ltxdoc}
\begin{document}
\section{Hello, |world|!}
\end{document}
world? – David Carlisle Nov 15 '22 at 23:19\section{How you can use |printf()| in C++}– yegor256 Nov 15 '22 at 23:21printf()you can make|work here but only for arguments that do not need verbatim at all – David Carlisle Nov 15 '22 at 23:27