1

In many of my projects I end up including a lot of external figures, like

\begin{figure}[h]
\begin{center}\vspace{1cm}
    \includegraphics[width=\linewidth]{something.png}
    \caption{An illustration of something.}
    \label{fig:foo}
\end{center}
\end{figure}

These figures are often taken from somewhere else and Creative Commons licensed, and some of them require attribution. Either way, I generally include a table of all figures at the end of the document, like

\begin{tabular}{ |c|c|c| }
\hline
 Figure & Author & License \\
 \hline
 1 & John Smith / Wikimedia Commons & CC-BY-SA 3.0 \\
 \hline
 2 & Jane Doe & CC-BY-NC 3.0 \\
 \hline
 3 & Own Work & Public Domain \\
 \hline
\end{tabular}

The problems with this are:

  • I have to do the table markup for every project I make;
  • The attribution and license information is far from the figure it applies to in the source code, making it harder to maintain;
  • If the figure numbers or relative ordering of the figures were to change, I would need to manually update the table.

I'm aware of the existence of \listoffigures, but it doesn't seem to have the kind of format I want; I don't need the page numbers nor the captions, and I would much rather have the figures listed in a table like the above.

In my ideal use case, I'd prefer to be able to include such information inline when creating the figure, like

\begin{figure}[h]
\begin{center}\vspace{1cm}
    \includegraphics[width=\linewidth]{something.png}
    \caption{An illustration of something.}
    \label{fig:foo}
    \author{Jane Doe}
    \license{CC-BY-NC 3.0}
\end{center}
\end{figure}

and then put something like \tableoffigures at the end of the project to make the table automatically. I'd also like to be able to put this in a separate package that I could just \usepackage in order to make the necessary changes (I know this is technically a different question, but I wouldn't know how to modify a solution to include this feature).

How could I do this? Other tips are welcome; I'm not too knowledgeable about LaTeX so if this would be easier to accomplish with a different environment than \begin{figure} or a separate package then that would be fine.

3
0

You can add the author and license information to the \listoffigures (I don't see why you do not want a list of figure titles and the pages they are on). Here is a revision of your MWE

\begin{center}\vspace{1cm}
    \includegraphics[width=\linewidth]{something.png}
    \caption{An illustration of something.} %% puts it in the LoF
    \label{fig:foo}
    \author{Jane Doe}
    \addtocontents{lof}{Author Jane Doe}
    \license{CC-BY-NC 3.0}
    \addtocontents{License CC-BY-NC 3.0}
\end{center}
\end{figure}

You can, of course, change your \author and \license macros to automatically add the arguments to the LoF.

In any case do not use the center environment within floats as it adds unwanted vertical spaces, just use \centering.

1
  • I appreciate the pointer towards addtocontents, but I'll wait to see if someone else can match the formatting a bit better. I would definitely prefer to have a proper table rather than a list. It seems like the etoc package can do almost exactly what I want, but only for the table of contents - it doesn't support the list of figures.
    – Egg-Fault
    Jul 23 at 20:09

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.