# Custom \listoffigures with images link

In me latex document I use the command \listoffigures for the list of figures that I have.

My figure code is

\begin{figure}
\centering
\includegraphics[scale=0.5]{xamarin.png}
\caption{Architettura di Xamarin}
\label{ref:xamarin}
\end{figure}


that I refer with \ref{ref:xamarin} into the document. At the end, my list of figure it's this:

It is possible to add also the link, for each figure? under each description...like this:

You can define a different caption text for lof using \caption[text for list]{text under figure} and add the url to text for the lof.

\documentclass{article}
\usepackage{graphicx}
\usepackage{hyperref}

\begin{document}

\begin{figure}
\centering
\includegraphics[scale=0.5]{example-image}
\label{ref:xamarin}
\end{figure}

\listoffigures

\end{document}


• thank you! I added \protect before \url because without gives me an error. – JEricaM Sep 1 '17 at 16:49

For your figure captions use the custom command \ccaption{Figure caption}{Figure link}. I have packaged all the necessary components in this command.

To control the appearances of hyperlinks, please see the hyperref documentation.

I use this setup most of the time, you may change as suits you:

\hypersetup{
citecolor={blue!50!black},
urlcolor={blue!80!black}}


Here is your main piece of code:

\documentclass{article}

\usepackage{hyperref}

\usepackage{url}

\def\hhref#1{\href{#1}{#1}}
\def\ccaption#1#2{\caption[#1\newline#2]{#1}}

\begin{document}

\listoffigures

\clearpage

\begin{figure}[!tb]
\centering
\rule{0.2\textwidth}{0.25\textwidth}
\ccaption{First figure.}{\hhref{www.figure.com/fig1}}
\label{fig:fst}
\end{figure}

\begin{figure}[!tb]
\centering
\rule{0.2\textwidth}{0.25\textwidth}
\ccaption{Second figure.}{\hhref{www.morefigure.com/figII}}
\label{fig:scd}
\end{figure}

\end{document}