Tag Info

New answers tagged


It seems like this is also a situation where \scantokens could come in nicely: \documentclass[a4paper]{scrreprt} \newcommand{\cmd}{\begingroup \catcode`_=12 \cmdint} \newcommand{\cmdint}[1]{% \texttt{\scantokens{#1\noexpand}}% \endgroup } \newenvironment{wrap}{}{} \usepackage{environ} \NewEnviron{wrap2}{\BODY} \begin{document} \cmd{some_test} ...


The solution depends on the alphabet, used for the variables. If these are identifiers with upper and lower case letters, digits, underscore and some other harmless symbols (with category code 12/other, as punctuation chars) then \detokenize can be used to normalize the category codes of the identifier to token with category code 12 (same as digits): ...

Top 50 recent answers are included