Document Classesmemoir | Re-order Title and Author

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
niles
Posts: 92
Joined: Mon Dec 01, 2008 9:35 pm

memoir | Re-order Title and Author

Post by niles »

Hi

Please see this MWE:

Code: Select all

\documentclass[a4paper,11pt]{memoir}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{amsmath, amsthm, amssymb}

\begin{document}
\begin{titlingpage}

\author{Author name}
\date{November, 2018}
\title{Title}

\preauthor{\begin{flushleft}}
\postauthor{\end{flushleft}}
\pretitle{\begin{flushleft}} \posttitle{\end{flushleft}}
\predate{\begin{flushleft}asd, }\postdate{\end{flushleft}}
\maketitle

\end{titlingpage}
\end{document}
I wish that the author name comes first, then the title and finally the date. However, I can't get this combination -- the title always comes before the author name. What can I do?

Cheers,
Niles.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

memoir | Re-order Title and Author

Post by localghost »

Within the titlingpage environment you can create an arbitrary title without the \maketitle command. For some inspiration take a look at the document »Some Examples of Title Pages«. If you want to keep the simple layout of the \maketitle command, dig into the code of the memoir class and redefine this command according to your ideas in the preamble of your document. The important point is to redefine the helper macro \@maketitle as shown below.

Code: Select all

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

Thorsten
Post Reply