如何在书的末尾创建如下列表:
[页码][作者姓名]
期望输出:
照片来源
[1,3] 作者 1,[2] 作者 2
相关问题:
LaTeX 格式的照片来源 图片来源发布在图片环境中,打印在图片来源列表中
以下尝试失败:
\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}