18

How can I vertically center the text on a title page ?


My MWE :

\documentclass[]{article}
\title{Project Title}
\date{2016-31-01}
\author{Author Name}
\begin{document}
\pagenumbering{gobble}
\maketitle
\end{document}
Johannes_B
  • 24,235
  • 10
  • 93
  • 248
stark
  • 357

2 Answers2

20

You can do that with the titling package:

\documentclass[]{article}
\title{Project Title}
\date{2016-31-01}
\author{Author Name}
\usepackage[showframe]{geometry}

\usepackage{titling}
\renewcommand\maketitlehooka{\null\mbox{}\vfill}
\renewcommand\maketitlehookd{\vfill\null}

\begin{document}

\begin{titlingpage}
\maketitle
\end{titlingpage}

\end{document} 

enter image description here

Bernard
  • 271,350
  • Thanks, this worked just fine, although why was the graphicx package used ? – stark Jan 31 '16 at 22:59
  • Oh! For nothing. I started with an existing preamble, and didn't notice I had forgotten to remove it. There's also a spurious amsymb. It's removed from the code now. – Bernard Jan 31 '16 at 23:02
  • So then I wouldn't need these lines as well right ? \includegraphics[width=4cm]{sendak.jpg} \vfill PUBLISHING HOUSE} – stark Jan 31 '16 at 23:04
  • Good gracious! One more forgotten.. You can safely remove it (unless you want some funny effect…) – Bernard Jan 31 '16 at 23:09
  • I don't understand the mess in the code I posted. I guessed it's a problem with my clipboard manager. Please see the corrected code, which is very short. – Bernard Jan 31 '16 at 23:14
  • Sure, this code is much simpler to comprehend. Thanks. – stark Jan 31 '16 at 23:15
6

I know some time has passed, but there is a simpler solution. You just need to use "titlepage" in the documentclass:

\documentclass[titlepage]{article}

\begin{document}
\begin{titlepage}
\title{test} 
\author{testauthor}
\maketitle
\end{titlepage}
\end{document}

Roland
  • 6,655
helper
  • 61