I'm not sure exactly what terminology to use to ask this question.

What I want to do is define a command pluralize such that I can do this:


the \individual with the \individuals

and then get

the individual with the individuals

The reason I want to do this is because I might change terminology like:


the \individual with the \individuals

and then get

the name with the names

Currently what I'm doing is explicitly writing out the plural version of each command like:


But it seems like I should be able to turn this into a macro for simple pluralizations.

I have tried three things so far that do not work. First I tried what I thought may work:


Then I looked online. I tried following the guidelines in Defining a newcommand, with variable name, inside another newcommand I came up with

    \expandafter\newcommand\csname #1s\endcsname{#1{}s\xspace}%


\expandafter\newcommand\csname #1s\endcsname{#1{}s}%

but I either get a compile error, or an error if I use the macro. I'm not really sure what the @namedef, \expandafter, or \csname commands do either.

How can I correctly define the pluralize command?


2 Answers 2


I'd change the approach:

  \expandafter\newcommand\csname #2\endcsname{#3\xspace}%
  \expandafter\newcommand\csname #2s\endcsname{#3#1\xspace}%


In the document you can do

The \individual eats \veggie, while \individuals eat \veggies.

that will print

The name eats potato, while names eat potatoes.

Note. In general I recommend against using \xspace; I do also in this case.

  • With three arguments, the first one optional, I think your argument numbers in the newcommand are incorrect. The first would be \csname #2\endcsname{#3}, the plural one would be \csname #2s\endcsname{#3#1}, right? Aug 9, 2015 at 4:42
  • @AndrewCashner Right!
    – egreg
    Aug 9, 2015 at 8:44

Here is one way to achieve it:

enter image description here



% https://tex.stackexchange.com/a/64380/5764

\NewDocumentCommand{\createplural}{m m O{s}}{%



The \individual with the \individuals.


\pluralize{<csname>}{<name>}[<plural>] provides an optional "<plural>" as the last argument.

While using xspace is sometimes beneficial, it also has its drawbacks.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .