%% Add Index section to the table of contents.
\let\origprintindex\printindex
\def\printindex{\addcontentsline{toc}{chapter}{Index}\origprintindex}
%% Add Index section to the table of contents.
\let\origprintindex\printindex
\def\printindex{\addcontentsline{toc}{chapter}{Index}\origprintindex}