With example
\RequirePackage{filecontents}
\begin{filecontents*}{main.tex}
%<*example>
\verb|This is an example|
%</example>
\end{filecontents*}
\documentclass{article}
\usepackage{catchfilebetweentags}
\CatchFileBetweenTags{\test}{main.tex}{example}
\begin{document}
\test
\end{document}
I get output:
! LaTeX Error: \verb ended by end of line.
Everything else is working properly. If I copy/paste the piece of code directly in the main.tex
file it works properly.
\verb
doesn't work in the argument of another command, – David Carlisle Oct 2 '14 at 8:16