Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
I guess that the glossaries package is what you're looking for. –  egreg Jan 1 '13 at 13:28
add comment

1 Answer

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.

share|improve this answer
    
Seems not. .pnd and .pdx are the suffices of the files as defined in \newindex –  Tobi Jan 1 '13 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 Jan 1 '13 at 15:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.