# Use of ref/label: Also linking word before label number

Is it somehow possible that I can extend the link to something which I produce by using \ref with a label by the word standing before \ref? If I write something like that:

For further information, have a look into chapter \ref{chap:abc} and figure \ref{fig:def}


then the only thing being "clickable" are the chapter number and the figure number. Is it somehow possible to make the words "chapter" and "figure" being linked to those objects as well?

• Once solution is to modify \@currentlable to include the words chapter or figure before calling \label. Another is to use \hyperlink{chapter \ref*{chap:abc}}{<anchor>} where you can find the anchor name in the aux file (last argument in \newlabel). Mar 10, 2021 at 23:54

The following works at least with cleveref.

\documentclass{article}

\usepackage{hyperref}
\usepackage{cleveref}
\crefformat{section}{#2section~#1#3}
\Crefformat{section}{#2section~#1#3}

\begin{document}
\section{Dummy-Section} \label{sec:dummy}
This is a dummy-section. This is a reference to \cref{sec:dummy}.
\end{document}


Have a look at the hyperref package: https://ctan.org/pkg/hyperref.

• It would have been nice for OP to give a little more to work with, but given that they said "clickable", it seems likely they are already using hyperref. Apr 17, 2021 at 19:31