How can I emphasize inline verbatim text? \emph{\verb|$Text|}
creates an error. Nothing else I tried works either, e.g. \Verb. Is there any easy way to do this? I would need all kinds of special latex characters in the verbatim text (which contains program code fragments), not only "$".
Of course one can do \emph{\$Text}
. But having to escape every single special character takes a lot of time and changes the highlighted program code fragment in the latex source file, which is not desirable.
\makeatletter\renewcommand\verbatim@font{\ttfamily}\makeatother
and then use{\em \verb|$Text|}
instead. Also, show us a compilable example of your document.