I am trying to get a summary out of toc. The summary should only show chapters and sections. I used the following code:
\makeatletter
\newcommand*{\tableofcontentssummary}{%
\begingroup
\value{tocdepth}=1\relax% usually show part, chapter and section only
\@fileswfalse
\renewcommand*{\contentsname}{Summary}%
\tableofcontents
\endgroup
}
\makeatother
\section*{Summary}
\markboth{}{SUMMARY}
\label{sec:summary}
\addcontentsline{toc}{section}{\nameref{sec:summary}}
\tableofcontentssummary
This should work but I am getting issues with the functions I previously added to the toc. They also apply themselves to the summary. I want to remove >\renewcommand and and >\addtocontents{toc}.
They were implemented to set the table of contents name, to add a newpage between toc title and contents and to set header.
\renewcommand*\tableofcontents{\listoftoc[{Table of Contents}]{toc}}
\addtocontents{toc}{\protect\thispagestyle{empty} \newpage \markboth{}{TABLE OF CONTENTS}}
Here is what I get.
documentclass
and the relevantpackages
. This is called MWE, see tex.meta.stackexchange.com/questions/228. Otherwise, there is a big risk that there are misunderstandings and wrong assumptions.memoir
could be a good choice for you. Take a look at section 9.2.5 of the manual. In fact its table of contents is an example of what I believe you want\documentclass[12pt,a4paper]{report}