[Tex/LaTex] Modifying \maketitle with the titling package

line-spacingtitlestitling

Modyfying the \maketitle command with the titling package is challenging, as the documentation has very little explanation and examples to let users like me understand what to do.

This gets even trickier when we have to follow style sheets telling us to have line spacing above and below parts of the title with so-and-so many points.

So this is what I now have to implement:

  1. The title in 18bp, linespacing 18bp. Centered.

Ok, so this I can do, I think:

\usepackage{titling}
    \pretitle{\begin{center}\fontsize{18bp}{18bp}\selectfont}
    \posttitle{\par\end{center}}
  1. One 18bp blank line.

Hm? Is that taken care of with the \fontsize{18bp}{*18bp*}\selectfont} above? I'm not sure.

  1. The author name in 14bp, linespacing 14bp. Centered.

Ok, as above:

\preauthor{\begin{center}\fontsize{14bp}{14bp}\selectfont}
\postauthor{\par\end{center}}
  1. Two 12bp blank lines.

Yikes! Can I do \postauthor{\par\end{center}\vspace{24bp}}?

That's it. No date. So I add this:

\predate{}
\date{}
\postdate{}

Ok, so now in theory I should be done. A MWE below. I clearly do not have two blank 12bp lines between the author name and the section heading. How can I implement these things accurately?

\documentclass{article}
\usepackage{titling}
    \pretitle{\begin{center}\fontsize{18bp}{18bp}\selectfont}
    \posttitle{\par\end{center}}
    \preauthor{\begin{center}\fontsize{14bp}{14bp}\selectfont}
    \postauthor{\par\end{center}\vspace{24bp}}
    \predate{}
    \date{}
    \postdate{}
\begin{document}
\title{This is my first article}
\author{Sverre}
\maketitle
\section{My first section}
\end{document}

enter image description here

Best Answer

Consider the following example, with black boxes as auxiliary spacers.

\documentclass{article}
\usepackage{lmodern}%get scalable font
\usepackage{showframe}
\usepackage{titling}
\pretitle{\begin{center}\fontsize{18bp}{18bp}\selectfont}
    \posttitle{\par\end{center}}
\preauthor{\begin{center}\fontsize{14bp}{14bp}\selectfont}
    \postauthor{\par\end{center}\vspace{24bp}}
\predate{}
\date{}
\postdate{}
\begin{document}
\title{Move it!}
\author{Sverre}
\maketitle
\section{Wombats like to walz}
\clearpage
\begingroup
\centering
\vspace*{2em}
\fontsize{18bp}{18bp}\selectfont 
\rule{1cm}{\baselineskip} I like to move it move it.\par\vspace{\baselineskip}
\fontsize{14bp}{14bp}\selectfont
\rule{1cm}{\baselineskip} Sverre
\par%\vspace{2\baselineskip}
\rule{.5\linewidth}{\baselineskip}%
\rule{.5\linewidth}{14bp}
\par
\rule{\linewidth}{\baselineskip}
\endgroup
\section{Ducks like the Dixie}

\rule{\linewidth}{\baselineskip}
\section{Ducks like the Dixie}
\end{document}