1

I have here a very specific problem but I think the way to solve it may include a general knowledge that may be of interest to other people too.

I have a .cls file which controls the style of a paper I'm writting. The style fits my needs almost perfectly but I must change a few things so it can be exactly what I need. The way things are now I can use the functions \author, \name and \ affiliation to write the authors and the universities they belong to at the top of the first page of the paper. This is done like this

\author{\name{John Doe}
\affiliation{State University of Nowhere}}

and I get as result (the title is called by other function which I have no problem with, just ignore it)

enter image description here

If the paper is a colaboration between several authors I can do this

\author{\name{John Doe}
\affiliation{State University of Nowhere}

\name{John Doe}
\affiliation{State University of Nowhere}

\name{John Doe}
\affiliation{State University of Nowhere}}

to obtain

enter image description here

and this is no good. It is not visually pleasing, it takes too much space and I don't want to repeat the name of the University if two or more of the authors come from the same institution.

What I want to do is to write the names of the authors side by side and them pass the institutions to below the names, with one institution per line. The names are no problem. I can put them in this form by writting

\name{John Doe, John Doe, John Doe}

but I could do nothing about the institutions. In the .cls files these functions are defined like this

 \author{%
 \hspace{-4pt}%
 \begin{tabular*}{\textwidth}{@{}ll@{}}%
 \@TheAuthor%
 \end{tabular*}%
 \\%
 \hspace{-9pt}%
 \HorRule%
 }
 %

 \renewcommand{\author}[1]{\def\@TheAuthor{#1}}
 \newcommand{\name}[1]{\large%
 \lineskip 0.5em%
 \usefont{T1}{phv}{b}{sl}%
 \color{DarkRed}%
 #1&%
 }

 \newcommand{\affiliation}[1]{%
 \hskip  0.75em%
 \footnotesize%
 \usefont{T1}{phv}{m}{sl}%
 \color{Black}%
 \begin{minipage}{\linewidth}%
 #1%
 \end{minipage}%
 \\%
 }

I don't understand what is going on with these definitions. Can you give me a hand here?

Thank you very much.

1
  • One should never use custom .cls for a paper intended to be submitted to a peer review journal. Either use custom .cls provided by the journal you are planning to submit your paper or if the journal wants just pdf file than use generic style. Nov 5, 2016 at 3:04

1 Answer 1

7

What \author does is (more or less) construct a tabular

\begin{tabular}{...}
  name & affiliation \\
  name & affiliation
\end{tabular}

The & is supplied by the \name macro and the \\ by \affiliation. A quick and dirty solution for you is to define a \names macro that is a copy of \name with the & replaced by \\.

\newcommand{\names}[1]{\large%
 \lineskip 0.5em%
 \usefont{T1}{phv}{b}{sl}%
 \color{DarkRed}%
 #1\\%
 }

and use

\author{\names{John Doe, John Doe, John Doe}
\affiliation{State University of Nowhere}}.

This still gives you the option to use the original format for single authors.

1
  • Very very helpful. Worked like a charm. Thank you very much Piet.
    – Gabu
    Nov 4, 2016 at 23:43

You must log in to answer this question.

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