How to reference the Index?
You can do it with imakeidx
:
\documentclass{scrbook}
\usepackage{imakeidx}
\usepackage{hyperref} % creates links on refs
\makeindex[title={Index\label{index}}]
\begin{document}
% add something to the index...
The foobar\index{foobar} is quite impressive!
% some reference to the index...
Please follow the \hyperref[index]{index}.
% print index...
\printindex
\end{document}
There is a hook \setindexpreamble
in the scr
classes to add material at the beginning of the index. You can use this to set your label. Using just \ref
will give a blank link, you need either a \pageref
or a \nameref
.
\documentclass{scrbook}
\usepackage{makeidx}
\usepackage{hyperref} % creates links on refs
\makeindex
\setindexpreamble{\label{index}}
\begin{document}
\label{start}
% add something to the index...
The foobar\index{foobar} is quite impressive!
% some reference to the index...
Please see the \nameref{index}.
% print index...
\printindex
\end{document}
In standard classes such as article
and book
you can use the etoolbox
package to patch theindex
environment to provide a suitable anchor as follows:
\patchcmd{\theindex}{\thispagestyle{plain}}
{\thispagestyle{plain}\phantomsection\label{index}}{}{}
You can usefully refer this either via \pageref
, or via \hyperref[index]{text description}
and in particular \hyperref[index]{\indexname}
\documentclass{book}
\usepackage{makeidx}
\usepackage{etoolbox}
\usepackage{hyperref}
\makeindex
\patchcmd{\theindex}{\thispagestyle{plain}}
{\thispagestyle{plain}\phantomsection\label{index}}{}{}
\begin{document}
\label{start}
% add something to the index...
The foobar\index{foobar} is quite impressive!
% some reference to the index...
Please see the \hyperref[index]{\indexname}.
% print index...
\printindex
\end{document}