I'm using the etoc package with the memoir document class to get two tables of contents (TOCs): a Short Contents listing only chapters and sections, and a Detailed Contents also including subsections.
Aim: I want neither TOC to be self-referential, but each to refer to the other. That is, I want the Short Contents to include an entry for the Detailed Contents but not for itself; and the Detailed Contents to include an entry for the Short Contents but not for itself.
Constraint: The memoir pagestyle and chapterstyle in effect need to be preserved.
(Compare memoir: headers for short and detailed tables of contents.)
The method shown in https://tex.stackexchange.com/a/346433/13492, unfortunately, does not preserve the pagestyle for pages after chapter page in the Short Contents and the Long Contents. It does, however, produce the wanted entries of each of the two TOCs in, and only in, the other; and it makes the links on each of those entries point to the top of the corresponding TOC page.
Attempt: The following MWE almost accomplishes this:
- the Detailed Contents does have an entry for Short Contents but not for itself; however,
- the Short Contents does just the opposite of what I want -- it has an entry for itself but not for the Detailed Contents.
Note that the Detailed Contents is produced with \tableofcontents*, the starred version whereas the Short Contents is produced with \tableofcontents, the unstarred version.
Caution: If I use the starred version for both tables, then neither table has entries for either itself or the other one.
Question: How can I accomplish my aim?
\documentclass{memoir}
\pagestyle{plain}
\chapterstyle{default}
\setsecnumdepth{subsection}
\usepackage{hyperref}
% TOC STUFF
\usepackage{etoc}
\AtBeginDocument{\addtocontents{toc}{\protect\hypersetup{hidelinks}}}
\begin{document}
\frontmatter
\etocsettocdepth{1}
\renewcommand{\contentsname}{Short Contents}
\tableofcontents % <--- unstarred
\clearpage
\etocsettocdepth{2}
\renewcommand{\contentsname}{Detailed Contents}
\tableofcontents* % <--- starred
\clearpage
\mainmatter
\newcommand\Sample{
\chapter{Chap}This is a chapter.
\section{Sec}This is a section.
\subsection{Subsec}This is a subsection.
}
\Sample\Sample
\end{document}
A partial solution not using etoc
See https://tex.stackexchange.com/a/512752/13492.
However, this method not using etoc* **does not work if biblatex is also loaded. See: memoir + biblatex + 2 TOCs error .


biblatexis also loaded! See: https://tex.stackexchange.com/questions/513429/memoir-biblatex-2-tocs-error – murray Oct 23 '19 at 22:32