Headers messing up footnotes

Greetings,

I’m doing some rather heavy text editing for a book, with footnotes. The footnotes are numbered per chapter and remain on the same page as where the referenced text is. However, when I add a header to the page, some footnotes tend to jump to the next page instead without the referenced text being there. I do think this is a bug, because when you try to delete the headers LibreOffice will crash as a result (probably due to the footnotes jumping back or something?).

My current workaround to avoid the crashes is first setting the footnotes at the end of the document, then deleting the header, then returning them at the end of the page instead. However this is not a solution because I need the header for my page numbering.

I’m running Pop_OS! 22.04 LTS, kernel version 6.12. I got LibreOffice v. 7.3.7.2.

Best regards,

Edit your question to mention OS name, exact LO version and save format.

There are indeed exceptional circumstances where a footnote may be flushed to next page. This occurs when the note anchor is low in the page and there is not enough room for note separator + at least 1 or 2 note lines and the line containing the anchor is not forced to next page because it would violate the widow/orphan rules.

For a better diagnostic attach a 2-page sample file exhibiting the issue.

I’m very sorry to have forgotten the most obvious starting details of an issue report!

As far as I can see, it’s very arbitrarily decided. The footnote in question would’ve made the total footnote text take up less than 50% of the page, but on other sections it happily goes to about 2/3rds footnotes.

And myself I forgot to mention there is a parameter in page style limiting the amount of space footnotes can occupy on a page. If this limit is exceeded, footnotes whose text exceed the limit are sent on subsequent pages. And here you bump into another limitation in Writer: footnotes can’t borrow the whole page (which means there is always some amount of main text and this can result in a very weird look when notes are huge, potentially causing a runaway phenomenon).

I set the amount of space to what it allows me to put as a max in cm. However it’s arbitrarily decided. Some pages work fine and take in even more space than the pages were LibreOffice decides to push the footnote to the next page

EDIT: looking at the bug reports I tried changing my fonts too but that did not work. Toggling window and orphan controls didn’t work neither.

Attach a sample file. It is needed for further analysis. I met extreme situations on some documents. If you think you can’t create a representative document and you consider you original as non-public, send it to me through private message (click on the icon left of my name to trigger the service).

Sample file with headers messing up footnotes.odt (119.6 KB)

Here you go. The problem is on page three, where the last in-text reference is “VI” but the footnote is on page four.

And no, the footnotes cannot be made smaller. :grimacing:

EDIT: small detail: this issue was first on the first page, but since numbering had to start from the second page onwards I deleted the header there and it corrected itself.

Very quick feedback (I am busy this afternoon and come back to your document as soon as possible): you have a very complex document structure with (uselessly) nested sections, which makes my computer very slow on load. I think the interaction between these 2-cokumn sections and the page itself is the cause of the problem. There is also a lot of direct formatting (at least on the first page). I’ll see if I can simplify the structure.

I followed some instructions of ChatGPT because I couldn’t get the book title to appear on top, centered and outside of the two-column layout of the text body. So that’s what was causing the lag? If you got some simplification of the layouts then please be my guest!

One problem why the document becomes slow to edit is the use of sections. These also appear to be nested. Section 4 appears to run over several pages.

Another problem is that you use the page style “First page” for the first page (that’s ok), but after that you only use Standard page style; instead of page styles for Left and Right page.
You can also specify different margins for the left and right sides.


You can use a page stylee for the left and right side instead of the standard page style. You do not need an area, as you can specify how wide the left and right margins should be in the page styles.

You can also specify in the page styles that you want to use columns.

Why would I use left and right page layout instead of one standard layout and mirroring them like it’s now?

You need this if the order changes due to chapter jumps.
For example, end of a chapter with the right-hand page and start of a new chapter with the right-hand page.

I do not get this, but I’ll trust you on it and add two different page layouts - left and right page.

The only problem now is that if I do not use sections on every page the footnotes will be placed in a two-column format and the text is not evenly spaced out

EDIT: After trying some other things, I think there are three issues at present here:

  1. My apparently overly complex layout by using too much sections
  2. Headers messing up footnotes when combined with said sections (probably?)
  3. No inherent way to change the footnote layout differently from the main text (e.g. 1 column footnote layout with a 2 column text body). Also the 2 column footnote layout is ugly, being not level but just filling up the column first as much as possible, creating two footnote columns of uneven size.

Back from my activity.

There are several issues in your layout.

Layout

