0

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?

  • 1
    That code won't make a page, title or otherwise. Please can you make it compilable? By default, articles do not have title pages at all. Are you using titlepage or do you just have a title? I guess you want the title to be higher on the page? Have you looked at the titling package? – cfr Feb 23 '18 at 4:42
  • @cfr Sorry I forgot writing \maketitle – Jun Jang Feb 23 '18 at 4:44
  • @JunJang... Please always test your examples to be sure they are working examples (you miss begin and end document) – koleygr Feb 23 '18 at 4:49
  • And you need a document environment. So you are not using a title page but you want less vertical space before the title, is that it? And you're using the standard layout? Are you happy with the default margins? Because, if not, I'd start by loading geometry and setting the margins. Then adjust the title relative to those if you still want to move it. – cfr Feb 23 '18 at 4:49
2

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.

|improve this answer|||||
1

I don't think that geometry is the right tool for this, because you want to move up an element of the first page, rather than changing the page layout.

\documentclass{article}

\usepackage{etoolbox}
\makeatletter
\patchcmd{\@maketitle}{\vskip 2em}{\vspace*{-3cm}}{}{}
\makeatother

\begin{document}

\title{My Title}
\author{My Name}
\date{Today}

\maketitle

\end{document}

Adjust -3cm to a value that suits you.

enter image description here

|improve this answer|||||

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.