0

How do I create a list at the end of a book that looks like this:

[page number][author's name]

Desired output:

Photo credit

[1,3] Author 1, [2] Author 2

Related questions:

Photograph credits in LaTeX Figure credit posted inside figure environment, printed in listoffigurecredits

Failed attempt below:

\documentclass{scrbook}
\usepackage{tocloft}
\usepackage{graphicx}
\usepackage{caption}

\newcommand{\listexamplename}{Photo Credit} \newlistof{example}{exp}{\listexamplename} \newcommand{\credit}[1]{% \refstepcounter{example} %\par\noindent\textbf{Example \theexample. #1} \addcontentsline{exp}{example} {\protect\numberline{\thechapter.\theexample}#1}}

\begin{document}

\listofexample

\begin{figure}[ht] \centering \includegraphics{example-image-a} \caption{Picture 1} \credit{Author 1} \label{fig:pic1} \end{figure}

\newpage

\begin{figure}[ht] \centering \includegraphics{example-image-b} \caption{Picture 2} \credit{Author 2} \label{fig:pic2} \end{figure} \newpage

\begin{figure}[ht] \centering \includegraphics{example-image-c} \caption{Picture 3} \credit{Author 1} \label{fig:pic3} \end{figure}

\section{Photo credits} (Desired output, created by hand. The page number is in square brackets. The author's data are taken from "credit" field ):

[1,3] Author 1, [2] Author 2.

\end{document}

ReRunner
  • 471

0 Answers0