General ⇒ Listing Refs for a Lable
-
- Posts: 1
- Joined: Thu Dec 17, 2015 3:06 pm
Listing Refs for a Lable
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- Stefan Kottwitz
- Site Admin
- Posts: 10361
- Joined: Mon Mar 10, 2008 9:44 pm
Listing Refs for a Lable
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