160

What is the best way to shift the title text 'up' in a LaTeX document compiled with pdftex? When I do this:

\documentclass[12pt,letterpaper, onecolumn]{article}
\setlength{\topmargin}{0in}
\title{Blah Blah Cool}
\date {}

\begin{document}
    \maketitle
    \section{Foo}
    foobar foobar foobar...
\end{document}

There is a quite a bit of space between the very top of the page and the title ("Blah Blah Cool"). How can I decrease/remove this space?

0

5 Answers 5

134

The titling package might help.

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{titling}

\setlength{\droptitle}{-10em}   % This is your set screw

\author{The Author}
\title{The Title}

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

See the package manual for more details.

4
  • 5
    I like the "set screw" label! :-)
    – Mico
    Sep 26, 2011 at 22:41
  • 7
    Why do you use em to set heights? Wouldn't ex make more sense?
    – Laura
    Oct 16, 2012 at 17:38
  • @Laura for some newbies, can you please explain why ex would make more sense? Thanks ! May 3, 2023 at 8:16
  • If you look at en.wikibooks.org/wiki/LaTeX/Lengths you'll see that em is more 'width' than a height measurement. The reason I probably proposed ex instead is that the width and the height of an 'x' are the same.
    – Laura
    May 5, 2023 at 7:30
102

A simple alternative is to use \vspace{}:

\documentclass[a4paper,11pt]{article}

\title{\vspace{-2.0cm}Stuff}
\author{Me Myself}

\begin{document}
\maketitle

\end{document}
1
  • 3
    To avoid any risk of messing up the PDF metadata, it can be safer to use: \texorpdfstring{\vspace{...}}{}
    – a3nm
    Oct 19, 2021 at 9:05
41

Instead of using \author, \title, \date, and \maketitle, you can simply design your own title:

\documentclass[12pt,letterpaper, onecolumn]{article}

\begin{document}

\begingroup  
  \centering
  \LARGE Blah Blah Cool\\[1.5em]
  \large The Author\par
\endgroup

\section{Foo}
    foobar foobar foobar...

\end{document}
4
  • 15
    Er, I was going to downvote but then saw your rep. Now I have to ask: I was always under the impression that it was bad to typeset stuff like this but you mention it without any warning and it gives me the impression that it's 'standard procedure'. Have I been wrong all this time?
    – recluze
    Dec 28, 2012 at 13:23
  • 8
    @recluze I am extremely sorry, but I just noticed this comment today (I was on vacation when you wrote it). What exactly do you mean with "typeset stuff like this"? It's well known that the standard \maketitle is very basic; if one wants flexibility (at least in the standard classes) and doesn't want (or doesn't know how) to redefine internal commands like \@maketitle, it's a valid option to design the title page manually (or using a dedicated package, as in Thorsten's answer). Apr 1, 2013 at 14:13
  • 5
    Thanks for the answer. You understood my comment correctly and I do agree with your answer. Just wanted to point out that the "best way" would be redefine \maketitle. I've seen people get carried away with \Large etc. Once they start, they can't stop :)
    – recluze
    Apr 1, 2013 at 14:57
  • 1
    @GonzaloMedina : I just joined this SE community so as to upvote your reply.
    – Gaurav
    May 22, 2016 at 12:38
15

Lengths like \topmargin influence the general margins of a document (although using packages like geometry is the preferred way to do so). To remove the spacing at the start of a title created with \maketitle (and without using the titlepage option of the article class), one may alter the definition of the internal class command \@maketitle. In the following example, I've included the original definition and deleted two lines that otherwise would produce the vertical space.

EDIT: You may wonder what do \makeatletter and \makeatother do.

\documentclass[12pt,letterpaper,onecolumn]{article}

\makeatletter
\def\@maketitle{%
  \newpage
%  \null% DELETED
%  \vskip 2em% DELETED
  \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}
\makeatother

\title{Blah Blah Cool}
\date {}

\begin{document}
    \maketitle
    \section{Foo}
    foobar foobar foobar...
\end{document}
1
  • thanks a lot! Out of curiosity, how would you go for finding the original source code of \maketitle Oct 31, 2023 at 14:33
3

Without using any external packages we can have a simple title at the top of the page, without a date, as follows.

\documentclass[12pt,a4paper]{article}

% Move title toward top of page
\title{\vspace{-5em}Reference works: encyclopedias and dictionaries} 

% Remove date
\date{\vspace{-5em}} 

\begin{document}

\maketitle
Lorem.

\end{document}

This combines the technique from @jensph's answer with date removal.

You could also throw in \usepackage{a4wide} for thin margins when working with A4 documents.

You must log in to answer this question.

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