Bug 147774 - CROSS REFERENCE TO HEADING: Need option to drop the final number separator in reference text
Summary: CROSS REFERENCE TO HEADING: Need option to drop the final number separator in...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Fields-Cross-Reference
  Show dependency treegraph
 
Reported: 2022-03-04 22:37 UTC by Eyal Rozenberg
Modified: 2024-02-02 10:40 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2022-03-04 22:37:24 UTC
In documents with numbered headings, which have separators after the number, e.g.

  A. My first heading
  B. My second heading

when you want to refer to one of the headings using the "Number", the reference reads "A." rather than "A". But one does not necessarily want to include the separator in the reference! That's a stylistic choice.

Now, LO should support one of the following:

1. Have a checkbox for whether to include the separator before the first number level, and another checkbox for whether to include the separator after the last level
2. Have a checkbox for whether to include both the separator before the first number level the separator after the last level
3 Split the 'Number' reference option into "Number with first prefix and last suffix" and "Number without first prefix and last suffix" (perhaps using shorter names for these options)

I like option (1.) personally.

Note that, in MS Word, IIANM, you can definitely refer to heading numbers using just the number without the last prefix, i.e. the default is unlike in LO. And then you can add a prefix and suffix of your own, to the field, which gives you the essentially the same effect as the LO default.
Comment 1 Dieter 2022-03-20 11:33:13 UTC
I confirm the described behaviour, but I don't think it's a bug, but an enhancement request

cc: Design-Team for further input and decision
Comment 2 Heiko Tietze 2022-03-21 09:24:02 UTC
"Number" will show A., "Chapter" just A, and "Referenced Text" the heading text.

