# How to count the number of authors of a document?

I need to make a change to a Latex style (.sty) which contains the following line:

{\large {\boldCondensed\color{corporate3Color}\raggedright AUTHORS: \MakeUppercase \@author\par}}


The problem is that when there is a single author, the results prints "AUTHORS: JOHN DOE" with the "S" at the end of authors.

Hence, I would like to find a way to make sure that if there is a single author, the "S" is removed from the header.

How do I recover the number of authors that was provided in the document?

-
It all depends on how authors' names are input. –  egreg Jun 14 '12 at 8:32
You can find other solutions in a similar question: How to choose singular or plural form from presence of \and in argument –  Ignasi Jun 14 '12 at 9:12

If you delimit multiple authors with \and macro, you can try something like:

\documentclass{article}

\makeatletter
\newcommand\testauthors{%
\expandafter\tst@au\@author\and\nil%
}
\def\tst@au#1\and#2\nil{%
\edef\test{#2}%
\ifx\test\@empty Author\else Authors\fi%
}
\newcommand\printauthors{%
{%
\protected\def\and{and }%
\large {\testauthors: \MakeUppercase{\@author}\par}
}
}
\makeatother
\begin{document}
\author{John, Doe \and Corleone, Sonny}
\printauthors\par
\author{Doe, John}
\printauthors
\end{document}


-