2

I am writing a book with amsbook document class. I put a \title, an \author an\email and a \date and then after the \begin{document} I do a \maketitle. The result is ugly as the mail is not even centered ... But this personal taste set apart, the table of contents and the page numbering rea fine, pages headers as well. But this does not suit me as I want to include an eps in my title page. I came accross the custom solution (validated answer as of now from question How can I design a book cover?) that I used :

\documentclass[10pt]{amsbook}

\begin{document}

\clearpage
%% temporary titles
% command to provide stretchy vertical space in proportion
\newcommand\nbvspace[1][3]{\vspace*{\stretch{#1}}}
% allow some slack to avoid under/overfull boxes
\newcommand\nbstretchyspace{\spaceskip0.5em plus 0.25em minus 0.25em}
% To improve spacing on titlepages
\newcommand{\nbtitlestretch}{\spaceskip0.6em}
\pagestyle{empty}
\begin{center}
\bfseries
\nbvspace[1]
{\nbtitlestretch
First line of blah \\second line of blah}

\nbvspace[1]
\LARGE
The title
\nbvspace[1]
\bigskip
\bigskip
\bigskip
\bigskip


\nbvspace[2]

\begin{center}
\includegraphics[scale=1]{./path/to/the/figure.eps}
\end{center}

\nbvspace[4]
\normalsize\normalfont
First version : some date \\
This version : current date


\nbvspace[3]
\normalsize

{\sc First name Last Name}\\
\href{mailto:firstname.lastname@somemail.com}{\tt firstname.lastname@somemail.com}
\nbvspace[1]
\end{center}

%\frontmatter
%
%\pagenumbering{roman} % Start roman numbering
%
\tableofcontents
\setcounter{tocdepth}{3} % 2 pour les subsections
%
%
%\mainmatter
%\pagenumbering{arabic} % Switch to normal numbers

\part{...}

\chapter{...}

\section{...}

Alas this keeps the numbering of pages in the table of contents correct, but all pages numbering disappeared, as well as all headers in all pages ...

I would like to make my headers reappear, as well as the number in the pages as they were before, plus having roman numbers for the table of contents and arabic for all the rest. As show the commented lines in the above code, I tried various things without success.

0

The answer you linked completely bypasses \maketitle, i.e., the normal title page mechanism of amsbook. You can also use a more hybrid approach where you use the default elements of \maketitle and add some of your own. This approach preserves normal processing of headers, page numbers etc., or at least I think it does (you were not very specific on how the headers and page numbers should look).

For this approach the internal amsbook construct \g@addto@macro\addresses can be used, which (internally) adds things to the \addresses macro (unsurprisingly). \addresses is typeset by \maketitle. There are several redefinitions in effect for this macro, such as disabling line endings but also others, set by another internal macro \@setaddresses. Note that these macros have an @ symbol in the name, which informally means that the macros are internal. This also means that you need to use \makeatletter and \makeatother when you want to use of redefine the macros in your main document. The code below disables \@setaddresses and performs centering by redefining it to just \centering\addresses.

In the example code below there are four elements added to the title page: an e-mail address, a subtitle, date information, and an image. Each of these elements has an associated macro with two arguments, first an optional line spacing argument and then the contents (in case of the image there is a third argument for the scale). If the optional argument is not given then a default of 1cm vertical space is used.

The roman and arabic numbers are set using \pagenumbering as in the original code.

Note that the titlepage package option for amsbook is used to put the title on a separate page.

MWE:

\documentclass[10pt,titlepage]{amsbook}
\usepackage{graphicx}
\usepackage{lipsum}
\title{The title}
\author{First Name Last Name}
\makeatletter
\newcommand{\myemail}[2][1cm]{\g@addto@macro\addresses{\texttt{#2}\\[#1]}}
\newcommand{\subtitlelines}[2][1cm]{\g@addto@macro\addresses{#2\\[#1]}}
\newcommand{\datelines}[2][1cm]{\g@addto@macro\addresses{#2\\[#1]}}
\newcommand{\coverimage}[3][1cm]{\g@addto@macro\addresses{\includegraphics[scale=#2]{#3}\\[#1]}}
\def\@setaddresses{\centering\addresses}
\makeatother
\myemail[0.5cm]{firstname.lastname@somemail.com}
\subtitlelines{First line of blah\\Second line of blah}
\coverimage{0.6}{example-image}
\datelines{First version: some date\\This version: current date}

\begin{document}
\maketitle
\pagenumbering{roman}
\tableofcontents
\pagenumbering{arabic}
\part{First part}
\chapter{First chapter}
\section{First section}
\lipsum[1-10]
\end{document}

Result:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.