Bug 158119 - Alphabetical index: "Combine with -" only works for more than two pages
Summary: Alphabetical index: "Combine with -" only works for more than two pages
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: TableofContents-Indexes
  Show dependency treegraph
 
Reported: 2023-11-08 16:08 UTC by R. Green
Modified: 2025-03-25 08:17 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
sample document (165.52 KB, application/vnd.oasis.opendocument.text)
2023-11-26 12:55 UTC, Dieter
Details
Example index including both possibilities (38.61 KB, image/png)
2025-02-05 14:58 UTC, Andreas Heinisch
Details
Current dialog (73.35 KB, image/png)
2025-02-10 09:30 UTC, Heiko Tietze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description R. Green 2023-11-08 16:08:22 UTC
Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 2; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Calc: threaded

Currently index page numbers do not combine if there are only two adjacent ones, but are listed separately – even if you check the "Combine with –" entry in the Edit Index dialog.

So for example, you get entries such as "117, 118" or "15, 16" rather than "117–18", or "15–16".

So could there be an additional option to allow combining of adjacent page numbers in index entries?
Comment 1 R. Green 2023-11-09 10:17:49 UTC
See also, Bug 158127.
Comment 2 Dieter 2023-11-26 12:54:29 UTC
I confirm it with

Version: 7.6.3.2 (X86_64) / LibreOffice Community
Build ID: 29d686fea9f6705b262d369fede658f824154cc0
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL threaded

It works for an index entry 3-5, but it fails for an index entry 3-4

Steps:
1. Open attached file. It has two index entries.

Actual result
First index entry shows pages 3-5, second entry pages 3;4

Expected result
Second index entry should display pages 3-4

2. Got to page 3
3. Press enter before last (yellow) paragraph, so that it moves to page 4 (and same sentence from page 4 to page 5)
4. update index

Actual and expected result
Second index entry displays 3-5
Comment 3 Dieter 2023-11-26 12:55:27 UTC
Created attachment 191042 [details]
sample document
Comment 4 Andreas Heinisch 2025-02-04 12:16:26 UTC
Thats the intended behaviour in the entry generator [1] implemented more than 25 years ago. We can easily change this behaviour to reflect your whishes. I don't know enough about indices if this is should always be the case. @Heiko what do you think?

[1] https://opengrok.libreoffice.org/xref/core/sw/source/core/doc/doctxm.cxx?r=7489c032a33b6a14b20d389b6a10f5daeb853e95#1983
Comment 5 Heiko Tietze 2025-02-04 12:33:23 UTC
To my knowledge you must not combine two pages with a hyphen like 1-2. It has to be a comma separated list. Can you proof the necessity for this? I mean a link to the used citation standard like APA or CMOS.

The (In reply to R. Green from comment #0)
> So could there be an additional option to allow combining of adjacent page
> numbers in index entries?
The option exists (in a weird mutual exclusive selection with f/ff).
Comment 6 R. Green 2025-02-05 14:17:17 UTC
Read section 18.13 of https://press.uchicago.edu/Misc/Chicago/CHIIndexingComplete.pdf for details. Note that all the examples given of index entries on consecutive pages involve the use of dashes – as requested in the OP.
Comment 7 Andreas Heinisch 2025-02-05 14:58:55 UTC
Created attachment 198997 [details]
Example index including both possibilities

There are many examples where both of the possibilities are present, or am I missinterpreting something wrong?
Comment 8 Heiko Tietze 2025-02-10 09:30:38 UTC
Created attachment 199101 [details]
Current dialog

Version: 24.8.4.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 32; OS: Linux 6.13; UI render: default; VCL: kf6 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
24.8.4-2
Calc: threaded
Comment 9 Heiko Tietze 2025-02-10 09:40:21 UTC
How about using radio buttons instead of the implemented anti-pattern with an additional item and examples?

Options
(o) Do not combine entries (1,2,3,10,11,12)
( ) Combine all items (1-2; 10-12)
( ) Combine multiple indices (1,2; 10-12)
( ) Indicate by follow-ups (1f; 10ff.)

[ ] Case sensitive


I think "combine entries" has room for improvement. "Inclusive numbers" might be better but I struggle to find catchy labels. Ideas?
Comment 10 Heiko Tietze 2025-02-10 09:41:35 UTC
(In reply to Heiko Tietze from comment #9)
> (1-2; 10-12) 
=> (1-2, 10-12) according CMOS
> (1,2; 10-12)
=> semicolon only in this case
Comment 11 Heiko Tietze 2025-03-25 08:17:05 UTC
No further input let's go with comment 9.