Walt Mankowski on 8 Sep 2004 22:46:01 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] latex: table of contents question


On Wed, Sep 08, 2004 at 02:48:57PM -0400, Jeff Abrahamson wrote:
> On Wed, Sep 08, 2004 at 12:29:36PM -0400, Walt Mankowski wrote:
> >   [25 lines, 133 words, 798 characters]  Top characters: te.noaih
> > 
> > On Tue, Sep 07, 2004 at 11:55:50AM -0400, Jeff Abrahamson wrote:
> > > I want my bibliography and index to appear in my table of contents.  I
> > > say this:
> > > 
> > >     \addtocontents{toc}{Bibliography}
> > >     \input{bib.tex}
> > > 
> > >     \addtocontents{toc}{Index}
> > >     \printindex
> > > 
> > > At the end of my document the bibliography and index appear correctly
> > > and with page numbers, but in the TOC I see everything correct except
> > > the final line.  The last two lines are
> > > 
> > >     Conclusions ......................................... 52
> > >     Bibliography Index
> > > 
> > > without any page numbers for the bibliography and index.
> > > 
> > > Any thoughts why and what to do about this?
> > 
> > All I can think of is that maybe you've got to run latex twice in
> > order for the toc to pick up the \addtocontents lines corrently.
> 
> I run latex, makeindex, and then latex again.

Aha! http://www.tex.ac.uk/cgi-bin/texfaq2html?label=tocbibind explains
how to do it.  Looks like you should be using \addcontentsline instead
of \addtocontents, and adding \cleardoublepage to get the numbering
right.

Walt

Attachment: signature.asc
Description: Digital signature