Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

3 Answers 3

up vote 27 down vote accepted

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}
share|improve this answer
    
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
    
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 2:53
1  
@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
1  
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

The titling package gives you customisable hooks for re-styling the look of \maketitle. In particular for your case, you might change

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

to

\posttitle{\par\end{center}}

to remove the space you're not so keen on. Furthermore,

\setlength{\droptitle}{-10pt}

will raise the whole title up by 10pt (say), if you like.

share|improve this answer
    
Yet another useful package that I'd never heard of! –  Loop Space Jul 30 '10 at 13:05
2  
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 at 19:14

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].

share|improve this answer
1  
+1 … I actually redefine \maketitle in most of my documents. –  Konrad Rudolph Jul 30 '10 at 12:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.