I want a certain layout for the heading and footer for a document I'm writing using Memoir documentclass. The problem is that the entire document follows the defined heading and footer, except the TOC.
The image below shows the desired heading for even and odd pages of the body of the document.
This image shows the current heading for the table of contents, which is not consistent with the desired layout.
The MWE code is attached below:
\documentclass[letterpaper,12pt,openany,final]{memoir}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[top=4cm,right=2.5cm,left=4cm, bottom=2.5cm]{geometry}
\usepackage{setspace}
\DisemulatePackage{setspace}
\linespread{1.1}
\usepackage[sc]{mathpazo} %Fuente
\renewcommand\familydefault{\rmdefault}
\usepackage[protrusion=true,expansion=true]{microtype} %Alineado óptico
\usepackage[activeacute,spanish] {babel}
\setlength{\footmarksep}{-1.8em}
\setlength{\footmarkwidth}{1.8em}
\setlength{\footmarksep}{0em}
%%=================%%
%%Header and footer%%
%%=================%%
\makepagestyle{TOC}
\makepsmarks{TOC}{%
\createmark{chapter}{left}{nonumber}{}{}
\createmark{section}{right}{nonumber}{}{}
}
\makeevenhead{TOC}{}{}{\bfseries \leftmark}
\makeoddhead{TOC}{}{}{\bfseries \rightmark}
\makeevenfoot{TOC}{}{\thepage}{}
\makeoddfoot{TOC}{}{\thepage}{}
\makefootrule{TOC}{\textwidth}{0.5pt}{0pt}
\makeheadrule{TOC}{\textwidth}{0.5pt}
%%=================%%
%%=================%%
\begin{document}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\footskip}{30pt}
\tableofcontents{\pagestyle{TOC}}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\subsection{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\subsection{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\subsection{Lorem Ipsum}
\subsection{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\subsection{Lorem Ipsum}
\section{Lorem Ipsum}
\subsection{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\subsection{Lorem Ipsum}
\subsection{Lorem Ipsum}
\subsection{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\subsection{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\subsection{Lorem Ipsum}
\subsection{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\subsection{Lorem Ipsum}
\subsection{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\section{Lorem Ipsum}
\subsection{Lorem Ipsum}
\subsection{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\section{Lorem Ipsum}
\chapter{Lorem Ipsum}
\subsection{Lorem Ipsum}
\subsection{Lorem Ipsum}
\section{Lorem Ipsum}
\end{document}
Is there anyway to make the TOC follow the heading definitions?
Thanks in advance.
memoir
's enhancements, the only 'argument'\tableofcontents
might take is an '*'. Change this line of yours,\tableofcontents{\pagestyle{TOC}}
, into these two:\pagestyle{TOC} \tableofcontents
. That should do the trick.