How to hide list numbers but keep the numbering information? Why can't I do it using styles?

I was trying to copy the chapter heading formatting of a book and found a problem I can’t seem to solve.
Basically, I would like to have the option of hiding the numbers and separators in the numbered list, yet keep the list “secretly” numbered, that is, hide the number in a way that I can still use the number information (so it would still be possible, for example, to create cross references showing the number).

I tried creating a hidden character style that the list would use, but the list simply ignores the ‘hidden’ option being turned on and shows the number anyway. The custom style hides any characters when applied to them, except list bullets/numbers. Is this a bug or expected behavior? I’m on version 7.6 now.

Can this be solved by a Macro?

Is your goal consistent? You hide the numbering and still want to mention it in cross-references. How would a reader understand the reference to be able to “jump” to it?

You seem to mix two features: chapter/heading numbering and list numbering. Though the underlying engine is the same, if you overload a list style on headings controlled by Tools>Heading Numbering, you create a conflict resulting in an unmanageable mess.

Maybe it is better if I just show what my goal was and explain the rationale for my choices. Here is a perfect copy I managed to do via direct formatting and use of fields (variables and number ranges).

The problem is doing it fully automated (so every chapter looks the same) and without any manual formatting.

In the upper-right corner, notice the chapter number 24 is bold and has normal spacing while the word “chapter” before it is uppercase and has extra spacing. I could do this with two character styles, no problem.

The part between the lines is the name of the chapter. It is a paragraph with borders going from margin to margin. Again, no problem creating a style for it. (I could also use a table but whatever…)

Problems arise when trying to unify these things. I do not know if it is possible to do this in Writer.

I think this structure requires the number and what comes before it on one paragraph and the heading content in another, for a few reasons:
1. I need the horizontal lines before and after the title going from margin to margin.
2. I want to control the space between “C H A P T E R 24” and “Vivamus nec…”
3. In a list, the character style applied to the number/bullet is also applied to what comes before/after. By putting them on a separate paragraph I can apply styles separately.

My idea for a solution was to create a hidden character style to be used by the numbering list, which in turn would be associated to a custom heading style. By doing this I would still be able to use the number information in fields (for the lower level headings like the “Example 24.1” and captions) and in a table of contents (by selecting a normal character style for the chapter number in the TOC dialog). The only thing left to do would be to put the number 24 in “CHAPTER 24” through a reference, or bookmark or whatever to the heading with the hidden number, that is, to the paragraph right below it.

But since the hidden style does not hide the characters, I am stuck. I could try not numbering the headings and do everything using number ranges, but I would need to insert them manually for every chapter and reset the captions and smaller headings count for each chapter. I also lose the number for the TOC.

So… any ideas on how to do this in Writer?

Regarding Heading Numbering x List Numbering, I do not use Heading Numbering. At all. After learning list styles I see no point in using the tool. Multiple paragraph styles can share one list style, but Heading Numbering can only take one paragraph style.

A possible direction could be:

  1. The first paragraph (“CHAPTER 24”) would actually contain the hidden actual heading of the chapter;
  2. The second paragraph would contain the cross-reference to it.

But there are problems.
Using hidden attribute on paragraph style’s text makes the paragraph hidden as a whole (even if the numbering would use an explicitly non-hidden character style).
Making it (almost) transparent works; but this requires to use “new line” in chapter/heading numbering, to allow normal right-alignment. Also, the actual font size of the heading would need to be small (e.g., 2pt) to make the second line size not distort the overall layout. Of course, the numbering must use an explicitly non-transparent and large-size font.
And of course, there is still a problem of controlling inter-character spacing in the numbering, where only one character style is used.

The closest I can achieve is AskLOSeparateNumberHeading.odt (12.0 KB)

image

This is a single paragraph, so that there is no need for any trick to hide numbering and show it through cross-reference. Additionally, since this is a single paragraph there is no adverse effect on header capture (if you want to automatically echo the chapter heading in the header).

However, this is particularly ugly.

