0

I am trying to add a clickable reference to the caption of an image. I have the following code:

\begin{figure}
    \centering
    \includegraphics[width=0.5\textwidth]{Situación actual}
    \caption{Some caption}
    \label{fig:Sit}
\end{figure}

But inside the caption I one to add something like "Image obtained from here" (here as a clickable link), so I tried this:

\begin{figure}
    \centering
    \includegraphics[width=0.5\textwidth]{Situación actual}
    \caption{Some caption \href{website.com}{here}}
    \label{fig:Sit}
\end{figure}

However I get an error. I'm already using the hyperref package.

Thank you.

EDIT: It was a bug or something with my text editor.

3
  • 2
    This shows no problem when using \href in \caption: How to add \href to \caption in figure environment
    – Werner
    Nov 25 at 19:10
  • 1
    Can you provide a completely minimal example that replicates your problem, since I can't replicate the issue.
    – Werner
    Nov 25 at 19:11
  • It must have been a bug with my text editor or something, I tried closing and opening it twice and I was getting an error. I tried it again and as you mention, I was able to do it with no problem at all.
    – Jvet
    Nov 25 at 19:16