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: 10
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

\documentclass[oneside]{book}
\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{graphics}                 % Packages to allow inclusion of graphics
\usepackage{color}                    % For creating coloured text and background

\usepackage[colorlinks,citecolor=blue,linkcolor=blue]{hyperref}
\usepackage[
  a4paper,
  margin=12mm,
]{geometry}
\usepackage{times} 
\usepackage[T1]{fontenc}

\DeclareGraphicsExtensions{.pdf}
\parindent 1cm
\parskip 0.2cm
\topmargin 0.2cm
\oddsidemargin 1cm
\evensidemargin 0.5cm
\textwidth 15cm
\textheight 21cm

\title{Organic Chemistry}

\author{\htmladdnormallink           % Puts a hyperlink on to the author's name
{The Alchemyst}{}
{\copyright 2018 }}

 \date{ }

\begin{document}
\maketitle
\tableofcontents
\addcontentsline{toc}{chapter}{Index}
\pagenumbering{roman}

\chapter{First Chapter}\normalsize
%\addcontentsline{toc}{chapter}{Preface}
\pagestyle{plain}
\lipsum
\pagestyle{headings}
\pagenumbering{arabic}

\include{ch1}
\include{ch2}

\include{index}
\addcontentsline{toc}{chapter}{Index}
\end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9706
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
LaTeX.org admin

Molibdeno
Posts: 10
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: 9706
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:

\cleardoublepage
\pdfbookmark{\contentsname}{Index}
\tableofcontents


Stefan
LaTeX.org admin

Molibdeno
Posts: 10
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 1 guest