0

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?

1
  • 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). – John Kormylo Mar 10 at 23:54
3

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

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

1
  • 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. – Teepeemm Apr 17 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.