13

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

4
  • I bet you are faster building the title yourself. It is very easy.
    – Johannes_B
    Aug 28, 2015 at 18:27
  • @Johannes_B I didn't even think of that! This is what happens when you've been set in your ways for too long.
    – Sverre
    Aug 28, 2015 at 18:29
  • One thing to keep in mind as well: center introduces some extra vertical space.
    – Johannes_B
    Aug 28, 2015 at 18:33
  • @Johannes_B Yes indeed, but titling didn't accept \centering (or at least I wasn't able to figure out how to do it).
    – Sverre
    Aug 28, 2015 at 18:50

1 Answer 1

3

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}
5
  • Althought it technically didn't answer my question, it's surely a better approach in this case to just create the title style yourself than to modify it through titling.
    – Sverre
    Aug 31, 2015 at 15:41
  • 1
    @Sverre It is always a better idea to do that, when it is more than centering a bit. ;-)
    – Johannes_B
    Aug 31, 2015 at 15:55
  • Then I guess you technically did answer my question :) I think I left the "with titling" implied. Good thing I didn't make it explicit, then :P
    – Sverre
    Aug 31, 2015 at 15:57
  • The problem at hand isn't with titling or the title, it is the section heading which eads extra vertical space.
    – Johannes_B
    Aug 31, 2015 at 16:06
  • 3
    I am currently not very happy with the answer myself. There is no explanation, nothing. Just code with an ugly output.
    – Johannes_B
    Aug 31, 2015 at 16:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .