I have observed that sometimes entries appear in the index not listed with the page number of the page where they are actually displayed, but with the page number increased by one. Apparently that is an annoyance, as it forces me to recheck all my index. I've seen it in footnotes, and solved it by taking the index command out of the footnote. I've also seen it when the word appears in the last paragraph of the page, even if quite a few lines before the end, which I could solve also by setting the marker at the end of the previous paragraph.
Are there some common mistakes leading to the described behaviour which I should avoid, or have I found a bug and should try to find out what it is?
I've tried to make a MWE, but so far failed to reproduce the behaviour.
\index{...}
precedes the term to be indexed, as\index{this term}this term
. i've seen this happen when this is input asthis term\index{this term}
for a multi-word term, but not (yet) when the opposite order is used. (i'm trying to write a "comprehensive" guide to reliable indexing. avoiding the off-by-one problem is a major component.)\index{...}
so that it gives the correct page number. so if the term is a full name, e.g.Albert Einstein
, a person looking in the index will look for "Einstein" -- then put\index
after the name. if they'd look for the first word of the phrase, e.g. "probability theory", put it before.