Chapter Numbers in Frames

[Split from my previous question.]

I have a document that is predominately arranged in 2 columns throughout. The Chapter headings need to stretch across both columns, however. I also have some larger sections that begin with full-page title pages. On the latter, text is centered both vertically and horizontally.

The only way I’ve found to accomplish both of these situations is by using Frames, anchored generally “To Paragraph” so that they automatically shift pages as needed. Chapter Numbering doesn’t seem to mind this and correctly detects other chapter beginnings, even though each is in its own, separate field.

My problem is that I’m also trying to auto-detect the Section Number & Chapter Name in the footer with a pair of Fields.
Unfortunately, Writer doesn’t seem to accurately detect which chapter/section a given page is in, and instead tags everything as the last section/chapter in the document.

and which question is here?

This was the 2.5/3 problem from another question I posted shortly before this, here.

The issue is that Chapter titles placed in frames don’t seem to be registered by fields placed in the footer that need to detect them.

For example, on the page where Chapter 1 should begin, I need a footer stating that page falls in Chapter 1. Since “Chapter 1: [Title]” is contained in a frame, instead of on the base document layer, the Chapter field can’t seem to find it accurately.

As keme seems to indicate below, I guess this is something that LibreOffice can’t really do. It’s a bummer, but c’est la guerre.

Having Heading n in frames may work (see the restriction in my answer below) but you can’t cross-reference them reliably because you’re dealing with multiple text flows.

A text flow must remain consistent and ordered. If an element relative to this order is created and maintained outside the flow, expect “glitches”.

Flawed/less intuitive behavior

Fields in frames seem to pick up states from main document flow at anchor point. Pickup of content from “aside” (frames and conditional content) is not so consistent. Works sometimes.

My workarounds for reliable behavior.

Full width headings and two-column content:

Don’t use column setup on “document level”. Insert sections and set them to 2 columns. With columns on “section level” you can insert headings in between, or use sections for headings too, as you please. Each section maintains its own column setup.

For the title page, insert a single column, single row table, set height and width to fill the text area and remove borders. A table cell can center content vertically and horizontally.

This pulls your content out of frames and into normal flow of text, which should make all fields detect the “text flow states” properly.

Are you setting the columns with a direct/manual format edit, or is there an option in Paragraph styles that I’m missing? I’ve been setting it in the Page styles, because I’m building a template and trying to put as much of it into pre-set styles as possible.

It’s a bummer that the fields can’t detect the content a frame according to its anchor point, but that’s rather what I was afraid would be the case.

Are you setting the columns with a direct/manual format edit, or is there an option in Paragraph styles that I’m missing?

No. I use Insert - Section and set columns there.

As far as I can tell there is no straightforward way to automate section insertion after a heading, nor to apply styles to the section, so this is a manual operation. Not very helpful for your template setup, I’m afraid.

Edit: @ajlittoz’ answer provides a more in-depth explanation of what is going on, and a good illustration of the lack of predictability arising from the “structural division” introduced by frames. Worth reading thoroughly!

As @keme points out, frames are outside the main text flow. They create secondary flows not supposed to interact with main flow, beyond being laid out at the requested anchor point and eventually flushing text around the frame contour.

As frames are independent from main text flow, Writer does not try to maintain “geographic” consistency between text and frames. This means you must not attempt to link main text and frame contents.

Having Heading n paragraphs or lists shared between frames and text are examples of the forbidden twists. When Writer collects data for the TOC, it does so following its internal chain of pointers. It appears that frames are linked in their order of creation, not in visual order. Consequently, your chapters may be numbered rather surprisingly. See the following illustration.

Bad heading order

Number of columns is an attribute of page styles.

Your case is complex because in the same “unit” (a chapter) you want to mix single- and 2-column layout within the same page. You must then configure your page style on the least constrained requirement, i.e. single column.

Sections are used to temporarily change the layout of a part of a page.

Your design will compel you to create as many sections as Heading n subordinate groups of paragraphs. From your other question, this is the number of Heading 2 headings. I hope you have no higher levels than 2 or you can compose Heading 3+ in 2-column mode to avoid too many sections and or short text broken in two columns which is hard to read.

Unfortunately there is no “section style” which could automate the process.

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.