1

I'm currently setting up a .sty file for an experimental protocol. In that style file, I'm editing the \maketitle command so that it prints my titlepage with all the information set in the various "variables" like \author{}.

That said, I wondered how I could print the different authors below each other. The default command is:

\begin{tabular}[t]{c}%
    \@author
\end{tabular}\par%

This results in an output like:

                   Author 1                      Author 2

(evenly spread over the linewidth)

What I want is

Author 1
Author 2

How can I achieve this?

Edit

I should point out, that I'm modifying the output of the authors based on the state of the self defined \supervisor variable. If a supervisor is set, the output should be

\begin{minipage}{0.5\linewidth}
    \begin{flushleft} \large
        \emph{Authors:}\\
        \begin{tabular}[t]{c}%
            \@author
        \end{tabular}\par%
    \end{flushleft}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
    \begin{flushright} \large
        \emph{Supervisor:} \\
        \@supervisor
    \end{flushright}
\end{minipage}

Which results in this:

Supervisor set

In this case (where the supervisor is set), the names of the authors should be printed one below of the other.


MWE

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{Experimental Protocol Title}
\author{Jon Doe \and Jane Doe}
\date{\today}

\begin{document}

\maketitle

\end{document}

Which generates the following output

Output of MWE

2

3 Answers 3

2

Quick and dirty hack to get multiple rows in the tabular (which will probably break all kinds of stuff, I just don't know yet which):

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{Experimental Protocol Title}
\author{Jon Doe \and Jane Doe}
\date{\today}

\renewcommand{\and}{\\}

\begin{document}

\maketitle

\end{document}

enter image description here

1
  • Well, that's very dirty ;-) I think that the key is to modify the \begin{tabular}, but I don't know how...
    – Sam
    Commented Sep 12, 2017 at 15:34
1

Aesthetically, I think the authors in the (centred) list should be left-aligned. This hack, with xpatch and stackengine does the trick. The authors in the list have to be separated with a semi-colon:

    \documentclass{article}
    \usepackage[utf8]{inputenc}
    \usepackage[usestackEOL]{stackengine}
    \usepackage{xpatch}

    \title{Experimental Protocol Title}
    \author{Jon Doe ; Jane Doe ; Tweedledum ; Tweedledee}
    \date{\today}

    \xpatchcmd{\@maketitle}{\@author}{\setstackEOL{;}\Centerstack[l]{\@author}}{}{}

    \begin{document}

    \maketitle

     \end{document} 

enter image description here

2
  • What if I don't want to have \@maketitle be redefined? I already modified that command. How could I only redefine \@author to your code?
    – Sam
    Commented Sep 12, 2017 at 21:07
  • Redefining \@author is beyond my capacities. Its function is to store the value of \author, and use it in macros, not to format it. But you can combine your modifications with this one.
    – Bernard
    Commented Sep 12, 2017 at 21:43
1

\usepackage[affil-it]{authblk} does the job

1

You must log in to answer this question.

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