2

I am submitting a paper to a journal. In the .cls file the editors provide, the following code appears:

\gdef\@author{\mbox{}}
\def\author{\@ifnextchar [{\@authortwo}{\@authorone}}
\def\@authortwo[#1]#2{\gdef\@author{\uppercase{#2}}\gdef\@shortauthor{#1}}
\def\@authorone#1{\gdef\@author{#1}
\begingroup\gdef\@shortauthor{#1}\endgroup}
\def\shortauthor#1{\gdef\@shortauthor{#1}}
\gdef\@shortauthor{}

I am pretty sure it gives information on how to insert the authors of the paper. Let's say they are called John Haide Well and Maxwell John Baide. How should I write this in my .tex file?

2
  • 3
    Here's a guess: \author[JH Well and MJ Baide]{John Haide Well and Maxwell John Baide} that will be set when you issue \maketitle.
    – Werner
    Commented Sep 14, 2016 at 1:12
  • 2
    I doubt this is really the means of giving information about how to specify the authors. It is, rather, the implementation. Usually, there should be some documentation or an example or something. Also, you really should say where code is from.
    – cfr
    Commented Sep 14, 2016 at 2:18

1 Answer 1

2

Line by line commentary

\gdef\@author{\mbox{}}

Initialize \@author to an empty box

\def\author{\@ifnextchar [{\@authortwo}{\@authorone}}

Define \author (the user level command) to execute \@authortwo if followed by [, \@authorone otherwise.

\def\@authortwo[#1]#2{\gdef\@author{\uppercase{#2}}\gdef\@shortauthor{#1}}

Define \@authortwo to absorb input of the form \author[x]{y} (we know [ is there; store the bracket-delimited argument into \@shortauthor and the normal argument in \@author but surrounded by \uppercase (programming error here).

\def\@authorone#1{\gdef\@author{#1}
\begingroup\gdef\@shortauthor{#1}\endgroup}

Define \@authorone to store its argument in \@author and also store it in \@shortauthor. Why is the latter command done inside a group is something only the code author can explain. Also, why in only one case the author name is uppercased is a big mystery.

\def\shortauthor#1{\gdef\@shortauthor{#1}}
\gdef\@shortauthor{}

A user level command for storing the short author name in \@shortauthor; the variable is initialized to empty.

Example 1

\author{Abigail Uthor}

We end up with \@author and \@shortauthor both containing Abigail Uthor

Example 2

\author[A. Uthor]{Abigail Uthor}

We end up with \@author containing \uppercase{Abigail Uthor} and \@shortauthor containing A. Uthor

Example 3

\author{Abigail Uthor}
\shortauthor{A. Uthor}

Like in example 2, but without the \uppercase.

Example 4

\shortauthor{A. Uthor}
\author{Abigail Uthor}

Like in example 1, because the redefinition of \@shortauthor by \shortauthor is overridden by the code in \author

Why is \uppercase a programming error?

Obviously, the different behavior when the optional argument is used is an error. However uppercasing should be done when \@author is used, not when it is stored. And \MakeUppercase should be used, anyway.

0

You must log in to answer this question.

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