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.

Consider the following two LaTeX source files:

First, manually producing a title using a new environment (eww):

\documentclass[a4paper,10pt]{article}
\parindent0cm%
\newenvironment*{mytitle}{\begin{LARGE}\bf}{\end{LARGE}\\[1.5ex]}%
\begin{document}
\begin{mytitle}This is a test document\end{mytitle}
\end{document}

Secondly, redefining \maketitle using the titling package:

\documentclass[a4paper,10pt]{article}
\parindent0cm%
\usepackage{titling}
\pretitle{\begin{LARGE}\bf}%
\posttitle{\end{LARGE}\\[1.5ex]}%
\preauthor{}%
\postauthor{}%
\predate{}%
\postdate{}%
\title{This is a test document}
\date{}
\begin{document}
\maketitle
\end{document}

Why does the second "proper" solution give substantially more vertical whitespace before the title? What can I do about it?

[ Context: I am turning a horrible "let's pretend LaTeX is a word processor" TeX template for a conference into a proper class, and I need to match the spacing. ]

share|improve this question
    
Does just deleting the empty pre and post commands have an effect? –  Seamus Jul 13 '11 at 17:06

1 Answer 1

up vote 6 down vote accepted

The titling package defines a length \droptitle which needs to be set to a negative value to move it up. Adding

\setlength{\droptitle}{-1cm}

to your second example will give you the same result.

By the way, you should use \bfseries instead of \bf (see Will two-letter font style commands (\bf , \it , …) ever be resurrected in LaTeX?) and use \vspace{1.5ex} instead of \\[1.5ex]

share|improve this answer
    
Thank you for your excellent answer. –  Peter Brett Jul 13 '11 at 17:30

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.