I have a running header variable set the pick up my index numbers by character style (one for first on page, and one for last on page). It works fine throughout most of the index.
On the last page, the variable for Last instance on page fails unless I push the bottom of the text box up until the end-of-story character disappears. (before and after shown below). If it makes any difference, the character style is applied as a nested style.
I can work around this by fixing the last text box after running the index, but it seems like it should not be this way. I am wondering if there is something about my setup that is causing this, or if it's actually a bug.
Text variables can be infuriating, and it often feels like there's a bug
because something isn't showing up that should be.
However, I've found that usually it is actually working as it's supposed
to, and it's not InDesign's fault.
For instance, if you've got a running header variable based on a
character style, it's quite possible that that character style has been
applied somewhere without your realising it -- probably on some
whitespace character (could be a paragraph return, etc.)
So it may be worth doing a search for the character style that the
running header is meant to pick up to see if it's there on the page
somewhere without your realising it.
A careful seach revealed no other instances of that style.
Something odd is surely going on:
Deleting the final parapgrah return does not cause the variable to appear.
But if I push the box up to hide that end-of-story marker so that the variable will show, and THEN delete the last paragraph return, the variable will stay in place when the text box is re-expanded.