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 want to have an index entry typeset as $a_\text{T}$, so I issue the command \index{at@$a_\text{T}$}. Each use of this index command creates a separate line in the index. How can I get \makeindex to recognize they all reference the same topic?

My index entries look like this:

enter image description here

share|improve this question
2  
Can you show an example? –  egreg May 10 at 15:14
1  
I think what @egreg meant was can you provide a minimal working example (MWE)? –  Nicola Talbot May 10 at 15:23
2  
For solvers: +\usepackage{amsmath} –  Malipivo May 10 at 15:29
2  
@GregH We need some code that shows the problem: I trust you when you say you get duplicate entries, but I can't know how you input them. –  egreg May 10 at 15:34
1  
Having answered I remembered having answered before, this is probably a duplicate of tex.stackexchange.com/a/105713/1090 assuming it is the same issue. –  David Carlisle May 10 at 15:59

1 Answer 1

up vote 7 down vote accepted

Hard to say as you provided no example but I'd guess you have done this:

enter image description here

\documentclass{article}

\usepackage{amsmath}
\usepackage{makeidx}
\makeindex
\begin{document}

zz\index{at@$a_\mathrm{T}$}

zz\mbox{zz\index{at@$a_\mathrm{T}$}}

\printindex

\end{document}

One argument is read verbatim and the other not, resulting in an idx file like

\indexentry{at@$a_\mathrm{T}$}{1}
\indexentry{at@$a_\mathrm  {T}$}{1}

with different entries. The easiest solution is to wrap both in the same command. If you put \mbox (or anything) around the first \index then the index entries are merged.

share|improve this answer

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.