# How do I prevent duplicate Glossaries section title when redefining page styles in Memoir class?

The solution provided to question How to modify Memoir class' headers/footers without redefining everything involves a) redefining the Memoir headings and b) redefining page styles. The latter seems to cause a new problem to appear: I now have two "Glossary" sectional titles when using Glossaries. Here is the MWE:

\documentclass{memoir}

\usepackage{lipsum}

%-----------------------------

{\slshape\leftmark}{}{\thepage}

\copypagestyle{plainnotice}{plain}
\makeevenfoot{plainnotice}{}{}{\thepage}
\makeoddfoot{plainnotice}{}{}{\thepage}
\aliaspagestyle{chapter}{plainnotice}

%-----------------------------

\usepackage{glossaries}
\makeglossaries
\newglossaryentry{test}{%
name={test},
description={A test}}

\begin{document}

% Backmatter
\backmatter

\printglossaries

\end{document}


Commenting-out the code between the dotted lines as well as \pagestyle{headingsnobook} makes the duplicate title disappear, but I need this code to eventually add Book XX and Part XX to mainmatter headings, but not to backmatter headings, such as in glossaries or indexes. Can the "headingsnobook" page style be defined so as to avoid this?

-
Just for the record, this problem is now fixed (as from glossaries version v3.13a, which renamed \glossarymark to \glsglossarymark to avoid conflict with memoir). – Nicola Talbot Apr 10 '14 at 9:54

The observed duplicate title is due to an incompatibility between memoir and glossaries described in \pagestyle{ruled} adds superfluous text in glossary. In that question, the solution was to issue the \pagestyle command before loading glossaries. This, however, doesn't help in the question at hand because you apparently need to switch from another page style to \pagestyle{headingsnobook} in the document body (at the start of the backmatter). Solution: After doing the switch, issue some compatibility code copied from glossaries.sty.

\documentclass{memoir}

\usepackage{lipsum}

%-----------------------------

{\slshape\leftmark}{}{\thepage}

\copypagestyle{plainnotice}{plain}
\makeevenfoot{plainnotice}{}{}{\thepage}
\makeoddfoot{plainnotice}{}{}{\thepage}
\aliaspagestyle{chapter}{plainnotice}

%-----------------------------

\usepackage{glossaries}
\makeglossaries
\newglossaryentry{test}{%
name={test},
description={A test}}

\begin{document}

\chapter{foo}

Some stuff unrelated to the glossary.

% Backmatter
\backmatter