Hey Community
I'll be working on a massively cross-linked document soon an I wonder if you know a way to list where a label or a group of labels is referenced.
(E.g. a passage in chapter 3.1 is referenced to in chapters 5.1.1, 5.2 and 6.4, then I would like a nice way to list those chapters and their titles at the end of 3.1.
Optimally I'd have ONE list for ALL labels contained in 3.1, but this is optional)
Any idea on how to accomplish this or do you know a package that does that?
Please tell me also if you understand what I want to do or if you need more than that rather vague sketch of an idea that I gave you.
Thanks!
Wolfram
General ⇒ Listing Refs for a Lable
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Listing Refs for a Lable
Hi Wolfram,
welcome to the forum!
You could make index entries for each reference. Here I made a sample document showing what I mean.
You can see the chapter and section numbers for each reference, grouped by reference number, and the page where the
I loaded the
Stefan
welcome to the forum!
You could make index entries for each reference. Here I made a sample document showing what I mean.
Code: Select all
\documentclass[12pt]{book}
\usepackage{amsthm}
\usepackage{showkeys}
\usepackage{imakeidx}
\usepackage[colorlinks]{hyperref}
\makeindex
\makeindex[name=refs,title=References,columns=1]
\let\origref\ref
\begin{document}
\renewcommand{\ref}[1]{%
\origref{#1}%
\index[refs]{\getrefnumber{#1}!Section \thesection}
}
\chapter{First}
A section follows.
\section{One}
\label{sec:one}
See \ref{sec:two} and \ref{eq:sample}.
\section{Another}
\label{sec:two}
See \ref{sec:one} and \ref{sec:more}.
\chapter{Second}
The second chapter.
\section{Equations}
\begin{equation}
\label{eq:sample}
\end{equation}
\section{More}
\label{sec:more}
See again \ref{sec:one}.
\printindex[refs]
\end{document}
\ref
has been placed (in red).I loaded the
showkeys
package in addition to show the labels in the document body.Stefan
LaTeX.org admin