I'm not quite sure how to describe this, but I want to create a custom command that treats its input as verbatim and allows some control of the output.
In pseudocode, I want:
\newcommand{\code}[1]{\verb{!#1!}}
\newcommand{\samp}[1]{{\normalfont\textsl{\verb!#1!}}}
(But that obviously doesn't work)
newverbs
gets me close to what I need, but e.g.
\RequirePackage{newverbs}
\newverbcommand{\code}{}{}
requires \code!~!
rather than \code{~}
\verb
can never be used in the argument to another command.\verb|something|
instead of\code|something|
? Can you make some examples of usage of your command? Maybe there's a different way to accomplish the task.