Prevent blank lines from being numbered?

LibreOffice Help on Adding Line Numbers.
Don’t know in which version this function was added, but is valid at 7.1.7.2.

Yes, I manually changed from “7.2” to “latest”, so the link remains valid in time. Maybe it is inherited from OpenOffice.

1 Like

Are you suggesting that adding Line Numbers using Tools Menu and deselecting Blank Lines checkbox is the answer to this question?

1 Like

Note the difference between lines and paragraphs.

The question is about a case, when user created several paragraphs, including empty paragraphs (called “lines” incorrectly), like this:

abc¶
def¶

ghi¶

and formats them as a ordered list. The idea is to get something like

  1. abc¶
  2. def¶

  1. ghi¶

Well, there was an explanation, why this workflow may be considered flawed; that explanation ignited responses like

and

Let me provide another perspective on this. And let me start with another quote.

That’s the very important point.
Writer is built on some different principles. Lists are one place where the differences are visible, and result in some different features that Writer has, and Word hasn’t. I talk about list items.

The concept of a list item in Word is very simplistic: a list item is a single paragraph. That’s bad. It is reasonable to think, that in a text like

  1. Create an idea.¶
  2. Implement it.¶
    Do it as efficient as possible.¶
    You may ask for help of others when doing this.¶
  3. Estimate the effort.¶
  4. Report the results.¶