I understand your specification for single column notes vs. 2-column main text (aesthetic reasons; didn’t you ask recently about it?). So chose to use a section to enable 2-column main text without forcing simultaneously 2-column notes.
But this results in “crossed” structure. Your notes originate from the section and are set outside the section in the note area of the page. In such a configuration you can’t specify a distance between “text” (section) and the separator and also between the separator and notes (“spacing to contents” which is locked at 0 or 0.1 cm). You lose a lot of control over your layout.

Honestly, I don’t know how to solve the 1-column/2-column dilemma. Writer has no provision for this layout.

Direct formatting

All typographical variations in main text are done with direct formatting instead of character styles. This is the case, for example, for colour of verse numbers. Direct formatting is also reported in your notes though I could not see exactly what.

This is not related to your question but has an impact on performance, contributing both to slow down Writer and to increase file size.

Bad use of U+00A0 NO-BREAK SPACE

There is systematically such a space between the end of a sentence and the new verse number. This is logically incorrect and will cause bad line wraps, preventing a line from being cut before the verse number. If you really want to have NBSP, it should glue the verse number and the next word (to prevent line wrap between verse number and start of verse). Perhaps you copied the text from the internet where ordinary spaces are frequently replaced by NBSPs. You should fix that.

There are NBSP in chapter headings but this is less serious here (only aesthetic impact).

Once again, this is not related to your question.

Tampered heading hierarchy

You apparently want to replace Heading n application by styles of your own. The easiest procedure is rather to customise built-in Heading n.

Creating a custom hierarchy is possible but you must be careful and fully understand what’s going on. In your case, you derived your user styles from Heading 2 but attached both to level 1. You probably noticed problems because you then tweaked Tools>Heading Numbering to clear level-2 association.

As your document is presently configured, you won’t be able to use automatic numbering and will have a hard time with the TOC if any.

Too long paragraphs

This is one main problem. Your “chapters” are made of a single paragraph. This is no particular issue in “ordinary” documents (without sections) but becomes really problematic with multi-column sections.

In Writer box model, paragraphs are the basic units. The size of the box is first computed and “pre-chopped” according to present context. And this context is complicated by the presence of out-of-section notes. Writer must do a computation both in the section and in the page, requiring caching processed text.

Your “monster paragraphs” span several pages, putting a considerable stress on memory.

Your first task will probably to check the original text to see where you can add paragraph breaks (I have several editions of the Book and all have several paragraphs per chapter).

This will surely improve global behaviour and fix invisible text on several pages.

As a comparison, I attach a demo document I worked with a few years ago after a question on AskLO (the question was rather about margin notes in addition to footnotes).

ComplexLayoutExample.odt (43.7 KB)

Wow…I don’t know where to begin here. So much thanks! So far I’ve yet to find a text processor able to use two column text bodies with one column footnotes, or at the least even out the space these footnotes take up. I’ll be reading this thoroughly, thanks!

A first question: you mention the verse number colours. Can these be set into another style separately inside the text?
A second question: the no-break space is there to keep the verse numbers from appearing on their own at the end of a line. If you got a solution for this I’ll appreciate it
A third question: how would you make different paragraphs? By adding manual paragraph breaks?

Yes. This is what character styles are meant for.

Instead of having the NBSP preceding the verse number, have it following it. Thus, the verse number can be at beginning of line but never at end (because the NBSP will glue together the number and the subsequent word.

Another possibility I used in my sample is to have absolutely no space between the number and the first word in the verse. Some visual spacing can be provided through the character style used to format the number. Have a look to what I’ve done.

Yes.

You haven’t even solved the issue I posted about and yet you have helped me tremendously already! How would I go about implementing a different character style for each verse number?

Do you mean a single character style shared by all verse numbers? Or do you want as many styles as there are numbers (single-use character styles)?

Character styles are created the same way as paragraph styles. The only difference is to select the adequate “collection” beforehand. For this, display the side style pane with F11 and click on the second icon in the side toolbar at top (should look like an A). This will list all existing character styles. Proceed as usual: right-click in empty space and New or right-click a name and New to create a derived style.

You have an example Verse Number (without colour but superscript with spacing) in my sample document.

I know how to create a character style, but how should I apply this one character style to all verse numbers?

If you can think of some pattern common to all verse numbers, use Edit>Find & Replace to Find All all of them, then apply the character style. In the present state (with NBSP present), the regular expression could be (?<=\u00a0)[:digit:]+ Don’t forget to tick Regular expression.

Number not preceded by a NBSP (i.e. usually at start of chapter) won’t be selected and need to be handled manually.

Once done, you can remove NBSPs.