1

In order to save pages (there is an upper page limit for our books) i want (1) to start a new chapter immediately after the end of the previous chapter (namely in the same page) and furthermore (2) to print the chapter number and the chapter title in the same line. After searching and with the kind support of the people here, I found that the first one of these settings is implemented by the code

\makeatletter
\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{}{}{}
\makeatother

while the second one is implemented by the next code (that also defines some other stuff)

\chapterstyle{default}
\renewcommand{\chaptitlefont}{\normalfont\Large\bfseries}
\renewcommand*{\chapnamefont}{\chaptitlefont}
\renewcommand*{\chapnumfont}{\chaptitlefont}
\renewcommand{\printchaptername}{\chaptitlefont\chaptername}
\renewcommand{\printchapternum}{\thechapter:}
\renewcommand{\afterchapternum}{\hspace{1em}}

In the last step I added (according to the instructions i found) the appendices (which, in fact, are chapters) by using the code

\input{AppendixAVol1}
\begingroup\let\clearpage\relax\input{AppendixBVol1}\endgroup
\begingroup\let\clearpage\relax\input{AppendixCVol1}\endgroup
\begingroup\let\clearpage\relax\input{AppendixDVol1}\endgroup
\begingroup\let\clearpage\relax\input{AppendixEVol1}\endgroup
\begingroup\let\clearpage\relax\input{AppendixGVol1}\endgroup

The result is excellent and according to our specifications. The headers for the odd and the even pages are defined as (I use the memoir class)

\makeevenhead{mystyle}{{\large{\color{evenPageColor}{\textbf{\thepage}}}}$\ \ \ \ $     \color{evenTextColor}{\large\textsection$\,$\lastrightmark}}{}{}
\makeoddhead{mystyle}{}{}{\large \color{oddTextColor}{\leftmark} $\ \ \ \ $ {\large{\textbf {\color{oddPageColor}{\thepage}}}}}

(where mystyle is a user-defined style) and they are printed correctly. However in the pages where a new chapter starts, at the end of the previous chapter (in the same page, as I have described) and ONLY to those pages, the header is not printed at all, as in the case when i define \pagestyle{empty}. I suppose that this is due to the fact that in the memoir class the first page of each chapter does not have a header at all and I suppose that this is the case here too, even though this first page is also the last page of the previous chapters. I found instructions that enable the printing of the header in the first page of the chapter but they did not worked. Any suggestion to solve this issue?

1 Answer 1

2

Unnecessarily complicated: just use the article option of memoir:

MWE

\documentclass[article,a5paper]{memoir}
\usepackage{lipsum}
\makepagestyle{foo}
\makeheadrule{foo}{\textwidth}{\normalrulethickness}
\makeoddhead{foo}{A}{B}{C}
\makeevenhead{foo}{D}{E}{F}
\makeoddfoot{foo}{G}{H}{I}
\makeevenfoot{foo}{J}{K}{L}
\pagestyle{foo}
\begin{document}
\chapter{foo} \lipsum[1-3]
\chapter{foo} \lipsum[1-3]
\chapter{foo} \lipsum[1-3]
\chapter{foo} \lipsum[1-3]
\end{document}

Note that a header just over a chapter title have little sense. At least in first page consider change the style to omit the header (e.g. \chapter{foo}\thispagestyle{plain}).

You must log in to answer this question.

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