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.

When I use makeindex and try to index a word using

Hello \index{World}

the entry in the generated \printindex looks like

indexfile, 7

instead of

World, 7

-- This issue also happens when using World\index{World}.

The error seems to be somewhere before creating the .idx, as it looks like this

doc.idx

\indexentry{\@indexfile |hyperpage}{7}

doc.ind

\begin{theindex}

  \item indexfile , \hyperpage{7}

\end{theindex}

Used packages

\usepackage{geometry}
\usepackage{ngerman}
\usepackage[latin1]{inputenc}
\usepackage{fancyhdr}
\usepackage{makeidx}
\usepackage{showidx}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{setspace}
\usepackage{listings}
\usepackage{color}
\usepackage{hyperref}
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

That is not possible as could be seen in this example:

\documentclass[ngerman]{article}
\usepackage{geometry}
\usepackage{babel}
\usepackage[latin1]{inputenc}
\usepackage{fancyhdr}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{setspace}
\usepackage{listings}
\usepackage{color}
\usepackage{hyperref}
\usepackage{showidx}
\makeindex
\newcommand\Index[1]{#1\index{#1}}
\begin{document}

This is my \Index{world} and my \Index{World}.

\printindex
\end{document}

it creates a correct index:

enter image description here

I run pdflatex->makeindex->pdflatex. You have to create a complete example which shows your behaviour.

share|improve this answer
    
Well... this example works fine. Is there probably an issue with some packages I'm using? That they somehow mess up the index? –  Florian Peschka May 3 '11 at 9:19
    
@ApoY2k: do not load the package hyperref. Does it help? –  Herbert May 3 '11 at 9:46
    
No, that wasn't it. I have tried nearly all packages and it turns out, that \usepackage{showidx} caused the problem. Without it, the index is created correctly. Having it loaded, the problem occurs. –  Florian Peschka May 3 '11 at 11:03
    
@ApoY2k: See my edited answer. It creates both the idnex and the margin notes for the index –  Herbert May 3 '11 at 11:47
1  
@ApoY2k -- note that @Herbert's example places \usepackage{showidx} after \usepackage{hyperref}. order matters sometimes! –  barbara beeton May 3 '11 at 12:17
show 4 more comments

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.