1

I'm very new to Latex and I need to make two table of contents, one in the beginning and one in the end. The one in the end should be very detailed and the one in the beginning should just be a general overview of everything. Here is my code and the results :

\documentclass[12pt,oneside]{memoir}

\usepackage{shorttoc}

\begin{document}

\renewcommand*\contentsname{Detailed contents}

%\begin{KeepFromToc}
\shorttoc{Contents}{0}
\setcounter{tocdepth}{4}
\tableofcontents
\chapter*{Introduction}
\thispagestyle{plain}
\addcontentsline{toc}{chapter}{Introduction}


\part{Part 1}
\chapter{Chapitre 1 : first chapter!} 
\section{Section 1 --- ch1 sec2}
\paragraph{§1 – para1}
\paragraph{§2 – para2}
\section{Section 2 --- ch1 sec2}
\paragraph{§1 – parag1}
\paragraph{§2 – parag 2}
\section*{Conclusion Chapitre 1}
\addcontentsline{toc}{chapter}{Conclusion Chapitre 1}
\chapter{Chapitre 2 } 
\section{Section 1 --- ch2 sec1}
\paragraph{§1 – my first parag}
\paragraph{§2 – my second parag}
\section{Section 2 --- ch2 sec2}
\paragraph{§1 – my first paragraph\\\\}
\paragraph{§2 – my2ndeParagraph\\\\}
\section*{Conclusion Chapitre 2}
\addcontentsline{toc}{chapter}{Conclusion Chapitre 2}
\end{document}

And here is what I get : general enter image description here

This is pretty good, but I need some editing for the first table of contents :

1) I DON'T want to keep "Conclusion Chapter 1" and "Conclusion Chapter 2" in the short TOC, but only in the long one.

2) I DON'T want page numbers nor dots in the first short TOC.

Any ideas on how to do this? Thanks!

2

You have made some odd choices in your original document, which may or may not be intentional:

  • making an unnumbered section for each conclusion, but adding the conclusions to the ToC as chapters
  • use of the \paragraph command. Normally (and very rarely) those are used for numbered document divisions below \subsubsection. This is the reason why you have such a large change in indentation between the sections and the paragraphs in the ToC -- the subsections and subsubsections would normally fill the gaps. If you don't intend to have subsections and subsubsections, you may just want to place whitespace between each paragraph and let them indent normally.

That having been said:

\documentclass[10pt,oneside]{memoir}

\begin{document}

{ % \renewcommand entries here will be discarded at the end of this local group
\renewcommand*{\contentsname}{Short contents}
\makeatletter
\renewcommand{\cftpartformatpnum}[1]{\hfil}
% adapted from section 9.2.2 of memoir manual
\makeatother
\renewcommand{\cftchapterformatpnum}[1]{}
\setcounter{tocdepth}{0}% chapters and above
\tableofcontents*
} % end of local group

\renewcommand*\contentsname{Detailed contents}
\setcounter{tocdepth}{4}% paragraphs and above
\tableofcontents

\chapter{Introduction}

\part{Part 1}
\chapter{first chapter!} 
\section{ch1 sec1}

\begin{quote}
``If you really need finer divisions, they are \verb|\subsubsection|,\\
 \verb|\paragraph| and lastly \verb|\subparagraph|.''

\sourceatright{Section 6.2 of the memoir manual}
\end{quote}

\paragraph{§1 – para 1}
\paragraph{§1 – para 2}
\section{ch1 sec2}
\paragraph{§2 – para1}
\paragraph{§2 – para 2}
\section{Conclusion Chapitre 1}

Here's a paragraph of text written like most people would do. Here's more of the paragraph.

Here's a second paragraph of text. It's separated from the previous paragraph by one or more blank lines.

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.