Owen Lucas wrote:
> 
> Hi all
> 
> I want to put the page number of my TOC, list of figures, list of tables
>   in my TOC. To do this I used the
> \addcontentsline{toc}{chapter}{Contents}
> just after the TOC
> all was fine till my TOC was more than one page. At this stage the
> \addcontentsline{toc}{chapter}{Contents}
> came to live on the last page of the TOC. 

Obviously, as \addcontentsline refers to the page it is on.  Do it
after the toc, and you get the page number after the toc.

> As a result the TOC referenced
> it's last page and not where it started. Puting the addcontentsline on
> the line befor ment that the page number was wrong as well.

Yes, because these lists are a form of "chapters" which starts a new
page.

> While the
> TOC does not need to be in the TOC (as if you were reading it you had
> found it) but I would like to get the list of figures, list of tables
> correct. 

Take a look at class options first.  I don't know about "book", but
"scrbook" support options like bibtotoc, figurestotoc and similiar.
Perhaps book have something similiar, or perhaps you can switch to
scrbook (koma-script book) with no pain?

> I am using class book. I have not had any trouble with this
> using class report as I inserted the page breaks myself. Any ideas on
> how to fix this up in class book

As a last resort, redefine the commands that produce toc, list of
figures,
etc.  This isn't nearly as hard as it sounds.  Here's how:
For example, lets redefine \listoffigures.  To do this, 
you want to know the current definition of \listoffigures, because
you probably don't know how to re-implement it.  Getting this is
trivial:

Start latex with no parameters.  (I.e. type "latex<enter>" in a xterm)
You should get something like this, possibly a different version:

This is TeX, Version 3.14159 (Web2C 7.3.7)
**
type in
\documentclass{book}<enter>
You should get another "*" prompt.  Type in
\show\listoffigures<enter>
And there it is!  Put all of it in the preamble of your document.
Test it (view dvi or similiar) to see that you didn't make any
mistakes cutting and pasting it.

When this works flawlessly, change the definition by putting your 
\addcontentsline{} somewhere in the middle of it.

If you know some latex you'll see a good spot.  If not - experiment.
Too early and you get the "page before" problem, too late and
you'll get the "last page" problem.
Look for a place in the macro after the new page/chapter has started,
before the actual listing begins.  Somewhere around the heading perhaps.
Make sure to put your
\addcontentsline between other commands, not in the middle of one.


Helge Hafting

Reply via email to