Articles, Essays, and Journal TemplatesTable of contents self-reference

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

Table of contents self-reference

Post by Molibdeno »

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

Code: Select all

\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}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Table of contents self-reference

Post by Stefan Kottwitz »

Hi!

Sure, no problem - just remove this line:

\addcontentsline{toc}{chapter}{Index}

Stefan
LaTeX.org admin
Molibdeno
Posts: 12
Joined: Fri Apr 07, 2017 12:15 pm

Table of contents self-reference

Post by Molibdeno »

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: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Table of contents self-reference

Post by Stefan Kottwitz »

You can add bookmarks manually, such as:

Code: Select all

\cleardoublepage
\pdfbookmark{\contentsname}{Index}
\tableofcontents
Stefan
LaTeX.org admin
Molibdeno
Posts: 12
Joined: Fri Apr 07, 2017 12:15 pm

Table of contents self-reference

Post by Molibdeno »

Awesome! Thank you very much!
Post Reply