1

I have a collection of math contest. After each question, i am writing the topics of the question like

\index {Cyclic Quadrilateral}
\index {Euler's $\phi$ function}

But makeindex refers a page number, not the problem itself. How can I achieve such an indexing.

1
  • I guess that the glossaries package is what you're looking for.
    – egreg
    Commented Jan 1, 2013 at 13:28

1 Answer 1

3

It is not clear what you want to achieve. To insert the problem number a possibility would be to create a macro (assuming that a problem counter exists)

\newcommand*{\Tindex}[1]{\index{#1 \arabic{problem}}}

A second possibility is to create an index of topics and problems. This can be done using the index package. Here is an example of how to use it (for the documentation of the package use texdoc index)

\documentclass{article}
\usepackage{index}

\newindex[theproblem]*{topics}{pdx}{pnd}{Topics in Problems Index}

\newcounter{problem}

\begin{document}
\setcounter{problem}{1}
\index[topics]{First}First
\newpage
\index[topics]{Second}Second

\setcounter{problem}{2}
\index[topics]{Third}Third
\index[topics]{First}First

\printindex[topics]
\end{document}

Then run

makeindex -o file.pnd file.pdx

where file is the name of the LaTeX source file.

2
  • Seems not. .pnd and .pdx are the suffices of the files as defined in \newindex
    – Tobi
    Commented Jan 1, 2013 at 15:25
  • @HarishKumar Tobi is right. It is not a typo. The second and third argument of \newindex are the extensions of the index files.
    – Guido
    Commented Jan 1, 2013 at 15:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .