Bug 149372 - Paragraph numbering similar to line numbering
Summary: Paragraph numbering similar to line numbering
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 157751 (view as bug list)
Depends on:
Blocks: Word-Count
  Show dependency treegraph
 
Reported: 2022-05-30 08:15 UTC by David Burleigh
Modified: 2023-10-16 15:16 UTC (History)
5 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 David Burleigh 2022-05-30 08:15:40 UTC
I need a way to number paragraphs in a way similar to how line numbering works, with a small sequence number in the margin that is not hierarchical and would not affect the paragraph styles. The number would not have punctuation after it as the hierarchical numbering has (e.g., "1)" or "1."), but would simply be the sequence number of a paragraph within the document. 

The purpose of this is to identify the paragraph, for example, during a meeting, when many people are discussing the same document, but may have copies that are paginated differently, so you cannot just say, "page 6, paragraph 2" since that could be different according to the page format used by the different participants.
Comment 1 Mike Kaganski 2022-05-30 08:26:51 UTC
Paragraphs may be numbered using usual numbering feature. Indeed, that is not "not hierarchical" and does not meet the "would not affect the paragraph styles", but OTOH, the scenario that you describe seems to also be reasonably solved by line numbering feature - just say "paragraph starting on line X".

Or does different pagination mean also different page width, meaning lines are also layed out differently?
Comment 2 David Burleigh 2022-05-30 08:32:31 UTC
Yes, some may have the document printed on A4 page size, some on Letter, and some in a half-letter booklet, etc. This is for international meetings of a worldwide organization.

And the paragraph numbering can't interfere with the use of ordered lists in the document.
Comment 3 Mike Kaganski 2022-05-30 08:53:46 UTC
I would assume that technically, there should not be significant problem in implementing the *mutually exclusive* line/paragraph numbering like that (the mutual exclusive would mean that we don't need to find out how to combine the two on page).

Interesting how would it interfere with ODF.
Comment 4 Heiko Tietze 2022-05-31 09:46:41 UTC
Kind of FAQ with a good answer at https://ask.libreoffice.org/t/how-do-i-auto-number-paragraphs/44290.

ODF defined text:line-number but no paragraph-number. Don't understand why you cannot use the ordinary list and refer to a paragraph with chapter a) and paragraph b).
Comment 5 Mike Kaganski 2022-05-31 10:00:40 UTC
(In reply to Heiko Tietze from comment #4)
> Don't understand why you cannot use the ordinary list

Possibly because using ordinary list on all paragraphs for the referencing would require to destroy existing normal lists and chapter numbering in the document?
Comment 6 Heiko Tietze 2022-05-31 10:21:50 UTC
Word count annotation request in bug 145596 was recently rejected with the recommendation to realize per macro and some code pointer. Maybe the same here.
Comment 7 David Burleigh 2022-05-31 10:55:43 UTC
(In reply to Mike Kaganski from comment #5)
> (In reply to Heiko Tietze from comment #4)
> > Don't understand why you cannot use the ordinary list
> 
> Possibly because using ordinary list on all paragraphs for the referencing
> would require to destroy existing normal lists and chapter numbering in the
> document?

Right. What I am looking for is very simple: a way to turn on paragraph numbering with small numbers in the margin that are independent of the paragraph styles -- just sequential numbering, regardless of paragraph style.
Comment 8 Heiko Tietze 2022-06-02 13:43:34 UTC
The alternative solution to this request and the number of words from bug 145596 could be also solved with an improved Word Count dialog. Which means to make this a duplicate of bug 123083. But I'll keep the ticket for in case of further input.
Comment 9 David Burleigh 2022-06-02 14:22:34 UTC
I don't understand how the word-count issue relates to my request, but if the developers do, that's fine.
Comment 10 Heiko Tietze 2022-06-02 15:59:45 UTC
(In reply to David Burleigh from comment #9)
> I don't understand how the word-count issue relates to my request...

The word count feature could be enhanced and give a more detailed statistics with characters/words/lines/paragraphs/chapters... before/after the cursor and in total. I hesitate to bend the line numbering feature for a dubious paragraph count ("dubious" since you maybe solve a different task than showing the number).
Comment 11 David Burleigh 2022-06-02 16:03:33 UTC
But I'm not interested in printing the total number of paragraphs, but just automatically printing the sequence number of each paragraph in the margin to the left of where the paragraph begins.
Comment 12 m_a_riosv 2023-10-14 11:01:24 UTC
*** Bug 157751 has been marked as a duplicate of this bug. ***
Comment 13 Mike Kaganski 2023-10-14 11:28:02 UTC
Regarding the ODF, the element that defined the properties of line numbering is linenumbering-configuration (ODF 1.3 16.31.1). I believe that it would be reasonable to not introduce a new element in addition, but to create a new attribute for that element, which would define that not lines are counted, but paragraphs. That would automatically avoid a situation when a file has both line numbering and paragraph numbering. IMO, it makes no sense to allow them both at the same time.

In the code, SwLineNumberInfo is the central class handling this. Possibly a candidate for an interesting easyhack.
Comment 14 David Burleigh 2023-10-16 15:16:35 UTC
That sounds wise and hopeful!