[texhax] Index in Table of Contents

Barbara Beeton bnb at ams.org
Mon May 31 18:30:09 CEST 2010


    I think I have a solution.

    Just before the *\printindex* command, I inserted the command *\newpage*
    and then the command*
    \addcontentsline{toc}{chapter}{\protect\numberline{}Index}
    *

    That seems to produce a Table of Contents with the correct page number for
    the Index without forcing a page break for the index.

    I hope this is a stable solution.

if the text preceding the index ends on an
even-numbered page, this should work.  if it
ends on an odd-numbered page, then the page
number generated for the index will be one
less than the actual page.  actually, there
are some obscure boundary conditions that
could also do the wrong thing, but they're
vanishingly unlikely to occur.

this is a good first approximation, though.
do check the result (after two latex runs)
to make sure you really do have the correct
page number, and if not, adjust as appropriate.
						-- bb


More information about the texhax mailing list