## What’s New in the?

Q: Is there a way to combine the Command and the Argument in macros in a ewcommand? I am writing a macro for \assignments in my thesis. I want the assignment to be Assignment [a] I want to use a ewcommand so that I can mix macro arguments and command arguments easily. I am starting with this code: \documentclass{article} \usepackage{amsmath} ewcommand*{\assignments}{\@ifnextchar[{\assignments}{\assignments[]}}} ewcommand*{\assignments[2]}{ ewcommand*{\assignedTo}{#1}} ewcommand*{\assignedTo[2]}{ ewcommand*{#1}[2]{Assignment~[#1]}} \begin{document} \assignments[a] \assignments[b] \assignedTo[c] \assignedTo[d] \end{document} The result is Assignment [a] Assignment [] Assignment [b] Assignment [c] Assignment [d] As it is, each time I add \assignments to the assignment, I have to increase the number in the second argument of \assignedTo (or add a third argument to \assignedTo), so that the macro uses the same definition that I want. So, I found the following code, which works, but I guess there is a better solution to this problem \documentclass{article} \usepackage{amsmath} ewcommand*{\assignments}{\@ifnextchar[{\assignments}{\assignments[]}}} ewcommand*{\assignments[2]}{ ewcommand*{\assignedTo[3]}{ ewcommand*{\assignedTo}[2]{Assignment~[#1]}}} ewcommand*{\assignedTo[3]}{ ewcommand*{\assignedTo}[2]{Assignment~[#1]}} \begin{document} \assignments[a] \assignments[b] \assignments[c] \assignments[d] \end