SE, lately I'm playing around with expl3 and xparse a little and I encountered following problem: I want to create a command which creates a new
command -- similar to this post. This is not as hard, as long the second command doesn't have any arguments; trying to create a command, which accepts arguments is a little more tricky.
What I got so far:
\documentclass{article}
\usepackage{xparse}
\NewDocumentCommand\test{ m}
{
\NewDocumentCommand#1 {m}
{My name is \string#1, king of kings}
}
\begin{document}
\test{\ozymandias}
\ozymandias{\manthano}
\end{document}
This outputs My name is ozymandias, king of kings, which gives the correct sonnet, but not what I wanted. I know where the problem is, I just don't know how to fix it atm :)
\string#1is unclear! What do you expect this to do? – Feb 04 '16 at 23:25##1– egreg Feb 04 '16 at 23:47\string#1was used as an example, basically I just intended to do more complicated stuff. – manthano Feb 05 '16 at 07:04