Page numbers in Alphabetical Index

I’ve created a document that has numerous chapters, each of which I may add to from time to time. I don’t always print an updated TOC or Index. So the page numbers are formatted to show chapter number followed by page number within that chapter. eg 5-3 means the third page in chapter 5. I can then add pages in that chapter without upsetting the numbering. But when I create an index it only shows the second part of that number (eg 3), not the chapter number. So it doesn’t help in finding the item referred to. Is there any way I can add the chapter number to the entry in the index?
Thanks for any help.

Please upload your ODF type sample file here. I suppose it, that you use the page numbering in some irregular way…

When you create you index (or right-click Edit index), modify the Structure line in Entries tab:

  • put the cursor in the text box before #
  • press Chapter info button
  • in the text box between CI and # type a hyphen

Your structure line should now read

 E   T   CI-#

Make other adjustments to fit your needs.

EDIT 2021-10-15

The suggestion with CI works only for the first entry.

From experiment, it looks like the alphabetical engine stops parsing the structure line as soon as it as emitted the page number (#). If the key has several references, the engine restarts from the # field to the end of the structure line. BUT, if any CI is met again, it inserts the value for the first key, which is wrong.

Conclusion: it is impossible to have the chapter number in an alphabetical index.

That’s very helpful, thanks. But it doesn’t quite solve my problem. I now have ECl<->#
Should I have a spot that actually contains a T?
What appears in the document is a hyphen before the first page number, only (I have all entries for a particular work on the line, separated by commas), not the other entries. And no chapter number before the hyphen. And the alphabetical delimiter also has a hyphen after it.
I’ve decided to attach a couple of printscreens, to show what I mean.

Screenshots.odt (403.2 KB)

That structure works for me. You have to turn on chapter numbers in Tools - Chapter Numbering instead of adding the numbers manually.
Time to upload a sample file so we can see what you are doing. That really helps.

If the separators have an hyphen, check level S. You likely have added a hyphen there too.

When numbering is by chapter, if an index entry appears in multiple chapters, it may be wrong in the index, this error is an open bug number 60616. Until it gets fixed, the following, while not great, may be of help:

LO Writer treats word entries as different if they have a different number of spaces after the index word. Corn with no space after the last n is different from Corn with one space after the last n, is different from Corn with two spaces after the last n. When formatting the entries of an index, trailing spaces are apparently truncated but - only when it’s time to format the lines of the index.

Using this, a convention of adding one space after index entries in chapter one and, two spaces after index entries in chapter two - or, perhaps only using this technique for those instances where something to be indexed appears in multiple chapters.

It does make for an index that will appear to show the same word multiple times in an index if, that indexed work appears in multiple chapters but - that’s better than having an incorrect entry (pointing to the wrong page) in the index.