2

\maketitle in the article class prints the title above the author but I want to reverse that and print the author above the title. Any suggestions?

\title{Can you find the solution?}
\author{you}

\begin{document}
\maketitle
\end{document}

There's, of course, this solution but it is far from pretty

\begingroup
    \centering
    \large You

    \LARGE Can you find the solution?
\endgroup

There's also this solution whereby I guess I would simply replace date with author but there seems to be a lot of additional styling embedded in there that are not necessary in my case.

2
  • 2
    With the titlepage environment?
    – Bernard
    May 5, 2020 at 23:27
  • @Bernard not necessarily but if it would be easier then yes. Currently, I'm declaring the titlepage argument in the documentclass options May 5, 2020 at 23:57

1 Answer 1

3

Per its definition in the article document class, if the titlepage option is not set, the \maketitle macro eventually calls the \@maketitle macro which, in turn, is defined as follows:

\def\@maketitle{%
  \newpage
  \null
  \vskip 2em%
  \begin{center}%
  \let \footnote \thanks
    {\LARGE \@title \par}%
    \vskip 1.5em%
    {\large
      \lineskip .5em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 1em%
    {\large \@date}%
  \end{center}%
  \par
  \vskip 1.5em}

Note, in particular, the instructions \@title, \@author, and \@date instructions, and observe that they're contained in TeX groups for which \LARGE, \large, and \large are in effect.

To force LaTeX to typeset the author-related information before the title-related information, you could redefine \@maketitle as follows:

\makeatletter
\renewcommand\@maketitle{%
  \newpage
  \null
  \vskip 2em%
  \begin{center}%
  \let \footnote \thanks
    {\large
      \lineskip .5em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 1.5em%
    {\LARGE \@title \par}%
    \vskip 2.5em%
    {\large \@date}%
  \end{center}%
  \par
  \vskip 1.5em}
\makeatother

Note the four \vskip directives. Naturally, you're free to change their arguments to suit your tastes.

A full MWE -- screenshot not necessary, I believe:

\documentclass{article}
\makeatletter
\renewcommand\@maketitle{%
  \newpage
  \null
  \vskip 2em%
  \begin{center}%
  \let \footnote \thanks
    {\large
      \lineskip .5em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 1.5em%
    {\LARGE \@title \par}%
    \vskip 2.5em%
    {\large \@date}%
  \end{center}%
  \par
  \vskip 1.5em}
\makeatother

\author{Author}
\title{Title}
\date{Date}

\begin{document}
\maketitle
\end{document}


If, on the other hand, the titlepage option is set, the \maketitle macro does not invoke a subsidiary macro called \@maketitle. In that case, it's necessary to redefine the \maketitle macro directly, say as follows:

  \makeatletter
  \renewcommand\maketitle{\begin{titlepage}%
  \let\footnotesize\small
  \let\footnoterule\relax
  \let \footnote \thanks
  \null\vfil
  \vskip 60\p@
  \begin{center}%
    {\large
     \lineskip .75em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 3em%
    {\LARGE \@title \par}%
    \vskip 3em%
    {\large \@date \par}%      
  \end{center}\par
  \@thanks
  \vfil\null
  \end{titlepage}%
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}
\makeatother
3
  • thanks! This works as requested. However, I'm using fullpage package for slimmer margins but with the re-defined command, the margins return to the article class default May 6, 2020 at 0:37
  • @GeneBurinsky - Pleas see the addendum I just posted, on how to redefine \maketitle if the titlepage option is set. Does the addendum also work with fullpage? (It would have been useful if you'd mentioned that you use this package -- which I'm not familiar with, incidentally -- up front.)
    – Mico
    May 6, 2020 at 0:39
  • 1
    thank you! The titlepage overwrite preserves the margins set by the fullpage package and everything works like a charm. May 6, 2020 at 0:41

You must log in to answer this question.

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