1

I am using document class report. I have some pages like abstract, acknowledgements, dedication which appear before table of contents

As I saw in the following page Insert list of figures in the table of contents

I need to add

   \addcontentsline {toc}{chapter}{Abstract}

to my code.

I have the following code

      \pagenumbering{roman} 
      \setcounter{page}{2}
      \include{Abstract}
      \addcontentsline {toc}{chapter}{Abstract}
       \include{Dedication}
       \addcontentsline {toc}{chapter}{Dedication}
       \include{Acknowledgements}
       \addcontentsline {toc}{chapter}{Acknowledgements}


       %\addcontentsline{toc}{chapter}{\tableofcontents}
        \tableofcontents
        \listoffigures
         \addcontentsline{toc}{chapter}{\listfigurename}
         \include{Abbreviations}
         \addcontentsline {toc}{chapter}{Abbreviations}

        \pagenumbering{arabic}
        \setcounter{page}{1}

        \include{Introduction}
        .....

Note that I tried adding \addcontentsline before and after the include, with the same results.

I also use the following:

 \usepackage{hyperref}
 \hypersetup{
      colorlinks,
      citecolor=black,
      filecolor=black,
      linkcolor=black,
      urlcolor=black}

I have three problems:

1- The above code adds the pages abstract, acknowledgements, dedication to the table of contents, but when I click, they don't take me to the right page.

2- I am not able to add table of contents to table of contents.

3- For some reason, Abbreviations (which has two pages) is listed after the chapter 1 in table of contents. When I click it, it only takes me to page 2 of abbreviation.

Also is there a way to hide the chapter name from being displayed in the dedication page?

Your help is most appreciated.

  • I don't understand point 2: when you read the table of contents, you want to know which page it will be found? :–) – Bernard Jan 16 '18 at 1:17
  • @Bernard I mean, how can I add the entry "table of contents" to show in the actual table of contents ! It is a requirement by my college – Melanie A Jan 16 '18 at 1:20
  • Off-topic: Since the instruction \pagenumbering{arabic} is provided, the follow-up instruction \setcounter{page}{1} shouldn't be needed. – Mico Jan 16 '18 at 1:27
  • You can do that with the tocbibind package. – Bernard Jan 16 '18 at 1:28
  • @Mico: ;o) – I definitely should look more carefully at what's posted… – Bernard Jan 16 '18 at 1:32
1

1- The above code adds the pages abstract, acknowledgements, dedication to the table of contents, but when I click, they don't take me to the right page.

You need to insert a \phantomsection instruction immediately after \chapter*{Abstract}, chapter*{Dedication}, \chapter*{Acknowledgments}, etc. This should happen, obviously, inside the files Abstract.tex, Dedication.tex, Acknowledgments.tex, etc.

2- I am not able to add table of contents to table of contents.

I suggest you load the tocbibind package with the option notindex:

\usepackage[notindex]{tocbibind}

This setup also provides for insertion of entries for the list of figures, the list of tables, and the bibliography in the table of contents. I.e., you will no longer need to provide the instruction \addcontentsline{toc}{chapter}{\listfigurename}.

Of course, if your document does contain an (unnumbered) index and if you wish to show this (unnumbered) entity, you can omit the option notindex.

3- For some reason, Abbreviations (which has two pages) is listed after the chapter 1 in table of contents. When I click it, it only takes me to page 2 of abbreviation.

This is happening because the instruction \addcontentsline {toc}{chapter}{Abbreviations} occurs too late, viz., after both pages of abbreviations have been generated by LaTeX. I suggest you move \addcontentsline {toc}{chapter}{Abbreviations} into file Abbreviations.tex and execute it right after \chapter*{Abbreviations}.

You should probably also insert the instruction \clearpage (or \cleardoublepage) immediately before \pagenumbering{arabic}.

  • Just a clarification: currently neither the bibliography nor the contents appear in the table of contents. If I need to show both of them, I should just use \usepackage{tocbibind}? I want to show both of them but without a chapter number to appear on bibiliography – Melanie A Jan 16 '18 at 2:21
  • When I use the command suggested and run latex, I get the error can not execute command doc oped ...... But when I comment it out I am able to run the file without problems. I am using win 7 and TexNicCenter – Melanie A Jan 16 '18 at 2:30
  • @MelanieA - TeXnicCenter is just a front-end. Which TeX distribution to you employ? If you happen to use MikTeX, do you know how to install a "missing package"? (It looks like you may not have installed the tocbibind package by default.) – Mico Jan 16 '18 at 2:32
  • 1
    @MelanieA - Indeed, if you want to show the (unnumbered) bibliography in the table of contents, do omit the notbib option. – Mico Jan 16 '18 at 2:33
  • Thanks :) Now I can see contents and bib in table of contents. Could you please help with the other two issues? – Melanie A Jan 16 '18 at 2:40

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.