This MWE
\documentclass{article}
\usepackage{xparse}
\begin{document}
\NewDocumentCommand{\myVerbatim}{v}{#1}
\myVerbatim|This is some text, which can contain $\sin(x)$ or code or $$|
\verb|This is some text, which can contain $\sin(x)$ or code $$|
\end{document}
Produces, using lualatex, this
I thought they should come out the same. Why are they different?
From manual
TL 2015
\verb
is a typesetting command: av
-type argument is about 'grabbing' stuff, what you do with it is down to you