Custom numbers for index

I need to make an index above formatted text of a law. However I dont need to reffer to page number but to the number of section (which is not allways sequential, because there could be holes and it could contain letters (e.g. § 15az).

Therefore, if i had § 123x on page 15 which contains definition of the attorney, I want that "attorney 123x" would appear in the index instead of "attorney 15".

Thanks

• you talk of an index, but only mention references. are you thinking of a label-reference scheme? or do you want lists of attorneys (or whatever) in a separately compiled (latex-style) index? – wasteofspace Oct 10 '13 at 10:29
• I have a text, for example: 11 USC: § 109 (a) Notwithstanding any other provision of this section, only a person that resides or has a domicile, a place of business, or property in the United States, or a municipality, may be a debtor\index{debtor} under this title. (and many more) I want to create index where i dont care about page numbers, but i care about the section numbers. In this case I want that number 109 will appear in the index for the word "debtor", not the page number. – Michal Tuláček Oct 10 '13 at 13:29
• So, i want index, i want to use "makeindex" or something like that to create a list of terms used in the statute, but page numbers are insignificant (the section number is relevant) – Michal Tuláček Oct 10 '13 at 13:34

1 Answer

Here's a possible solution that uses the glossaries package:

\documentclass{article}

\usepackage{lipsum}

\usepackage[counter=section,toc]{glossaries}
\usepackage{glossary-mcols}

\newglossaryentry{debtor}{name=debtor,description={\nopostdesc}}

\makeglossaries

\begin{document}
\tableofcontents

\section{A Sample Section}

Notwithstanding any other provision of this section, only a person
that resides or has a domicile, a place of business, or property in
the United States, or a municipality, may be a \gls{debtor} etc.

\section{Another Sample Section}

Some text to pad out this test document. \lipsum[1-5]

\section{And Again}

Some text again mentioning a \gls{debtor}.

\printglossary[title=Index,style=mcolindex]

\end{document}


This requires: pdflatex, makeglossaries, pdflatex, pdflatex.

The index looks like:

where the numbers are the section numbers where \gls{debtor} was used.