# errors with makeindex: Conflicting entries: multiple encaps for the same page under same key

I have six errors of the same type. What must I do to get rid of them:

## Warning (input = engverxml.idx, line = 163; output = engverxml.ind, line = 786):

-- Conflicting entries: multiple encaps for the same page under same key.

the line 163 looks like this:

\indexentry{ER|hyperindexformat{\see{{estrogen receptor}}}}{xx}

• Sorry, but this is insufficient to try a diagnose. Jun 19 '15 at 21:19
• Agreed but what to provide from a 400+ page document? What does this warning mean? Jun 20 '15 at 9:34
• At least the \index command producing line 163 and a minimal version of the preamble so that \index{ER...} produces that line. Jun 20 '15 at 9:38

The warning is indicating that you have different encaps for the same entry on the same page. (The encap is the command that encapsulates the page number, without its initial backslash.) Here's an example that illustrates this:

\documentclass{article}

\usepackage{makeidx}

\makeindex

\begin{document}

Test.\index{test|textbf}\index{test|textit}

\printindex

\end{document}


Here the .idx file looks like:

\indexentry{test|textbf}{1}
\indexentry{test|textit}{1}


which is telling makeindex that you want \textbf{1} but you also want \textit{1}. This results in an index entry that looks like:

test, \textbf{1}, \textit{1}


which doesn't look right, so makeindex complains about it:

## Warning (input = test.idx, line = 2; output = test.ind, line = 3):
-- Conflicting entries: multiple encaps for the same page under same key.


However, it will still go ahead and do what you asked, so the .ind file for the above example looks like:

\begin{theindex}

\item test, \textbf{1}, \textit{1}

\end{theindex}


You will similarly get a warning if you have an entry with and without an encap on the same page:

\documentclass{article}

\usepackage{makeidx}

\makeindex

\begin{document}

Test.\index{test}\index{test|textit}

\printindex

\end{document}


In the first example, the simplest solution is to combine the two \index commands into a single command with a custom encap:

\documentclass{article}

\usepackage{makeidx}

\makeindex

\newcommand*{\textbfit}[1]{\textbf{\textit{#1}}}

\begin{document}

Test.\index{test|textbfit}

\printindex

\end{document}


In the second case, just remove the \index entry that doesn't have the encap.

This can also happen if you do something like:

\index{foo}\index{foo|seealso{bar}}


In this case, just move \index{foo|seealso{bar}} to a different page where there isn't an index to foo.