Page Layout ⇒ Vertical Space before Title
Vertical Space before Title
Hello,
I am using the article document class. When I use \maketitle an extra vertical space is added before the title. I would like to remove it (have the same vertical space as in other pages). Is there a good way to do this, in the preamble? (not \vspace{-3ex} before the title in the document body)
I am using the article document class. When I use \maketitle an extra vertical space is added before the title. I would like to remove it (have the same vertical space as in other pages). Is there a good way to do this, in the preamble? (not \vspace{-3ex} before the title in the document body)
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and many kinds of documents
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Vertical Space before Title
The easiest method I can think of is to use the titling package.
Thorsten
Code: Select all
\documentclass[11pt,english]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{geometry}
\usepackage{titling}
\usepackage{blindtext}
\setlength{\droptitle}{-4em} % Eliminate the default vertical space
\addtolength{\droptitle}{-4pt} % Only a guess. Use this for adjustment
\title{The Title}
\author{The Author}
\begin{document}
\maketitle
\blinddocument
\end{document}
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Vertical Space before Title
It's working. Thanks!
btw. How do you know that -4em is the default length? do you have a link to some source?
I looked at the package manual but didn't see that definition.
Isn't there a 'defaultskip' parameter or something?
btw. How do you know that -4em is the default length? do you have a link to some source?
I looked at the package manual but didn't see that definition.
Isn't there a 'defaultskip' parameter or something?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Vertical Space before Title
Actually the default vertical space before the title is 2em. But it is not enough to eliminate only this amount of space. So I doubled it. The added length value of -4pt is to compensate the (rubber) length \partopsep of the center environment that is used to type set the title. Internally this environment is a list and \partopsep is inserted before and after.
The definition of the \maketitle command can be found by looking into the class file itself, that is to say »article.cls« in this case. If you want to find out its location in the TeX installation tree, check out on the command line.
But feeding a search engine with the complete class file name (including suffix) will also do. But the more important thing is the helper macro \@maketitle. It directly determines the appearance of the title.
The definition of the \maketitle command can be found by looking into the class file itself, that is to say »article.cls« in this case. If you want to find out its location in the TeX installation tree, check out on the command line.
Code: Select all
kpsewhich article.cls
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10