# Duplicate typeset index entries

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:

-
Can you show an example? – egreg May 10 '14 at 15:14
I think what @egreg meant was can you provide a minimal working example (MWE)? – Nicola Talbot May 10 '14 at 15:23
For solvers: +\usepackage{amsmath} – Malipivo May 10 '14 at 15:29
@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 '14 at 15:34
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 '14 at 15:59

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

\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.

-