Features used:

  • number followed by New Line
  • number styled Numbering Symbols with Font Effects (casing) and Font (if character size different from Heading 1), font wieght forced to Regular
    Optionally, add a white bottom border so that bottom padding allows you to control distance between number and heading
  • Heading 1 reset to Regular weight (because I could not force Regular weight in Numbering Symbols
  • new Chapter character style applied to heading to restore bold weight and add top and bottom borders (distance controlled by padding)

What is difficult in your layout is right alignment for number and left alignment for heading. This is imperfectly handled by tweaking Tools>Heading Numbering, Position tab where Alignment is set to Right and Aligned at is tuned so that number is correctly positioned. Curiosly, this distance is slightly smaller than the width of the paragraph between indents. Unfortunately, the heading will start below the number. This is corrected by inserting an extra new line (which adds vertical spacing between number and heading). Eventually another character style can be applied to this newline to tune vertical spacing.

As long as chapter heading only needs a single line, visual aspect is acceptable. But multi-line heading definitely are ugly.

If you go along these lines (from a very quick and dirty experiment), I highly recommend that you record a skeleton chapter heading in an AutoText entry considering the number of styles involved.

Post and sample file edited to take into account @mikekaganski’ reminder

1 Like

It requires setting Bold and Italics on them, accepting, then opening the style again, and unsetting these.

I remembered something like that, but it didn’t work. Perhaps I was too quick and dirty. I checked on my other computer and it works as expected. Tired? Old age?

Thank you for the suggestion.

I tried solving this problem using a hidden paragraph, but its number information was not accessible by subsequent paragraphs, fields and TOC.

And of course, there is still a problem of controlling inter-character spacing in the numbering, where only one character style is used.

The more I think about it, the more it appears to be the central point of the problem.

Where is the problem? You can modify inter-character spacing in the number through Numbering Symbols. Here what it looks like with 15pt character spacing:

image
Be careful, though. Due to numbering right alignment, this requires to adapt number position. Matters would be much simpler if number and heading had the same alignment.

Grrr! This is consequence of people considering Word to be THE reference. They follow bad routines and instead of educating them M$ preferred to “fix” these inconsistencies with dirty hacks which have been imported into Writer for “compatibility” reasons. I also wish to be able to enter meaningful “metadata” in hidden paragraphs but these @!%#? “compatibility” rules break my carefully crafted additions.
The M$ idea is: if it is not visible, it has no value. And it is simply ignored. Side effects are lost.

Will a number like 15 be bold and use normal (not wide) spacing between 1 and 5, like on original picture?

I managed to do the right aligning for the upper part! The paragraphs and lines go from margin to margin
AskLOSeparateNumberHeading.odt (13.4 KB)

I used:

  1. Style tab position (Tabs tab on paragraph style dialog) set to right-align at the right margin
  2. A tab character (keyboard tab) before the word “CHAPTER”
  3. Number followed by New Line
  4. A character style for the New Line character, as recommended.
  5. A tab character at the end of each line
  6. A manual line break after the tab character
  7. A “chapter-top” character style with only an upper border, with padding
  8. A “chapter-bottom” character style with only a lower border, with padding
  9. Space below the paragraph

However, there is a problem with the horizontal lines this method generates. There is a tiny gap between the border for the last character of the line and the border for the tab character.

Also, I am still unable to format “CHAPTER” and “24” differently. Maybe I can learn something useful by investigating the flat odt file. I will share whatever I find.

How did you insert it in Tools>Heading Numbering? Whatever I try turns into a space character.

I don’t like the idea because it requires manual action; the same for tabs and new lines.

IMHO this is a bug.

PS: when posting screenshots, always enable View>Formatting Marks

EDIT
If you’re not faint of heart, I found a tricky workaround to allow to style differently CHAPTER from the number. The workaround is based on frames.
-Tools> Heading Numbering contains no separator (word “Chapter” is removed from the level configuration

  • a frame is attached to the chapter heading
    The frame style is tuned so that the frame text aligns vertically with the number baseline. It is positioned horizontally so that the widest number won’t be overlaid (this means spacing bettween CHAPTER and the number is not uniform across the document).
  • Frame Contents paragraph style can be customised for your preferred taste, independent from Numbering Symbols

But there is a caveat: frame styles are very very very (should be repeated seventy-seven times) tricky to configure and sensitive to the slightest direct formatting which may be present.

Here what it looks like:


image

If you’re interested, I can elaborate on the configuration.

How did you insert it in Tools>Heading Numbering? Whatever I try turns into a space character.

I just typed it on the page, copied it, and pasted it on the Heading Numbering dialog (using version 7.6). If I recall correctly this hack works for captions as well (although not in the category name), and you can insert any whitespace characters (those you can insert via Special Characters dialog or Insert>Formatting Mark) and as many as you want.

I don’t like the idea because it requires manual action; the same for tabs and new lines.

Yep. I do not like it either. It looks super hacky. But the annoyance is minimal when you consider that the tabs and new lines are inserted while typing the actual text content of the paragraph. It also makes it unnecessary to fine tune the alignment via the Position tab in the Heading Numbering dialog.

IMHO this is a bug.

I think I’ll write the report later, along with feature requests for hidden numbers in lists and separate character styles for bullet/number and the before/after contents.

If you’re not faint of heart,

I am not.

The workaround is based on frames.

Yuck!

…so that the frame text aligns vertically with the number baseline…

If you’re interested, I can elaborate on the configuration.

Please, do. I have not been able to do anything consistent using frames since I started using Writer (specially regarding pictures), so I need all the help I can get. The behaviour for frame properties and frame styles is so unpredictable I kind of gave up trying to understand them. Documentation did not help.

(this means spacing bettween CHAPTER and the number is not uniform across the document)

Could not that be solved by using two frame styles? One for 1 digit chapter numbers and another for 2 digit chapter numbers? Can the position of a frame be defined via a frame style? I ask this because I never managed to get it right.

PS: when posting screenshots, always enable View>Formatting Marks

Sorry. Here you go.

Why not? But we’re back to manual formatting (albeit high level)

Yes, this is what I did. Positioning parameters are extremely rich (therefore quite difficult to tame). The most interesting feature is their relative nature, so that the frame moves with the anchoring object. This is also why you must absolutely (if I could super heavy bold the word, I’d do it) avoid any direct formatting on frames, especially moving them with the mouse, because any small direct formatting immediately disables frame style.

I wouldn’t say “unpredictable” but “unstable”. Instability is mainly caused by direct formatting, plus a small amount of less-than-optimal implementation (personal opinion; I bow very low in front of developers who created a tremendously great suite).

Forgot to add: avoid also black theme which makes the shots more difficult to read.

I suggest we continue on private mail since your questions become more and more targeted on your present document.

Thank you again. It seems frames will solve my problem. I would like to continue the conversation and learn more about them.

And sorry again. I should have been less abstract and gone straight to the point from the start.

Not sure to have understood, but Heading 1 style says:
Screenshot from 2024-06-30 20-00-39

The tiny gap is between the borders of the last visible characters and the border of the tab that goes from those characters to the end of the respectve line. I did not notice this padding, but it has nothing to do with the tiny gap, which is created via character styles, tab positions in the paragraph style and manually inserting tabs.

imagen

Yep. That one.

This is part of typographical design.
You can test in the preview from Character dialog, Font tab with the following characters: █s█
I reached until fonts begining with L.
Bandal
Eunjin
Latin Modern Roman Slante (this font will pass the line to the right)
Screenshot from 2024-07-02 20-36-03