How to give cross-reference to all words, Example 1, as follows?

enter image description here

I defined a new environment as follows:


When I give a \label{Example} to the example and write \ref{Example}, I get: enter image description here

just 1 includes the link.

\usepackage[linesnumbered,ruled,vlined]{algorithm2e}% http://ctan.org/pkg/algorithm2e


\begin{exmp} \label{Ex1}
 Let's consider:

    \caption{Results in \cref{EX1}

  • 1
    You should take a look at the cleveref package (to be loaded after hyperref)..
    – Bernard
    Mar 9, 2021 at 20:48
  • In fact, I usually cleveref and \cref. But it doesn't work in here.
    – 1_student
    Mar 9, 2021 at 21:25
  • 1
    Could you post a minimal, yet complete, code that we can text to see what happens?
    – Bernard
    Mar 9, 2021 at 21:27
  • Thank you. I edited the OP.
    – 1_student
    Mar 9, 2021 at 21:35
  • I'm sorry, but I can't compile your code. I don't have some packages installed (unrelated to the problem such as subfig, which is obsolete), vut more important there seems to be conflicts between packages. Could you post a code with only the relevant packages?
    – Bernard
    Mar 9, 2021 at 22:23


Your Answer

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

Browse other questions tagged or ask your own question.