4

I want to have a List of Figures, which also contains a reference URL (or the article which I refer to \cite{}) for each figure entry. (and if possible the URL should appear in the next line with a little indent for the whole link). For example:

2.1 This is a bird .............. 2

https://upload.wikimedia.org/wikipedia/commons/thumb/3/32/House_sparrow04.jpg/1280px-House_sparrow04.jpg

I already use the package hyperref, so I want to keep the backref for the figure (2.1 This is a bird) but I want the URL to be a link.

Example image (if you click the google.com link, then it will still bring you back to the figure instead of to the URL). Even if you click the citation, it will bring you back to the figure:

  • 1
    we need more informations how do you plan doing this? i mean in body of docment. – touhami Jul 23 '15 at 17:49
2

Here is one possible solution. It allows you to add a link (URL) to the LoF using \addloflink{<URL>} which is set using a special LoF-type - figlink.

enter image description here

\documentclass{report}

\usepackage{hyperref}

\makeatletter
\newcommand{\addloflink}[1]{% \addloflink{<URL>}
  \addtocontents{lof}{\begingroup\def\protect\@dotsep{10000}% Remove dots in LoF for this entry
    \protect\contentsline{figlink}{\protect\numberline{}\url{#1}}{}{}%
    \endgroup}% Restore dots in LoF for future entries
}
\newcommand{\l@figlink}{\@dottedtocline{1}{1.5em}{2.3em}}
\makeatother
\begin{document}

\listoffigures

\chapter{Some chapter}
\begin{figure}[ht]
  \caption{This is a figure}
  \addloflink{http://tex.stackexchange.com}
\end{figure}

\begin{figure}[ht]
  \caption{This is another figure}
\end{figure}

\end{document}

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.