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

  • @ApoY2k: do not load the package hyperref. Does it help? – user2478 May 3 '11 at 9:46
  • @ApoY2k: See my edited answer. It creates both the idnex and the margin notes for the index – user2478 May 3 '11 at 11:47
  • @ApoY2K: we'll need a full example (one we can compile and which shows the issue). – Joseph Wright May 3 '11 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 May 3 '11 at 12:06
  • 1
    @ApoY2k -- note that @Herbert's example places \usepackage{showidx} after \usepackage{hyperref}. order matters sometimes! – barbara beeton May 3 '11 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.