0

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?

  • 1
    Your example code doesn't allow us to reproduce the problem (the index letters don't appear in the ToC). Please improve your code so we can reproduce the issue. – Gonzalo Medina Sep 7 '15 at 14:12
  • 1
    I can not reproduce this with your MWE: Are you doing something else than pdflatex, makeindex, and again pdflatex? Are there some definitions we need to know about? Please clear your auxiliary files and try your MWE. If you still get that output, I would be surprised. – LaRiFaRi Sep 7 '15 at 14:14
  • This MWE produces something completely different but nothing similar to the screen shot – user31729 Sep 7 '15 at 14:20
  • Why do you need the doc package? It's meant for documenting latex code/packages, not for writting at thesis – user31729 Sep 7 '15 at 14:27
  • The doc packages is needed for other things to work and I have had trouble with it messing up things in other questions I have posted, so I included it here. – Kajsa Sep 7 '15 at 16:17
1

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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.