[Tex/LaTex] Remove index letters from toc

indexingtable of contents

I would like to remove the index letters from the toc in my master thesis. The whole index is on the same page anyway.

\documentclass[a4paper, 10pt]{report}

\usepackage{hyperref}
\usepackage{doc}

 %%%%%% Indexing %%%%%%
 \IndexPrologue{\chapter*{Index}\markboth{Index}{Index}}% section heading, no message
\usepackage{makeidx}
\makeindex

%%% Begin document
\begin{document}

\tableofcontents
\setcounter{page}{1} 

\index{And}
\index{Book}
\index{Summer}
\index{Latex}

\pagebreak

\addcontentsline{toc}{chapter}{Index}
\printindex

\end{document}

Which produces this toc

ToC

Whereas I would like it to only contain the Index line, not the separate letters.

How can I solve this?

Best Answer

I think that makeindex is configured to use special style,

makeindex -s mystyle.ist myfile.idx with mystyle.ist something like this

% MakeIndex style file
heading_prefix "\\section{ "      
heading_suffix "}"  
headings_flag  1 

The solution is to localy desable \addcontentsline

\documentclass[a4paper, 10pt]{report}

\usepackage{hyperref}
\usepackage{doc}

 %%%%%% Indexing %%%%%%
 \IndexPrologue{\chapter*{Index}\markboth{Index}{Index}}% section heading, no message
\usepackage{makeidx}
\makeindex

%%% Begin document
\begin{document}

\tableofcontents
\setcounter{page}{1} 

\index{And}
\index{Book}
\index{Summer}
\index{Latex}

\pagebreak

\addcontentsline{toc}{chapter}{Index}

{\def\addcontentsline#1#2#3{} %<---
\printindex}                  %<---

\end{document}
Related Question