0

Question

How do I get the indicated page style mypage to apply to the nomenclature section of the following memoir MWE source? That is, odd-numbered pages of the nomenclature ("Index of Notation") after the first one will have "Index of Notation" at the left of the header, and even-numbered pages (such as page 4 here) will have "Index of Notation" at the right of the header?

\documentclass{memoir}

\begin{filecontents}{nomencl.cfg}
\renewcommand{\nomname}{\sffamily\bfseries Index of Notation}
\renewcommand{\nompreamble}{\noindent Within each topical group below, items are listed in the order they appear in the body of the text.{\ }\vspace{\smallskipamount}}

\renewcommand*{\pagedeclaration}[1]{\unskip, \hyperpage{#1}}

\setlength{\nomitemsep}{-\parsep}

\newlength{\nomgroupstartsep}
\setlength{\nomgroupstartsep}{\medskipamount+\smallskipamount}% was 16pt

\newcommand{\nomenclheader}[1]{%
    \item[\hspace*{-\itemindent}\normalfont\sffamily\bfseries#1]%
    {\ }\medskip}%\par}

\renewcommand\nomgroup[1]{%
  \itemsep \nomgroupstartsep%
  \IfStrEqCase{#1}{%
   {E}{\nomenclheader{Set theory}}%
   {G}{\nomenclheader{Special sets}}%
  }%
  \itemsep\nomitemsep% Restore spacing
}
\newcommand{\nom}[4][]{%
  \IfStrEqCase{#1}{%
  {set}{\nomenclature[e#4]{#2}{#3}}%
  {specialset}{\nomenclature[g#4]{#2}{#3}}%
  }%
  [{\nomenclature[z#4]{#2}{#3}}]%
}
\endinput
\end{filecontents}

\usepackage{amsfonts,amssymb}

% PAGE STYLE:
\makeatletter
\nouppercaseheads
\makepagestyle{mypage} 
\makeheadrule{mypage}{\textwidth}{\normalrulethickness}
\makeevenhead{mypage}{\bfseries\sffamily\thepage}{}{\bfseries\sffamily\leftmark}
\makeoddhead{mypage}{\bfseries\sffamily\rightmark}{}{\bfseries\sffamily\thepage} 
\addtopsmarks{mypage}{}{%
  % insert "Chapter\space" & "Section\space" if desired as 4th argument:
  \createmark{chapter}{left}{shownumber}{}{\enspace} 
  \createmark{section}{right}{shownumber}{}{\enspace}
}
\makepsmarks{mypage}{%
  \createmark{chapter}{both}{shownumber}{}{\enspace} % use both not left
  \createmark{section}{right}{shownumber}{}{\enspace}
  \createplainmark{toc}{both}{\contentsname}
    \createplainmark{shorttableofconents}{both}{\shorttocname}
      \createplainmark{longtableofcontents}{both}{\longtocname}
  \createplainmark{lof}{both}{\listfigurename}
  \createplainmark{lot}{both}{\listtablename}
  \createplainmark{bib}{both}{\bibname}
  \createplainmark{index}{both}{\indexname}
  \createplainmark{glossary}{both}{\glossaryname}
  % My attempts for correct headers:
  \createplainmark{nomencl}{both}{\nomname}
  \createplainmark{nomenclature}{both}{\nomname}
}
% Set pagstyle
\pagestyle{mypage}

%% CHAPTER STYLE:
\makeatletter
%
\makechapterstyle{mychapter}{%
\renewcommand{\chapnamefont}{\sffamily\bfseries}
\renewcommand{\chapnumfont}{\fontsize{58}{64}\selectfont\sffamily\bfseries}
\renewcommand{\chaptitlefont}{\Huge\sffamily\bfseries}
%
\settoheight{\midchapskip}{\chapnumfont 1}
\setlength{\midchapskip}{0pt}
\setlength{\afterchapskip}{48pt}
%
\renewcommand{\printchaptername}{%
\chapnamefont\centering\MakeUppercase{\@chapapp}\par}
%
\renewcommand*{\printchapternum}{%
\vskip -8pt\centering \chapnumfont\thechapter} % or omit the vskip?
%
\renewcommand{\afterchapternum}{%
\par\nobreak\vskip \midchapskip%
\centering\rule{0.825\textwidth}{\normalrulethickness}%
\newline}
\renewcommand{\printchaptertitle}[1]{\centering\chaptitlefont ##1}
}
%
\makeatother
% Set chapter style:
\chapterstyle{mychapter}

% NOMENCLATURE:
\usepackage{calc}
\usepackage{xstring}
\usepackage[refpage,norefeq,intoc,english,cfg]{nomencl}
\makenomenclature

%% CROSS-REFERENCING:
\usepackage[colorlinks,linkcolor=blue]{hyperref}

\begin{document}

\mainmatter

\chapter{Sets}   
\section{Set notation}

Notation for sets \dots
\nom[set]{$x \in X$}{$x$ is an element of set $X$}{0203}
\nom[set]{$x \notin X$}{$x$ is not an element of $X$}{0204}
\nom[set]{$X = Y$}{sets $X$ and $Y$ have the same elements}{0207}
\nom[set]{$X \neq Y$}{sets $X$ and $Y$ are not equal}{0208}
\nom[set]{$\{a, b, c, \dots, s\}$}{explicitly given set}{0208}
\nom[set]{$\{x \,:\, P(x)\}$}{set of objects having a given property}{0209}
\nom[set]{$\{x \in A \,:\, P(x)\}$}{set of objects in a set having a property}{0210}
\nom[set]{$\{x \mid P(x)\}$}{variant set-builder notation}{0212}
\nom[set]{$\{x\}$}{single-element set}{0214}
\nom[specialset]{$\mathbf{N}$}{set of all natural numbers}{0217}
\nom[specialset]{$\mathbf{Z}$}{set of all integers}{0220}
\nom[specialset]{$\mathbf{Q}$}{set of all rational numbers}{0222}
\nom[specialset]{$\mathbf{R}$}{set of all real numbers}{0224}
\nom[specialset]{$\mathbf{C}$}{set of all complex numbers}{0227}
\nom[specialset]{$\mathbf{I}$}{closed unit interval $[0, 1]$}{0231}
\nom[specialset]{$\mathbf{J}$}{centered interval $[-1, 1]$}{0232}
\nom[specialset]{$\mathbf{N}^{*}$}{set of all \emph{positive} natural numbers}{0218}
\nom[specialset]{$\mathbf{R}^{*}$}{set of all nonzero real numbers}{0225}
\nom[set]{$Y \subset X$}{$Y$ is a subset of $X$}{0217}
\nom[set]{$X \supset Y$}{$Y$ is a subset of $X$}{0218}
\nom[set]{$Y \subsetneq X$}{$Y$ is a proper subset of $X$}{0219}
\nom[set]{$\mathcal{P}(X)$}{collection of all subsets}{0223}
\nom[set]{$A \cup B$}{union of two sets}{0221}
\nom[set]{$A \cap B$}{intersection of two sets}{0222}
\nom[set]{$(x, y)$}{ordered pair}{0225}
\nom[set]{$X \times Y$}{product of two sets}{0227}
\nom[set]{$(x, y, z)$}{ordered triple}{0229}
\nom[set]{$\emptyset$}{empty set}{0215}
\nom[specialset]{$\mathbf{R}^{+}$}{set of nonnegative real numbers}{0226}
\nom[set]{$f : X \rightarrow Y$}{map from $X$ to $Y$}{0303}
\nom[set]{$f(x)$}{value of function $f$ at $x$}{0305}
\nom[set]{$i_{X}$}{identity map of $X$}{0306}

\backmatter

\hypertarget{notation}{\printnomenclature[3.5cm]{}}
\cleardoublepage

\end{document}

Wrong header element on 2nd page of nomenclature

What I tried to do, by analogy with the way this would be handled for toc, bib, index, and glossary is to include in the \makepsmarks{mypage} block the lines

  \createplainmark{nomencl}{both}{\nomname}
  \createplainmark{nomenclature}{both}{\nomname}

But that seems to have no effect. Instead, I get "1 Sets", a reference to the chapter in which the \nom entries appear`, on the header of page 4, which is the 2nd page of the Index of Notation.

Your Answer

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

Browse other questions tagged or ask your own question.