[Tex/LaTex] Occasionally wrong page numbers for index entries

indexing

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.

Best Answer

based on the discussion in the comments, the following suggestion will not solve all problems, but it should get rid of some of them.

if a term to be indexed falls near the end of a page, it is generally a good idea to place the \index entry before the text string, especially if the term contains more than one word, or might be hyphenated.

in the case of a multi-word term, consider what a person looking in the index will be looking for on the referenced page. if the term is a 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.

i have compiled a document addressing various problems that arise in indexing; it has been posted on the ams web server. (this document is still a work in progress, but is far enough along to be useful. the incomplete portions are marked as such. comments are welcome; the address is included in the introduction.)

the "off by one" problem is encountered quite frequently, and is addressed in my "manual" in greater detail than described above.