I have asked a similar question which sought to create a list of figures sources but with this one I want to attempt to do something slightly different, in that instead of a single entry per image there would be a single entry for multiple images from one source.
I have tried modifying one of the answers from this question to get the desired results but as an amateur I don't really know macros.
First up here is a sample picture of the desired results.
This is my (copied/adapted from this answer) attempt at a MWE so far.
\documentclass[oneside]{memoir}
\usepackage{lstdoc}
\makeatletter
\def\tags{Physics,Computer Science,Chemistry,}
%% sorts the tags for later on
\def\tags@sorted{\lst@BubbleSort\tags}
\tags@sorted
%% we automatically create macros for each tag
\def\macrofy@#1\@nil{%
\expandafter\def\csname#1\endcsname{}
}
\def\addtags#1{\g@addto@macro\tags{#1,}
\tags@sorted
\macrofy@@
}
%% Make macros to hold the lists for each tag
%%
\def\macrofy@@{\@for\next:=\tags\do{%
\expandafter\macrofy@\next\@nil
}}
\macrofy@@
\def\addtotag#1\@nil#2{%
\expandafter\ifx\csname#2\endcsname\@empty
\expandafter\g@addto@macro\csname#2\endcsname{#1}
\else
\expandafter\g@addto@macro\csname#2\endcsname{,#1}
\fi
}
\def\tag#1{%
\expandafter\addtotag\the\c@figure\@nil{#1}
}
\def\thetags{%
%% we now print the tags or save them to a file
\section*{Image Sources}
\@for\next:=\tags\do{%
\ifx\next\@empty\else\next: See figure(s) \@nameuse{\next}\par\fi
}
}
\parindent0pt
\begin{document}
% add some tags
\addtags{NANZ,NPG,Wiki}
% test to see everything ok and list is sorted
\tags
% list of figures
\listoffigures
% example text
\chapter{foo}
\begin{figure}
\centering
\rule{1cm}{1cm}
\caption[A figure]{A longer image description}
\tag{NPG}
\end{figure}
\chapter{bar}
\begin{figure}
\centering
\rule{1cm}{1cm}
\caption[Another figure]{Another longer image description}
\tag{Wiki}
\end{figure}
\begin{figure}
\centering
\rule{1cm}{1cm}
\caption[Again Another figure]{Again Another longer image description}
\tag{NANZ}
\end{figure}
\chapter*{Images Credits}
%% prints the tags with the sections
\thetags
\end{document}
So first problem is that current code does not link to figure numbers in \thetags
listing. Secondly I would like to be able to define the tags in short form and long form. In that I mean something like \tag{NPG}{National Portrait Gallery}
so that I could tag the figures NPG but the listing would show National Portrait Gallery. Also I have used tags because I thought that was an easy way of doing this and had a example to work off but if there is an easier or better way to do it please share.
\ref
for the numbers; you'll probably be assigning each figure a label anyway. using tags, unless you're very careful and clever with tag assignments, you might have problems getting the names of the sources into the correct alphabetical order. considering the "2-level" (or even more complicated) sources, this looks rather like an indexing task.description source, clickable figure number
I have an idea.