the item 2 of the list is the three paragraphs, not one “Implement it”. Why? E.g., because later, when I realize that my current item 2 must actually be number 3, and I want to move it down one line, I want it to happen with all three paragraphs at once. They relate to each other; they constitute one atomic item. And Writer implements the idea of “several paragraphs may constitute a single list item”, using so-called (badly named!) “unnunmbered entry”. In Word, you have to workaround the lack of the functionality, creating fake “unnumbered entries”, which still aren’t part of the list fundamentally. (I must say, that the atomic movement is not properly implemented in Writer currently: tdf#155834; but that’s a bug, and should be fixed, and is not some conceptual decision.)

And here we see another difference: the means to reorder list items. In Writer, when you are in a list, you get a toolbar with tools like Move Item Up/Down. There is no such tool in Word. Yes, Word has its own tools like “Move Up/Down” for its Outline View - but that’s not about lists; it works on outline level, and would treat non-list paragraphs the same as list paragraphs.

So in the “expected” resulting list, interrupted by a non-list paragraph, the tools would never be able to conclude, that moving the item 2 “def” up should also move the “whitespace” (the empty paragraph) together: they are completely unrelated paragraphs, even not parts of the same list, let alone of the same list item.

Let me provide another example, why would e.g. I consider what @LisaK wants (and @shantanuo considers “a very reasonable request”) bad. I open Word, and create several empty paragraphs:





I intend to make a list of them. Well, I select them, and press the “Numbering” button. I expect them to become numbered. Why? Because that’s what I want. Period.
So guess what I see instead?

ITryToMakeNumbering

You got it. Word knows better than me.

I want to say, that technically, it is very easy to change the code that applies numbering (either direct, or through styles) to filter our empty paragraphs. It really is. But the question is: why? And no, the “Because that’s what I want” doesn’t count. Any change must make the lives easier for more people, that those whose lives will become more difficult. It must be justified by reasonable considerations. E.g., given the considerations above, my expectations could be, that maybe the empty paragraphs could become the paragraphs inside the items - if they aren’t the first paragraph, in which case, it would become a normal numbered item. Or not. It deserves discussion; but I would not expect following Word’s way, with its much more simplistic concept of a list; it would be similar to requiring Writer to follow what Notepad does.

2 Likes

I was simply looking for a “Blank lines” checkbox, similar to the option found under Tools - Line Numbering. Whether this should be checked by default can be a topic of discussion. I have already prepared a lengthy list that needs to be submitted before the deadline. And I have just discovered that it is not possible to number the items due to the presence of paragraph breaks, unless one learns and uses styles. This seems like a rather clever way to enforce the use of styles! :innocent:

It is very easy to Ctrl+H Find & Replace, and use Find All for ^$ regular expression “empty paragraphs”, and with all of them selected, just remove the list…

There are always lots of ways to obtain the wanted goal. And the more you learn your tool, the better specialist you are (in your area, even if that’s not specifically “word processing”) - just because you can do your job more efficiently than your colleagues.

Thank you for the tip. However, it looks like a workaround that doesn’t work! It selects an additional line after selecting the group of empty paragraphs. For e.g. I typed “One”, “Two”, “Three” up to “Ten” on each line with three line breaks after “Five”. Ctrl + A and then F12 for an ordered list, I noticed the issue. I applied your hack. “Six” is now unnumbered! I am not more efficient than my colleagues; in fact, I feel quite the opposite.

1 Like

You are right. The selection of the (leading part of) next paragraph is not good.

of course reflecting on the general case under deadline is not the most pleasant :innocent:

I guess the use of macro should be promoted a bit more, so that the question can be pragmatically addressed.
e.g. on an inverse use case : Numbered list macro

depending on the actual deadline, probably a good dozen of people here should be able (and happy) to help and adjust 10-15 ad hoc lines of Basic to provide an decent expected result.

As a workaround:

  • Select all.
  • Set the paragraph numbering.
  • Find all $ and replace with █\n (█ or any unused character).
  • Find all ^█ and remove the paragraph numbering.
  • Find all and replace with ``.

Are you serious? Is this workaround being suggested only to me, or are you recommending it to everyone seeking an easy fix, including enterprise customers as well?

What is wrong with a workaround suggested to you by another power user, who got interested to try to solve your stated problem using existing features and in existing limitations? Are you arguing with an official documentation that (1) recommends your conceptually flawed workflow in the first place, with newlines in the middle of unnumbered text, thought to be numbered later in this way, just because some other office suite decided to implement an arbitrary exclusion of empty paragraphs, and (2) only then states that the suggested workaround is not only a workaround, but the industry-leading approach? :wink:

Just mentioning: a “customer”, including “enterprise customers”, is someone paying. Please avoid behaving like a customer here. People answer to you not because you are entitled, but because they volunteer.

On the download page, I noticed a link titled “Business users: click here.” I would like to know if the version provided through that link is the same as the one used by home users and students.

Did you click it? There is no “version provided through that link” - there are companies and individuals, who can be contracted for different services - including educating you, if you need; or helping to deploy; or fix bugs you pay for; or implement features. Yes, there are customized builds created by those professionals - but they aren’t for different functionality, but for custom branding and LTS. The changes implemented in the contracts are usually upstreamed - unless they are purely custom solutions specific to the customer. This way, paying customers not only get their problems solved, but also improve the program for everyone.

Note that you have somehow changed the topic by now. You should create an own question.

If you want to work with hierarchical lists or numbering, I recommend studying my standard file with text in deutsch:
1_LibreOffice-WRiTER_hierarchische Aufzählung 3 und Nummerierung 123_044527.ott (17.4 KB)


notice the simple way for change any layer with the tab-key and the complicated formattings to get an akzepable stile. remember the obligared numbering of any chapter in the standard invisible modus you have to activate this with numbers, signs, bullets, nothing, and so on. To create this basic file i worked several hours.

@koyotak: not bad!
However I disagree with the direct formatting switch from Numbering 123 (which is attached to List 3 paragraph style) to Nummerierung 1.a.a in the second half.

A style denotes some abstract significance which is in principle well-defined in author’s mind. In your case this is the combination List 3+Numbering 123. Applying manually Nummerierung 1.a.a over List 3 means you switch to another significance. Consequently, you should have use a different paragraph style. From a semantic point of view, a list style declares membership of the list item (paragraph) to an abstract list (different from another list style). It is then preferable to isolate this significance in an ad hoc paragraph style. This also allows better control on formatting without interference with the other significance.

I also noted a “bug” in Kapitelnummerierung where the character style for the number is Character_20_style. The presence of “_20_” betrays some previous bad handling of the style by Writer. I don’t remember the context. It happened several years ago and was fixed since then. I don’t think it is a matter of editing with M$ Word because your style dictionary would be more adversely affected. It was quite hard to correct it in documents (to illustrate this, try to change “_20_” in the name to a space which is what it stands for – you can’t: name already in use!).

@mikekaganski
no idea how the character style “Character_20_style” crept in and yes: the purple enumeration listings are definitely inconsistent and unripe and are only intended to set an uncounted enumeration - here below 1.b.ii.01. so my file is staying to improve.
my file is about 2½ years old written with LO 7-2-5-2 on MacOS.


Electrician’s rule: there is nothing that cannot be improved. Indigenous wisdom: good is good enough and does not need to be improved.

There is no problem that the absence of a decision will not eventually solve.
Henri Queuille — Wikipédia

Also: If it ain’t broke, don’t fix it.