LaTeX forum ⇒ Articles, Essays, and Journal TemplatesTable of contents self-reference Topic is solved

IEEE, Elsevier, ACM, ACE, Science, AGU, PNAS, PLOS, RSoC, Springer, Stylish articles and Essays
Molibdeno
Posts: 7
Joined: Fri Apr 07, 2017 12:15 pm

Table of contents self-reference

Postby Molibdeno » Thu Mar 08, 2018 11:17 pm

Hi. There's a way to kick off the self-reference on the table of contents? I mean the link to the toc himself on the output file

  1. \documentclass[oneside]{book}
  2. \usepackage[italian]{babel}
  3. \usepackage[utf8]{inputenc}
  4. \usepackage{lipsum}
  5. \usepackage{graphics} % Packages to allow inclusion of graphics
  6. \usepackage{color} % For creating coloured text and background
  7.  
  8. \usepackage[colorlinks,citecolor=blue,linkcolor=blue]{hyperref}
  9. \usepackage[
  10. a4paper,
  11. margin=12mm,
  12. ]{geometry}
  13. \usepackage{times}
  14. \usepackage[T1]{fontenc}
  15.  
  16. \DeclareGraphicsExtensions{.pdf}
  17. \parindent 1cm
  18. \parskip 0.2cm
  19. \topmargin 0.2cm
  20. \oddsidemargin 1cm
  21. \evensidemargin 0.5cm
  22. \textwidth 15cm
  23. \textheight 21cm
  24.  
  25. \title{Organic Chemistry}
  26.  
  27. \author{\htmladdnormallink % Puts a hyperlink on to the author's name
  28. {The Alchemyst}{}
  29. {\copyright 2018 }}
  30.  
  31. \date{ }
  32.  
  33. \begin{document}
  34. \maketitle
  35. \tableofcontents
  36. \addcontentsline{toc}{chapter}{Index}
  37. \pagenumbering{roman}
  38.  
  39. \chapter{First Chapter}\normalsize
  40. %\addcontentsline{toc}{chapter}{Preface}
  41. \pagestyle{plain}
  42. \lipsum
  43. \pagestyle{headings}
  44. \pagenumbering{arabic}
  45.  
  46. \include{ch1}
  47. \include{ch2}
  48.  
  49. \include{index}
  50. \addcontentsline{toc}{chapter}{Index}
  51. \end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9196
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Thu Mar 08, 2018 11:38 pm

Hi!

Sure, no problem - just remove this line:

\addcontentsline{toc}{chapter}{Index}

Stefan
Site admin

Molibdeno
Posts: 7
Joined: Fri Apr 07, 2017 12:15 pm

Postby Molibdeno » Fri Mar 09, 2018 10:43 am

Very well. At the same time, however, I would like it not to be removed from the pdf reader's bookmarks. Is such a thing possible?

Image

User avatar
Stefan Kottwitz
Site Admin
Posts: 9196
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Fri Mar 09, 2018 7:06 pm

You can add bookmarks manually, such as:

  1. \cleardoublepage
  2. \pdfbookmark{\contentsname}{Index}
  3. \tableofcontents


Stefan
Site admin

Molibdeno
Posts: 7
Joined: Fri Apr 07, 2017 12:15 pm

Postby Molibdeno » Fri Mar 09, 2018 7:26 pm

Awesome! Thank you very much!


Return to “Articles, Essays, and Journal Templates”

Who is online

Users browsing this forum: No registered users and 3 guests