1

I am trying to have a solution to shift the title page of an article up automatically (without having to set it up manually). Taking a look at the solution of Shift title and author text up? :

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{titling}

\setlength{\droptitle}{-10em} % This is your set screw

\author{The Author} \title{The Title}

\begin{document} \maketitle \end{document}

Instead of manually adjusting the height as \setlength{\droptitle}{-10em} , is there a way to automatically adjust the hight with the next page's upper margin?

Bernard
  • 271,350

1 Answers1

1

All the solutions I have found seem to manually determine the vertical space to be eliminated. An "automatic" but in my opinion not so efficient way would be to redefine the \@maketitle defined by the titling package (even if in this way it becomes superfluous if it is used only for adjusting the title spacing):

  \def\@maketitle{%
    \newpage
    %\null
    %\vskip 2em%
    %      \vspace*{\droptitle}
    \maketitlehooka
    {\@bspretitle \@title \@bsposttitle}
    \maketitlehookb
    {\@bspreauthor \@author \@bspostauthor}
    \maketitlehookc
    {\@bspredate \@date \@bspostdate}
    \maketitlehookd
    \par
    \vskip 1.5em}

This can be done through etoolbox like in the next MWE:

\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage[showframe]{geometry}
\usepackage{titling}
\usepackage{lipsum}

\author{The Author} \title{The Title}

\usepackage{etoolbox} \makeatletter \patchcmd{@maketitle}{\null}{}{}{} \patchcmd{@maketitle}{\vskip 2em}{}{}{} \patchcmd{@maketitle}{\vspace*{\droptitle}}{}{}{} \makeatother

\begin{document} \maketitle \lipsum \end{document}

enter image description here

Ivan
  • 4,368