0

I'd like to add a section in my document that provides context on multiple figures of the main text at once. It would be very desirable to recreate something like Wikipedia's What links here feature, to see what figures the section is talking about.

Some possible approaches:

  • hyperref has the backref and pagebackref options (pp. 10, 33–35 of the package manual), which seem to provide this exact functionality, but for bibliography items only. One could perhaps combine the relevant \ref{} commands with the \cite{} command, then create and display a single bibliography entry at each appendix section (related question), and make everything but the backref list of said entry invisible. Sounds horrible.

  • I suppose that one could also create dozens of different indices (related question), each with only one entry, but that seems rather inconvenient, and, I could imagine, might slow down compilation. Sounds horrible, too.

  • Do some wizardy way beyond my grasp. Sounds... bewitching.

Ideally, the solution would work regardless of whether we're using figures/sections/listings/etc. in the main text or in the appendix, and allow for some amount of customization (e.g. choosing whether to list page numbers or figure numbers).

Minimal non-working example:

\documentclass{article}
\usepackage[colorlinks]{hyperref}

\begin{document}

\begin{figure}
\caption{for more info, see \ref{appendix:some-entry}}\label{fig:1} 
\end{figure}

\begin{figure}
\caption{for more info, see \ref{appendix:some-entry}}\label{fig:2} 
\end{figure}

\subsection{Some Appendix Entry}\label{appendix:some-entry}

What links here: Figures \ref{fig:1} and \ref{fig:2}. % How can I automate this?

\end{document}

Edit: Tried to read the backref.dtx file of the hyperref bundle on GitHub to see if I could use (or slightly modify) its functionality, but I just got confused (tried to use \backcite{}{{}{}{}} in combination with \backrefparscanfalse and then \backrefprint manually, but to no avail (\@xdblarg error, and probably plenty more hidden from sight). If someone from the LaTeX3 Project, or perhaps even the creator of the backref module, David Carlisle, could help out, it would be much appreciated. Thank you!

steve
  • 2,154
  • What's wrong with \listoffigures ? – Fran Apr 15 '20 at 23:29
  • @Fran 1. It lists all figures, not just a selected few, 2. the formatting (the desired result is a list as in the MWE), 3. defining multiple \listoffigures (if that's even possible) to deal with 1 is probably just as tedious as the first two approaches considered above. – steve Apr 15 '20 at 23:45

0 Answers0