Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
Does tex.stackexchange.com/questions/48900/two-independent-tocs solve your problem? –  Caramdir Apr 1 '12 at 0:58
    
possible duplicate of How to remove the self-reference of the ToC from the ToC? –  cmhughes Apr 1 '12 at 20:04
    
I don't know: personally, I have neither used titletoc nor ScribTeX. –  Caramdir Apr 2 '12 at 23:13
    
The issue was in ScribTex and has now been addressed by the admin. Gonzalo Medina's solutions here and in <a href="tex.stackexchange.com/questions/48900/…; tex.stackexchange.com/questions/48900/two-independent-tocs</…; now both work well. –  Jeremy Apr 4 '12 at 13:54
add comment

1 Answer

up vote 11 down vote accepted

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

share|improve this answer
    
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 '12 at 4:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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