6

I am writing one report in which i need to write page index in the beginning of report.

    XYZ 
    This is my first section which may use n number of pages.

    DEF
    This section may use m number of pages.

    ABC 
    This section may use p number of pages.

I need to add image also like shown below.

enter image description here

How can i control it and write it on index page.

Regards

manish
  • 9,111

1 Answers1

7

I'm not sure if you want the table of contents (simply adding \tableofcontents{}) or the alphabetic index, but this example make both:

\documentclass{report}
\usepackage{makeidx}
\makeindex
\begin{document}
\tableofcontents{}
\part{ABC}
\index{ABC}ABC 
\part{DEF}
\index{DEF}DEF 
\part{XYZ}
\index{XYZ}XYZ
\printindex{}
\end{document}

Remember that you need to run pdflatex myfile.tex twice to obtain atable of contents. If there are an alphabetic index, it is also needed a makeindex myfile.idx after pdflatex myfile.tex to have a myfile.ind and then run pdflatex myfile.tex again.

Edit 1: As in the edited question you mention both report and section may be you will prefer change report by article in the document class and \section instead of \part.

Edit 2: The question ask now for include images in the table of contents. This is not trivial, but there a solution in Resources for designing a table of contents. Also could be of interest Include images in TOC?.

Fran
  • 80,769