A unique number may be added to any kind of “object” or text. However, there is no way to alter the page number information in the index table to format it as “page-id” (with id equal to the unique number). This defeats the “merging” behaviour of an index. The closest which can be done is to include the unique number in the index key but this will give:
indexed term (5) …………10
indexed term (7) …………12
other term (3) …………………8
indexed term ………10-5, 12-7
other term ………………………………8-3
The index entry may need special care depending on how you want to display and format the unique number. In particular, this could require cross-references to copy the unique value without incrementing it.
Unique numbering: this is done through a number range. Writer provides already 5 number ranges: Drawing, Figure, Illustration, Table and Text related to auto-captioning. See
Variables tab. You can define others for your special needs so that there is no interference with the built-in usages.
Edit your question to provide an example of the formatting of the “line” to be indexed so that I can give you implementation suggestions.
EDIT 1 Use of margin reference numbers
This is contorted and tricky approximation to the goal. See this revised sample file
I define a new number range “Authority” to number the indexed references. However when a number range occurrence is attached to a paragraph, only the first one (in this paragraph) can be cross-referenced. Consequently where there are several index entries in the same paragraph, the reference number must be attached somewhere else. I chose frames in the margin.
Creation of reference number
For ease of formatting, create a new frame style Ref with the following properties:
Type tab: Width 1 cm, Height 0.5cm AutoSize; Position horizontal
From left -0.1cm to
Right paragraph border; leave vertical **Spacingas is because anyway you can’t set it adequately here
Wrap, reduce Spacing top and bottom to 0.1cm or less and untick Allow overlap
At the beginning of the index entry,
Frame anchored To character. This anchoring mode is very important because you have several “references” in paragraphs.
Quit the frame and style it Ref by double-clicking on the style name.
Right-click on the frame and
Type, check the horizontal position is
From left -0.1cm to
Right paragraph border otherwise fix it. Set vertical position to
The reason why the horizontal position can’t be set in the style frame is the style does not record the anchoring mode. Thus this requires to adjust manually every frame.
Put the cursor inside the frame.
- The first time, select Number range in Type, enter Authority in the Name box and push
- Afterwards, Number range should already be selected, click on Authority and press
The reference number is now in the margin
Entering the reference number in the index entry
As you need the number in the index, it must be somehow added to the index entry. This is done with a cross-reference so that addition, deletion or move of entries automatically update the counter.
At the end of an index entry, add a “prefix of your taste” (in the sample I used “<space>#” and
Cross-references tab. In Type, select Authority, in Insert reference to Numbering and choose the right number in Selection. Press
IMPORTANT: make sure this cross-reference is part of the index entry (it should have a gray background like the rest of the entry).
You must now ensure that this added “technical” number does not print. Create a new character style Hidden. Its only property is in
Character Effects where you tick Hidden. Select the “prefix” and cross-reference, apply style Hidden.
You can check with print preview that the “technical” number does not print.
Update the alphabetical index to see the reference.
In the sample, the reference number frames are widely spaced apart. This was before I reduced the spacing in the wrap tab. It was caused by the automatic positioning due to “no overlap”. Unfortunately, it appears changed in frame styles do not propagate well back to the frames.
I left your original index in the sample so that you can see the difference. I must admit that the reference number does not stand out in the index. You’ll have to imagine a “good” prefix.
This is the closest I can do.
I highly recommend you use customised styles in your document (the sample was single-styled with Default Paragraph Style which is faulty). Also don’t vertically space with empty paragraph. Vertical spacing should be part of the paragraph style.
I also highly recommend you work with
Formatting Marks enabled and the options to see hidden text otherwise you’ll quickly get lost. Remember this is only for screen and does not change what is printed or PDF’ed.
To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!
In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.