0

I want to vertically align document title and names in title page. My current LaTeX looks like this:

\documentclass[a4paper]{article}

\title{ ... }} \author{ ... } \date{{ ... }}

\begin{document}

\begin{titlepage} \maketitle \end{titlepage}

\end{document}

But this shows the content somewhat in top half part of the doc. I want to center it vertically. This post asks to use \vplace. But I am not able to figure out how to use \vplace in title page.

I tried

\begin{vplace}[1]
\begin{titlepage}
\maketitle
\end{titlepage}
\end{vplace}

and also

\begin{vplace}[1]
\title{ ... }}
\author{ ... }
\date{{ ... }}
\end{vplace}

But it is giving error like Environment vplace undefined. It seems that it requires memoir class. But overleaf does not recognize memoir document class. How can I achieve same in document class?

2 Answers2

1

The titling package has tools to customize the maketitle command. Here is an example:

\documentclass[a4paper]{article}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.3pt}
\usepackage{titling}
\setlength{\droptitle}{-9.5ex}
\renewcommand{\maketitlehooka}{\vfill\bfseries}
\renewcommand{\maketitlehookb}{\normalfont}
\renewcommand{\maketitlehookd}{\vfill\clearpage}
\title{The Quangle-Wangle’s Hat}
\author{Edward Lear}
\date{(1876)}

\begin{document}

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

\end{document}

enter image description here

Bernard
  • 271,350
0

Personally I would for TiKz since there is better control over alignment(my perspective) and calc code is easier to comprehend for me -- for the TiKz option please see the edit

Vertically Center title page : Article

\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}

EDIT ---title page with tikz

Formatting a title page, using Tikz

enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document} \begin{titlepage}

\begin{tikzpicture}[remember picture, overlay] \draw[line width = 2pt] ($(current page.north west) + (1in,-1in)$) rectangle ($(current page.south east) + (-1in,1in)$); \draw[line width = 1pt, blue] ($(current page.center) + (-1in,0in)$) -- ($(current page.center) + (1in,0in)$)nodepos=0.5,above{% \textbf{\LARGE Escola Secundária Domingos Sequeira}\[4.5cm] }; \end{tikzpicture}

\vfill

% Bottom of the page \centering{\bf \large \today}

\end{titlepage}

\end{document}

js bibra
  • 21,280
  • first one worked. But can you please explain those commands a bit? \usepackage{titling} \renewcommand\maketitlehooka{\null\mbox{}\vfill} \renewcommand\maketitlehookd{\vfill\null} – Mahesha999 Sep 11 '20 at 11:35
  • The format for typesetting the \maketitle command is fixed in the standard LATEX classes. The titling package provides some controls for modifying the appearance of the titling information presented via \maketitle – js bibra Sep 11 '20 at 14:16
  • hook commands are provided so that additional elements may be added to \maketitle – js bibra Sep 11 '20 at 14:18
  • http://ctan.imsc.res.in/macros/latex/contrib/titling/titling.pdf -- refer page 4 of the documentation – js bibra Sep 11 '20 at 14:22