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.

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?

share|improve this question

4 Answers 4

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.

share|improve this answer
1  
I like the "set screw" label! :-) –  Mico Sep 26 '11 at 22:41
    
Why do you use em to set heights? Wouldn't ex make more sense? –  Laura Oct 16 '12 at 17:38

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}
share|improve this answer
4  
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 '12 at 13:23
    
@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). –  Gonzalo Medina Apr 1 '13 at 14:13
    
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 '13 at 14:57

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}
share|improve this answer

A simple alternative is to use \vspace{}:

\documentclass[a4paper,11pt]{article}

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

\begin{document}
\maketitle

\end{document}
share|improve this answer
    
Welcome to TeX.SX! –  Adam Liter Mar 17 at 0:16
    
@Mico you're right. I'll update the response. –  jensph Mar 17 at 16:13

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.