In a package, I'm building macro names from the values of options passed to a function. Now, the values should also allow a - inside, but the command names I'm building with \csname do not. So, I need to remove all - from the option value inside the \csname...\endcsname. How can I do this.
Simple example:
\documentclass{report}
\makeatletter
% Create tex name of the form "test@ARGUMENT".
% PROBLEM: Need to remove - from #1...
\newcommand{\process}[1]{\typeout{Process called with `#1'} \csname test@#1\endcsname}
\newcommand{\test@mytag}{\typeout{test@mytag called} It worked}
\makeatother
\begin{document}
% The following should actually try to execute \test@mytag (i.e. the - removed)
\process{my-tag} % Doesn't work, needed for values like shade-tb-inverse
\process{mytag} % Works, but ugly with values like shadetbinverse
\end{document}
I want a command that takes an argument (in my case, an option value filtered
by xkeyval's choicekey to one of certain valid values). Now, I want to call
a command \test@VALUE. Unfortunately, the option values should allow dashes,
like my-tag or shade-lr. As LaTeX does not allow dashes in commands, I need
to filter all - inside the \csname. How can I do that?