See also https://help.libreoffice.org/7.3/en-US/text/swriter/01/04090002.html
Comment 3 Eyal Rozenberg 2022-03-21 09:41:21 UTC
(In reply to Heiko Tietze from comment #2)
> "Number" will show A., "Chapter" just A, and "Referenced Text" the heading
> text.

Hmm. Weird. Shouldn't that be the other way around? I mean, let's suppose the numbering uses decimal digits and the separator is "@". "123" is a number; "123@" is not a number.

Also, there's another point. When we import an MS-Word document, cross-references to numbered paragraphs, which in the original showed the number without the separator, now show the number with the separator.

Heiko, should I open separate bugs about these two issues? Reopen this one? Something else?
Comment 4 Heiko Tietze 2022-03-21 09:57:54 UTC
(In reply to Eyal Rozenberg from comment #3)
> (In reply to Heiko Tietze from comment #2)
> > "Number" will show A., "Chapter" just A...
> Shouldn't that be the other way around?

Regina, any clarification possible from the specs? Imagine Eyal's argument is that we pick A..Z, 1..999 etc. in the Chapter Numbering dialog at "Number", and the chapter is generated by number + separator. Weak argument, IMO.

> When we import an MS-Word document,
> cross-references to numbered paragraphs, which in the original showed the
> number without the separator, now show the number with the separator.

If you think we have a compatibility or roundtrip issue please file a ticket. If it was somehow different before (the "now" sounds like this) please add the keyword regression.

If this is about terminology and MSO calls something differently please share a screenshot here.

> Reopen this one? 
Not yet. Exchanging number/chapter or renaming would be at best just effort for the l10n team but could also be confusing if users are familiar with the current terminology.
Comment 5 Eyal Rozenberg 2022-03-21 10:16:47 UTC
(In reply to Heiko Tietze from comment #4)
> Regina, any clarification possible from the specs?

I'll also add that the "other way around" is still kind of confusing. Perhaps the best would be: "full number" and "number without final separator" or something like that.

Oh, wait, actually, there's another issue... remember the discussion in 142555? If Chapter and Number are supposed to do what you've described here, does that invalidate our discussion there? And indicate that bug should be closed as INVALID?

> > When we import an MS-Word document,
> > cross-references to numbered paragraphs, which in the original showed the
> > number without the separator, now show the number with the separator.
> 
> If you think we have a compatibility or roundtrip issue please file a
> ticket. 

Ah, but here's the thing: If we've inappropriately switched up "number" with "chapter", and switch it back, then the incompatibility might go away.



> If it was somehow different before (the "now" sounds like this)
> please add the keyword regression.

I don't know that this changed recently, but TBH I haven't checked with older versions.

> 
> If this is about terminology and MSO calls something differently please
> share a screenshot here.

It doesn't really matter what it's called; the point is that a cross-ref which, reads as "123" in MS-Word, reads aws "123." when imported into LO.
Comment 6 Eyal Rozenberg 2022-03-21 11:21:04 UTC
So, I was re-reading 142555. Indeed, Number and Chapter are "laden" with two conflicting semantic distinctions:

"Number of the chapter the target is in" vs "The target's number"

and 

"A number with the final separator" vs "A number without the final separator"


That's... not good. Both distinctions are necessary.

For this reason, I'm reopening this bug for now. The "with/without final separator" applies to multiple "refer using" listbox entries, so it can't be represented using an extra entry in the listbox, but needs its own toggle.
Comment 7 Heiko Tietze 2022-03-24 13:39:17 UTC
I don't think we get a final clarification by renaming. To understand the idea behind  "full number" and "number without final separator" you need to know this discussion. Ultimately it's a piece of cake to pick the right option by trial and error. And I would make sure that the documentation does the explanation. However, not against a careful renaming. So far not much interest in this topic.

For bug 142555 I believe we have to resolve it as WF. Both chapter and number are needed.
Comment 8 Eyal Rozenberg 2022-03-24 22:41:21 UTC
(In reply to Heiko Tietze from comment #7)

First, my apologies for not being able to make the design meeting yesterday, for the agenda item regarding this issue. Try as I might, I have many things going on in my life, and that's besides my day job, so... even if I know a meeting is upcoming I can usually not make it.

Anyway, I agree that

> I don't think we get a final clarification by renaming.

But that point is moot, because the "Number" and "Chapter" entries in the refer-by dialog now have two differences. But none of the distinctions between the two are properly served by the current names. And again, that's not the point of this bug.

> To understand the
> idea behind  "full number" and "number without final separator" you need to
> know this discussion. Ultimately it's a piece of cake to pick the right
> option by trial and error.

Ah, no. It is _impossible_ to pick the right option, because once there are two semantic differences between the items, LO is only offering two of the four possible options:

* Containing header ("chapter") number, with final separator
* Containing header ("chapter") number, without final separator
* Paragraph's number, with final separator
* Paragraph's number, without final separator

> For bug 142555 I believe we have to resolve it as WF. Both chapter and
> number are needed.

And so are with and without final separator options.

But like I've already written - even that is not enough. Because the with/without final separator is necessary also for "Number (no context)" and "Number (full context)". Which is why a toggle, separate from the list box, is necessary.
Comment 9 sdc.blanco 2023-02-16 15:16:29 UTC Comment hidden (off-topic)
Comment 10 Eyal Rozenberg 2023-02-16 15:22:03 UTC
(In reply to sdc.blanco from comment #9)
> Will ask here first, can make new ticket if appropriate.

Please make that a separate ticket, this is only about the dot or other separator after the number.
Comment 11 sdc.blanco 2023-02-16 22:29:33 UTC
(In reply to Eyal Rozenberg from comment #10)
> Please make that a separate ticket, 
bug 153673
Comment 12 Stéphane Guillou (stragu) 2023-03-06 11:36:29 UTC
Eyal, wouldn't you say this is a duplicate of what is proposed in bug 149635?
Comment 13 Eyal Rozenberg 2023-03-06 14:05:19 UTC
(In reply to Stéphane Guillou (stragu) from comment #12)
> Eyal, wouldn't you say this is a duplicate of what is proposed in bug 149635?

Actually, I would say that it's the other way around, because this bug is more general about the option space: Authors _don't_ want suppression _always_ - different authors want suppression or no-suppression, possibly not even consistently over multiple references.

I'll comment on that bug as well.
Comment 14 Ulrich Windl 2024-02-02 10:09:04 UTC
(In reply to Dieter from comment #1)
> I confirm the described behaviour, but I don't think it's a bug, but an
> enhancement request

I just discovered this bug, too, and I disagree:
If you specify a "separator" (e.g. a quad space)m and you insert the "number", then the separator is clearly not part of the number!

Assuming you have used a quad space as separator for chapter numbering, then when referring to "(see section <number>)", you clearly don't want the trailing quad space being part of the link!

Otherwise it's not a "separator", but a "number suffix".

So I'd suggest to add the "number" as number only; if some insist to have the separator included, provide an other option "number with separator".
Comment 15 Ulrich Windl 2024-02-02 10:14:53 UTC
(In reply to Heiko Tietze from comment #2)
> "Number" will show A., "Chapter" just A, and "Referenced Text" the heading
> text.
> 
> See also https://help.libreoffice.org/7.3/en-US/text/swriter/01/04090002.html

I fail to see the logic behind that concept, specifically "chapter" vs. "number".
In any case it would be very helpful, if the dialog would show a preview:
Currently you'll have to insert the reference, and then, if you don't like the result, delete it again to make another try.
Comment 16 Heiko Tietze 2024-02-02 10:40:36 UTC
(In reply to Ulrich Windl from comment #15)
> ...the dialog would show a preview
Might be good for a dialog but not for the latest addition to the Navigator where drag 'n drop allows to insert cross-references quickly. A popup allows to pick one of the possible options. I believe this is a very convenient way.

The example could be something like 
"Number 'Ch.1: Text => 1'"
"Number (context) 'Ch.1: Text => Ch.1'"

but this too long and actually not easy to understand. For some functions you just have to learn how it works with a full description in the help.