# [texhax] using a macro which changes catcodes inside another macro

Daniel H. Luecking luecking at uark.edu
Thu Nov 16 20:44:08 CET 2017

```For an example as simple as this you might use

\newcommand{\Akkord}[2]{#1 and #2 and \chordname}
\Akkord{this}{that}{C^7}
This means that \chordname gets to do what it needs before
the argument C^7 is tokenized. This pretty much requires
the argument of \chordname to be after all the other
arguments, and that might not always be feasible.

However, etex's \scantokens might be useful. I haven't
tested this, but
\newcommand{\Akkord}[3]{#1 and #2 and \expandafter\chordname\scantokens{#3}}
might work.

Tschirs,
Dan