[Tex/LaTex] Position of title

titles

I have this chunk of code for the title page:

\documentclass{article}
\usepackage[utf8]{inputenc}
\title{My Title}
\author{My Name}
\date{Today}
\maketitle

I want to position My Title more above on the page. How do I possible achieve this?

Best Answer

Let's start by seeing where the title is right now. Completing the example and adding geometry with pass, showframe, we can see the defaults:

default title on page

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[pass,showframe]{geometry}
\title{My Title}
\author{My Name}
\date{Today}
\begin{document}
\maketitle
\end{document}

If you want to fiddle with the margins, do this before adjusting the title. For example, if we drop the pass, we'll get geometry's defaults:

<code>geometry</code>'s defaults

This itself has the effect of reducing the vertical space before the title, because the new top margin is smaller than LaTeX's default.

But you might, of course, want a still smaller margin. If so, adjust that before considering the title.

Adding

\geometry{top=20mm}

we get

title with top margin of 20mm

If, when you've sorted the page layout, you'd still like to adjust the title position, consider loading the titling package.

The default uses a center environment for the title, so let's try just using \centering instead:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry}
\usepackage{titling}
\geometry{top=20mm}
\pretitle{\begingroup\centering\LARGE}
\posttitle{\par\endgroup}
\title{My Title}
\author{My Name}
\date{Today}
\begin{document}
\maketitle
\end{document}

title going up

Obviously, the document is now quite unbalanced: if you change top, you will want to change the other margins, too. Tweak as required.