Created
October 29, 2019 20:38
-
-
Save jfbu/88f77299fae9a9d920eb52d0183a3b41 to your computer and use it in GitHub Desktop.
usage of etoc package to handle multiple TOCs, for example one short and one detailed mutually referencing one another
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% we use etoc concept of depthtags | |
% here, it could be simplified but I added some complete | |
% mark-up in case the location of the TOCs are moved. | |
% of course, this can be extended easily to >2 TOCs | |
% with complex rules of listing or not one another | |
% jfbu Mardi 29 octobre 2019 à 21:38:25 | |
\documentclass{memoir} | |
\pagestyle{plain} | |
\chapterstyle{default} | |
\setsecnumdepth{subsection} | |
\usepackage{hyperref} | |
% TOC STUFF | |
\usepackage{etoc} | |
\AtBeginDocument{\addtocontents{toc}{\protect\hypersetup{hidelinks}}} | |
\etocsettagdepth{AfterShort}{all} | |
\etocsettagdepth{AfterDetailed}{all} | |
\begin{document} | |
\frontmatter | |
\etocsettocdepth{1} | |
\etocsettagdepth{Short}{none} | |
\etocsettagdepth{Detailed}{all} | |
\renewcommand{\contentsname}{Short Contents} | |
\etocdepthtag.toc{Short} | |
\tableofcontents | |
\etocdepthtag.toc{AfterShort} | |
\clearpage | |
\etocsettocdepth{2} | |
\etocsettagdepth{Short}{all} | |
\etocsettagdepth{Detailed}{none} | |
\renewcommand{\contentsname}{Detailed Contents} | |
\etocdepthtag.toc{Detailed} | |
\tableofcontents | |
\etocdepthtag.toc{AfterDetailed} | |
\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} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment