LaTeX forum ⇒ MakeIndex, Nomenclature, Glossaries and Acronyms ⇒ Indexing with Reference to Section and Subsection

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
misterbenn
Posts: 3
Joined: Fri Jul 29, 2011 7:48 am

Indexing with Reference to Section and Subsection

Hello,

I'm having some probblems with indexing and i hope you can help. I have a list of technical presentations (100s of them) seperated in numbered sections (the conference) and numbered subsections(the presentation name).

To help me navigate this i want to build an index of topics, but with the index refering to the section.subsection number not the page number.

so far i have this:
\newcommand{\sec}[1]{\alpha{section}.\alpha{subsection}}

and to create the index
\section{Conference}
\subsection{Topic}
\index{topic|sec}

However i've discovered that this sets all the section.subsection refrences to the last section.subsection - I think this is because the
\alpha{section}.\alpha{subsection}}
is only evaluated at the command \printindex which is at the end of the document.
can anyone suggest a solution to this? Maybe i could use \label and \ref commands to give dedicated section refrences??

LaTeXguide.org • LaTeX-Cookbook.net

misterbenn
Posts: 3
Joined: Fri Jul 29, 2011 7:48 am

Indexing with Reference to Section and Subsection

so i've found a solution i'm happy with.

\makeindex
\newcommand{\ind}[2]{\index{#1|inds{\ref{#2}}}}
\newcommand{\inds}[2]{#1}

and i add to my index in the document using
\section{a thing}
\subsection{a thing of the first thing}\label{sub:thing}
\ind{things}{sub:thing}

So i'm create a label for each of my subsections. I then pass to my command (ind) the index entry name and the label refence. to give me
\index{things|\inds{\ref{sub:thing}}}

The inds command is just removing my page number for me.
so the output looks like
things, 1.1

misterbenn
Posts: 3
Joined: Fri Jul 29, 2011 7:48 am

Re: Indexing with Reference to Section and Subsection

The above solution has worked fine ...however
Label only stores values upto 9, and i am now on 13 subsections so i need to fine a way to expand the lable functionality or else find a different way of doing this.