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.
- 2,139
- 5
- 19
- 14
3 Answers
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}
- 30,891
- 23
- 67
- 87
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.
- 73,872
-
1
-
11It 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
articledocument class specifies60 ptsof 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
-
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:
- There are some
@s in the definition, so you will need to enclose the definition with\makeatletterbefore and\makeatotherafterwards. - The definition starts
\newcommand\maketitle. As\maketitlewill already be a command, you need to change the\newcommandto\renewcommand. - Make sure you get the right one. There are two definitions of
\maketitleinarticle.cls, depending on whether you send the optiontitlepageto 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].
- 153,724
- 43
- 389
- 751
\vspace{-length}command that will add negative vertical space (i.e. take space away). – Michael Underwood Jul 29 '10 at 17:51\vspaceat the beginning of the date instead of the end of the author. Oh well. – Jeremy Hurwitz Jul 30 '10 at 02:53\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:26srcartcl. One should put the\vspacebefore 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