I'm going to suggest a very different approach which might seem like a bit of overkill in this particular situation but can pay off in the long run.
I would suggest using keys to accomplish what you want.
So, I would set up keys as follows:
\documentclass{article}
\usepackage{pgfkeys}
\makeatletter
\pgfkeys{/jeroen/entities/.cd,
title/.initial=,
entity/.initial=,
}
\def\jeroen@set@keys#1{%%
\pgfkeys{/jeroen/entities/.cd,#1}}
\def\jeroen@get#1{%%
\pgfkeysvalueof{/jeroen/entities/#1}}
\newcommand\Add[1]{%%
\bgroup
\jeroen@set@keys{#1}%%
\textit{\jeroen@get{entity}} `\jeroen@get{title}'%%
\egroup}
\makeatother
\begin{document}
\Add{title=\LaTeX,entity=article}
\end{document}
In the shortrun, this is a lot of overhead to create for what seems like a simple command. But, in the long run this can pay off dividends.
In my experience, I find instances where I want to use essentially the same underlying macro, but rewriting the macro can be a pain in the neck. For example, I might want to use the macro without calling one of its arguments; I might want to add a third argument or even an optional argument. Using key values, it can be much easier to modify your code or improve upon implementation later.
Key values also get around the issue of remembering which argument is for which content.
By using \bgroup
and \egroup
, you can more easily define default behaviors when a key has not been called. For example,
\documentclass{article}
\usepackage{pgfkeys}
\makeatletter
\pgfkeys{/jeroen/entities/.cd,
title/.initial=,
entity/.initial=article,
}
\def\jeroen@set@keys#1{%%
\pgfkeys{/jeroen/entities/.cd,#1}}
\def\jeroen@get#1{%%
\pgfkeysvalueof{/jeroen/entities/#1}}
\newcommand\Add[1]{%%
\bgroup
\jeroen@set@keys{#1}%%
\textit{\jeroen@get{entity}} `\jeroen@get{title}'%%
\egroup}
\makeatother
\begin{document}
\Add{title=\LaTeX,entity=article}
\Add{title=long nosed creature,entity=elephant}
\Add{title=mathematics}
\end{document}
