16

I am editing a novel in memoir class that requires a table of contents for the whole book (introduction, preface, chronology, bibliography, etcetera) and another independent table of contents for just the original novel (author's preface, chapters). I have been trying to use the shorttoc for the book material and the regular toc for the original novel material, but I cannot get the introduction and whatnot to appear in the shorttoc alone.

This is the structure that I want:

\shorttoc
Introduction 
Note on the Text
Chronology
Novel
   \toc
   Author's Preface
   Book One
   Chapter One
   Etcetera
Bibliography

I am not married to the shorttoc approach, so any solution would be welcome, especially if there is a way to create two completely independent tables of contents where I could just \addcontenstline to one or the other or both.

Update: Using Caramdir's solution, I can get the two tables of contents to appear, but I cannot get them to populate. Here is my code. The individual \addcontents lines are in the included files, but I have also tried them in the main file with the same results:

\documentclass{memoir}

\title{The Napoleon of Notting Hill}
\author{G. K. Chesterton}
\date{2012}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ccicons}
\usepackage{graphicx}
\usepackage{natbib}
\usepackage{titletoc}

\begin{document}

\frontmatter

\pagestyle{empty}

\include{maintitle}

\newpage

\include{license}

\newpage

\include{dedication}

\newpage

\pagestyle{simple}

\startcontents
\printcontents{}{-1}{\chapter*{Table of Contents}}

\newpage

\include{introduction}

\newpage

\include{chronology}

\newpage

\mainmatter

\include{title}

\endcontents

\newpage

\startcontents
\printcontents{}{-1}{\chapter*{Contents}}

\include{chapterx} %etcerera

\endcontents

\endmatter

\nobibintoc
\include{bibliography}

\end{document}

Caramdir - The solution at Two independent TOCs would work as well, but neither solution will populate for me. I even cut the code straight from each into a test file, compiled twice, and still got empty headers. I am using ScribTeX to compile online. Might this have something to do with it?

4

1 Answer 1

12

The titletoc package allows you to obtain partial (independent) ToCs. The following example illustrates the procedure and also shows how to manually include (via \addcontentsline) entries in each one of the ToCs:

\documentclass{memoir}
\usepackage{titletoc}

\begin{document}

\startcontents
\printcontents{}{-1}{\chapter*{Short ToC}}

\chapter*{Introduction}
\addcontentsline{ptc}{chapter}{Introduction}
\chapter*{Note on the Text}
\addcontentsline{ptc}{chapter}{Note on the Text}
\chapter*{Chronology}
\addcontentsline{ptc}{chapter}{Chronology}
\chapter*{Novel}
\addcontentsline{ptc}{chapter}{Novel}

\stopcontents

\startcontents
\printcontents{}{-1}{\chapter*{Contents}}

\chapter*{Author's Preface}
\addcontentsline{toc}{chapter}{Author's Preface}
\part{Book One}
\chapter{Chapter One }
\chapter{Chapter Two}

\stopcontents

\end{document}

An image of the obtained ToCs

enter image description here

enter image description here

1
  • 1
    Just wanted to say thanks for the example, @GonzaloMedina; I wander why the manual doesn't have something like this :) Note to self: the manual's wording "\startcontents[<name>] - ... a partial toc begins ... The <name> argument allows different sets of tocs..." made me think that partial tocs are saved to files \jobname.<name> ; however, there is only one file for partial tocs, \jobname.ptc - and inside, different partial tocs are differentiated via \ttl@starttoc {<name>@1} (and corresponding ..stoptoc...) Many thanks again - cheers!
    – sdaau
    Jun 22, 2012 at 4:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .