# memoir: book + articles

I have a book (memoir class) and few articles (memoir[article] class)

I want to put articles in the end of the book, so that they would appear as they were processed originally)

I would like to have a single tex document (since I have ctross-references between book and articles, and between articles)

I understand, that some editing will be required

Thank you very much in advance

%%%% Minimal example of standalone article

\documentclass[12pt,oneside,openany, article]{memoir}

\usepackage{blindtext}

\title{Some creative thinking about miscellaneous stupid things}

\author{Victor Ivrii}

\begin{document}

\maketitle

\chapter{Introduction}

\blindtext[5]

\bibliographystyle{amsplain}

\begin{thebibliography}{9}

\bibitem[AM]{crap}

John Doe \emph{Some crap}

\end{thebibliography}

\end{document}

%%%Embedding it into a book

\documentclass[12pt,oneside,openany]{memoir}

\usepackage{blindtext}

\begin{document}

\title{My Book}

\author{Victor}

\chapter{Some crap}

\blindtext

\renewcommand{\thesection}{\arabic{section}}

\title{Some creative thinking about miscellaneous stupid things}

\author{Victor}

\maketitle

\section{Introduction}

\blindtext[5]

\bibliographystyle{amsplain}

\begin{thebibliography}{9}

\bibitem[AM]{crap}

John Doe \emph{Some crap}

\end{thebibliography}

\end{document}

%%%%%%%%%%%


We see that

1. Running heads are displaying in the article CHAPTER (actually previous chapter of the book) while it should be SECTION inside the article

2. Bibliography in the embedded article starts from the new page (unlike in the article) and the word "Bibliography" is printed in larger fonts

PS Sure, book has its own bibliography which should look like bibliography in the book

\renewcommand{\bibsection}{\section*{\bibname}\prebibhook}

The result was that running header over Bibliography was the one from the previous section. I changed it to

\renewcommand{\bibsection}{\section{\bibname}\prebibhook}

which fixed the running header but added unwanted "section" number to Bibliography, which I fixed by preceding it by

\setcounter{secnumdepth}{0}

• Welcome, your question is a bit too broad. What kind of answer are you expecting? Should just work? Where is the problem right now? – Johannes_B Feb 25 '18 at 10:29
• Crosspost on texhax. – Johannes_B Feb 26 '18 at 7:51
• This should not have that hard to fix. But please provide a minimal example so we have something to work with. – daleif Feb 26 '18 at 9:46
• Please explain what you mean by "do a similar thing with the TOC"? The bibliography and the TOC are different constructions, and this does not share structure. – daleif Mar 2 '18 at 10:14
• Please ask a new question instead of completely change the existing question. – Johannes_B Mar 2 '18 at 10:28

Something like this might be a starting point.

\documentclass[12pt,oneside,openany]{memoir}

\usepackage{kantlipsum}

% need reactivation for \nouppercaseheads to have an effect

\setsecnumdepth{subsubsection}
\maxsecnumdepth{subsubsection}

% adjusted from memoir sources (look for \ifartopt)
\newcommand\InternalArticleOption{
% assumes oneside, use "both" instead of "right" in twosided case
\createmark{section}{right}{shownumber}{}{. \ }
\createmark{subsection}{right}{shownumber}{}{. \ }
\createmark{subsubsection}{right}{shownumber}{}{. \ }
}
% reactivation
\renewcommand{\maketitlehookb}{%
\vskip -1.5\topsep\vskip -1.5\partopsep}
\renewcommand{\maketitlehookc}{%
\vskip -1.5\topsep\vskip -1.5\partopsep}
% adjust bibliography (it is using \chapter* by deafault, under
% articl option, \chapter* behaves like \section*, we just foce it
% to use \section*)
\renewcommand{\bibsection}{\section*{\bibname}\prebibhook}
% remove chapter from section number
\renewcommand{\thesection}{\arabic{section}}
}

\begin{document}

\title{My Book}

\author{Victor}

\chapter{Some crap}

\kant

\InternalArticleOption

\title{Some creative thinking about miscellaneous stupid things}

\author{Victor}

\maketitle

\section{Introduction}

\kant[5]

\subsection{Test}

\kant[7]

\bibliographystyle{amsplain}

\begin{thebibliography}{9}

\bibitem[AM]{crap}

John Doe \emph{Some crap}

\end{thebibliography}

\end{document}


Addition: There is a bug in memoir in its handling of \maketitle, it does not reset the thanks data, which may result in accumulative thanks build up. Also, the counter value used by \thanks continues from where it left of. Easy fix:

\makeatletter
\renewcommand\maketitlehooka{
\setcounter{footnote}{0}
\global\let\@thanks\@empty
}
\makeatother


in the preamble. memoir probably never had repeated use of \maketitle in mind.

Normally when I make docs that lists articles (often seen in PhD theses), I tend to write my own interface that does not use \maketitle. Then the student can also include information like where this was published, abstract etc. From that we then build a suitable title page for the article (and add whatever we like to the general ToC).

EDIT: memoir not resitting thanks is not really a bug, it is even mentioned in the manual, with the suggestion of using

\emptythanks
\maketitle


if you need to use \maketitle many times, since \emptythanks is just \global\let\@thanks\@empty, the suggestion from above reduces to

\renewcommand\maketitlehooka{
\emptythanks
}


As multi using \maketitle is not that frequent, I'll just leave it at that, since \emptythanks is already mentioned in the manual (aka I do not see this a a bug, as I first wrote and as such will not fix it at present).

• One more problem: accumulation of thanks: %%% Example\documentclass[12pt]{memoir} \begin{document} \title{About rhinos} \thanks{To Rhinos} \maketitle Rhinos are cool! \title{About raccoons} \thanks{To Raccoonss} \maketitle Raccoons are cool! \end{document} – Victor Feb 26 '18 at 12:04
• @Victor suggestion added, also added this to my todo list for memoir – daleif Feb 26 '18 at 13:34