11

I want to create a handout to support a speech I have to give.

Since I am only familiar with the \documentclass{article}, I wrote the following code:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8x]{inputenc}
\PrerenderUnicode{äöüÄÖÜß}
\usepackage[ngerman]{babel}

\title{Some title}
\author{A. Uthor}
\date{2.7.2012}
\pagestyle{headings}
\begin{document}    
    \vspace*{-5pt}
    \maketitle

    \subsection*{Text \& Author}
    \begin{itemize}
        \item foobar
    \end{itemize}

\end{document}

What I want is to have the title, author, date etc. directly on the upper edge of the paper. I understand, there will be more elegant ways to solve this, anyway: This \vspace*{-5pt} generates an empty page before the actual content of my handout.

Why does it, how can I prevent it to do or (which would be best to know) what is the more elegant way?

8

article class defines the single column version of \maketitle to effectively begin with \newpage You could redefine \maketitle but simpler, for a one-off document is just locally disable \newpage

 \begin{document}    
    \vspace*{-5pt}
    {\let\newpage\relax\maketitle}
\subsection*{Text \& Author}    

does what you need

6

You have to redefine the \@maketitle macro so that it doesn't add vertical spaces (for example, not using the center environment):

\makeatletter
\def\@maketitle{%
  \newpage
  \vspace*{-\topskip}      % remove the initial space
  \begingroup\centering    % instead of \begin{center}
  \let \footnote \thanks
  \hrule height \z@        % to avoid the insertion of lineskip glue
    {\LARGE \@title \par}%
    \vskip 1.5em 
    {\large
      \lineskip .5em 
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 1em 
    {\large \@date}%
  \par\endgroup            % instead of \end{center}
  \vskip 1.5em             % <--- modify this to adjust the separation
}
\makeatother

The last \vskip command is responsible for the separation between the title and the text.

  • Thanks. I have .sty file I include to many documents. Thanks to your solution I've managed to rescue space above title in all files at once ! :) – Grzegorz Wierzowiecki Aug 28 '12 at 16:50
3

The titling package provides a simple user interface to titling information, and allows you to restyle both the \title and the \thanks, including moving their position.

The package provides a \droptitle length which determines the height of the title line relative to the default. In your case you want to move the title up, so you can supply a negative space. In the example below I've loaded the geometry package with the [showframe] option just to show the relative positioning on the page.

\documentclass[12pt,a4paper]{article}
\usepackage[showframe]{geometry}
\usepackage[utf8x]{inputenc}
\PrerenderUnicode{äöüÄÖÜß}
\usepackage[ngerman]{babel}

\usepackage{titling}
\setlength{\droptitle}{-2cm}
\title{Some title}
\author{A. Uthor}
\date{2.7.2012}
\pagestyle{headings}
\begin{document}    
    \maketitle

    \subsection*{Text \& Author}
    \begin{itemize}
        \item foobar
    \end{itemize}

\end{document}

output of code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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