1

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}

1 Answer 1

3

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.

5
  • @ApoY2k: do not load the package hyperref. Does it help?
    – user2478
    Commented May 3, 2011 at 9:46
  • @ApoY2k: See my edited answer. It creates both the idnex and the margin notes for the index
    – user2478
    Commented May 3, 2011 at 11:47
  • @ApoY2K: we'll need a full example (one we can compile and which shows the issue).
    – Joseph Wright
    Commented May 3, 2011 at 12:04
  • @ApoY2k: you should run the example and not put the code into your document. Here is my output: archiv.dante.de/~herbert/latex6.pdf And that is what you sjould also get
    – user2478
    Commented May 3, 2011 at 12:06
  • 1
    @ApoY2k -- note that @Herbert's example places \usepackage{showidx} after \usepackage{hyperref}. order matters sometimes! Commented May 3, 2011 at 12:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .