# Define pagestyle for TOC / LOF / LOT with titlesec

I am using the titlesec package to define a rather simplistic pagestyle for the first pages of my chapter and the regular pages within a chapter:

\newpagestyle{main}{
{}{}{\thesection\ \sectiontitle}
\footrule\setfoot{}{\thepage}{}
}

\newpagestyle{chapter_first_page}{
\footrule\setfoot{}{\thepage}{}
}
\assignpagestyle{\chapter}{chapter_first_page}


I am failing, however, to apply that very same pagestyle to the pages for the table of contents and the list of figures. The closest I have come is using this:

\renewcommand*{\printtoctitle}[1]{\chapter*{#1}}
\renewcommand*{\printloftitle}[1]{\chapter*{#1}}
\renewcommand*{\printlottitle}[1]{\chapter*{#1}}


to get the TOC, LOF and LOT first page to be treated as a chapter. However, the pages are still missing the \footrule that should be part of the chapter_first_page style.

Also, if for example the LOF is longer than just a single page, the subsequent pages are not simply using the main pagestyle, but have "List of Figures" in both the header and the footer.

Any pointers regarding how to fix the problem and make the TOC / LOF / LOT pages fit in with the style of the rest of the document would be very much appreciated!

Edit: Here is a minimal working example that should illustrate the problem:

\documentclass[11pt, a4paper, twoside]{memoir}

\usepackage{lipsum}
\usepackage{microtype}

\usepackage[pagestyles, clearempty]{titlesec}

left=3cm, right=3cm, top=2cm, bottom=2cm]{geometry}

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

\newpagestyle{main}{
{}{}{\thesection\ \sectiontitle}
\footrule\setfoot{}{\thepage}{}
}
\pagestyle{main}

\newpagestyle{chapter_first_page}{
\footrule\setfoot{}{\thepage}{}
}
\assignpagestyle{\chapter}{chapter_first_page}

\titleformat{\chapter}[display]{\centering\LARGE\bfseries}
{\centering\scshape
{---~\chaptertitlename~\thechapter~---}}
{-6pt}{\Huge}[]

\renewpagestyle{plain}{
\footrule\setfoot{}{\thepage}{}
}

\renewcommand*{\printtoctitle}[1]{\chapter*{#1}}

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

\begin{document}

\thispagestyle{empty}
(Include some title page here)
\newpage

\thispagestyle{chapter_first_page}
\tableofcontents*

\chapter{Test Chapter 1}
\lipsum[23-42]

\chapter{Test Chapter 2}
\lipsum[23-42]

\end{document}


As on the first page of a chapter, the default is the plain page style, titletoc has a command to redefine any page style, so try this:

\renewpagestyle{plain}{%
\footrule

• I have tried this before, but redefining the plain pagestyle like this leads to the problem described here: tex.stackexchange.com/q/37253/97669, i.e. suddenly there's a "CONTENTS" in both the header and the footer (similarly for the LOF / LOT). Unfortunately, the fix described there using \renewcommand\@mkboth did not work for me (or I was putting the code in the wrong place). – der_herr_g Jun 25 '18 at 22:26
• Do you load also titlesec, or only titleps? – Bernard Jun 25 '18 at 22:29
• I am actually only loading titlesec, with the following options if that is relevant: \usepackage[pagestyles, clearempty]{titlesec}. If I try to also load titleps I get a large number of errors, either because of "Incompatible package" (when trying to load it before titlesec), or "Command already defined" (when loading it afterwards). – der_herr_g Jun 25 '18 at 22:36
• You don't have to load titleps if you use the pagestyles option. Could you post a minimal example code (b.t. w., do you redefine the chapters layout with titleformat?) – Bernard Jun 25 '18 at 22:38
• Yes, I do redefine the chapters layout using titleformat`. I added a minimal working example now; I hope it covers everything relevant. It's from a thesis template which contains lots of packages and options, so it's hard to tell what are all the things that could play into the issue... – der_herr_g Jun 25 '18 at 22:57