127

In \documentclass{article}, the \maketitle command results in a lot of wasted vertical space. Is there any way for me to remove it? In other words, I'd like the author to appear directly below the title, and the date directly below the author.

Jeremy Hurwitz
  • 2,139
  • 5
  • 19
  • 14

3 Answers3

110

You could alter the relevant documentclass definition wherein the \maketitle command is defined. But, don't do that. Your document will then compile differently for you than for others.

Try something like this:

\documentclass{article}

\author{Some random fellow\vspace{-2ex}% Toggle commenting out the command
}
\date{A long time ago}
\title{A comprehensive treatise on everything\vspace{-2ex}% to see the effect
}

\begin{document}
    \maketitle
\end{document}
vanden
  • 30,891
  • 23
  • 67
  • 87
  • 3
    In particular, it is the \vspace{-length} command that will add negative vertical space (i.e. take space away). – Michael Underwood Jul 29 '10 at 17:51
  • 4
    It's ugly, but it worked. For some reason, I had to put the author/date \vspace at the beginning of the date instead of the end of the author. Oh well. – Jeremy Hurwitz Jul 30 '10 at 02:53
  • 3
    @Jeremy: "Not pretty" at least, yes. When I find myself doing something that's a bit ugly to modify something from a LaTeX document class, I imagine Leslie Lamport saying "well, then, maybe don't do it?" The problem for me is that sometimes his stylistic judgments strike me as too severe. The case at hand is one; I often tightened up a title block on class handouts without a separate title page where the tightening saved the handout from flowing onto another page. – vanden Jul 30 '10 at 13:07
  • 4
    Generally added formatting information in this way is considered bad style; finding a way to change the underlying formatting is a better idea so the source is kept "clean". – Will Robertson Jul 30 '10 at 14:17
  • 1
    @Will: I certainly agree in general. But, the title page is a one off if ever anything is. @Andrew's approach of redefining and your suggested package both seem perfectly reasonable to me, too. Here, I feel its horses for courses. The voting, though, seems to suggest I'm in the minority ;-) – vanden Jul 30 '10 at 14:38
  • One problem with this approach is if the arguments passed to \author{} etc. are used by things other than \maketitle. You might imagine using this information in a header for example. – alex.jordan Jan 28 '15 at 01:26
  • 1
    A slight caveat (although this is not mentioned in the exact question): this method does not work "as it is" for the KOMA script article class srcartcl. One should put the \vspace before the title to shift it up: \title{\vspace{-2ex}A comprehensive treatise on everything}, otherwise it is the author that gets shifted up and not the title itself. – typesanitizer Oct 17 '15 at 12:47
75

The titling package gives you customisable hooks for re-styling the look of \maketitle.

For example \posttitle is a command to define the ‘closing material’ to the title block. Its default with this package is

\posttitle{\par\end{center}\vskip 0.5em}

So to tighten up the space a bit you might write instead:

\posttitle{\par\end{center}}

Furthermore,

\setlength{\droptitle}{-10pt}

will raise the whole title up by 10pt (say), to give more space for content beneath the title.

  • 1
    Yet another useful package that I'd never heard of! – Andrew Stacey Jul 30 '10 at 13:05
  • 11
    It should be noted for newbies that this requires adding a \usepackage{titling} and goes outside of your \begin{document}.

    Is there a way to remove the additional space above the title? What about making the title horizontal?

    – Bret May 25 '14 at 19:14
  • Thanks to @LoopSpace 's pointer in his answer, I was able to find that the article document class specifies 60 pts of vertical space above the title, so to remove it completely, use \setlength{\droptitle}{-60pt}. – Travis Bemrose Feb 09 '16 at 23:58
  • the answer is unclear. it assumes there is already "\posttitle{\par\end{center}\vskip 0.5em}" – Richard May 16 '20 at 22:35
  • @Richard — thanks, I've clarified. – Will Robertson May 17 '20 at 01:20
21

vanden says:

You could alter the relevant documentclass definition wherein the \maketitle command is defined. But, don't do that.

I completely agree with the second sentence. However, there's an alternative that gives you a little more control whilst ensuring that your document compiles the same wherever it is sent: copy the relevant section from the article.cls file into the preamble of your article and make the relevant changes there. Three things to note:

  1. There are some @s in the definition, so you will need to enclose the definition with \makeatletter before and \makeatother afterwards.
  2. The definition starts \newcommand\maketitle. As \maketitle will already be a command, you need to change the \newcommand to \renewcommand.
  3. Make sure you get the right one. There are two definitions of \maketitle in article.cls, depending on whether you send the option titlepage to the class or not.

I don't recommend this to a beginner, but to someone wanting to learn a little more about how things work, it's a reasonable way to peek under the bonnet [translation: hood].

Andrew Stacey
  • 153,724
  • 43
  • 389
  • 751