I'm working with some generated LaTeX code, which contains code like this:
\command{a, b}
I supply the definition of \command
. It's internals are not really relevant to the question, but most importantly it's passing the argument to another command \backend
(which cannot be changed by me):
\newcommand{\command}[1]{\backend{#1}}
Now my issue is that \backend
fails with an argument such as a, b
because it cannot handle whitespace after that comma.
How can I remove that (single) whitespace after each comma in an argument passed to a macro? Is it possible to do so with another TeX macro?
Best Answer
Just another solution that works (apart from the one linked by campa):
Update: As suggested in the comments now a version with expansion (and with correction of the typo [forgotten comma]).