Unknown origin of style modification in a Master-document

I’m working with a very big file with a of pictures, and because of this, I recently started to split my document into several documents in order to use the “Master Document” feature.

But when I import my document some style seems to change and I can’t figure out which one and why…

To be clear here is my last (and simpler) test :

  1. I create a Master Document.
  2. I import my first chapter ODT file as sub-document.
  3. I open the “styles & formatting” window (of the master document) and click the “Load styles” button.
  4. I import all the style contained in the sub-document I already imported by ticking all options including the “overwrite” option, so that all the “default” styles that wasn’t imported when inserting the sub-document are now imported.
  5. Here is the result :


(BIG SIZE)

whereas in the original document it looks like this:

(BIG SIZE)

They seems quite similar, but in the master document there is a small space at the top of my “Heading 2” and “Heading 3” which isn’t visible in the original file (I draw a tiny red arrow to represent this space).

That seems like a very tiny problem, but in reality this is radically changing the overall layout of my document and I can’t publish it without fixing this problem…

Here are some hints :

  • The “Above paragraph” of my Headings are set to 0.00
  • The “Bottom” and “Top” borders are set to 0,25 on the “Heading 2” and 0,15 on the “Heading 3”
  • When I increase the top border of the Heading styles in the master document, this space increases, whereas if I do the same in the original document, the Headings remains stick to the top (and the internal border space indeed increased).

Any idea of what I am missing ?

— EDIT —

If you want to check the file, I uploaded a test file HERE.
This is a file with a really minimal content, but nonetheless when I “File / Send / Create Master Document”, it ends up with the same faulty spaces on top of the Headings while they aren’t in the original file.

If you have created a master document from scratch, it has default style settings, which need not meet those of your document. Please try the way File > Send > Create Master Document from a copy of your original document. Or try to import all styles from the original document to your master document via “Load Styles” with “From File” and “Overwrite”. “Load Styles” is in the right most symbol in the paragraph category in the Style&Formatting part of the side bar.

@Regina : Hello, I tried the two suggested solutions, but unfortunately that leads to the same faulty result.
At some point I was working with the 5.3.2 and I had to downgrade to the 5.2.6 because there was too much bugs to work with this version. Could this be the origin of the problem?

If I were sure about the reason, I would write an answer and not a comment. I can only guess, what might be the reason. Another candidate for differences are the compatibility settings in Tools > Options > Writer > Compatibility; especially the setting “Add paragraph and table spacing at top of pages”.

@Regina : Thank you for the suggestion, but it doesn’t solve the problem.
I made a really minimalist ODT file which still have the same problem (at least on my computer). The link to download this file at the end of the question.

I started over from zero and tried to create a master document each time I modified a parameter. I was able to completely change the “Heading 2” parameters without having the faulty spaces, then when I added a “text body” under the heading, the faulty space appeared in the master document. I still investigating…

Strangely, the problem seems highly correlated with the “Border” / “Spacing to Contents” / “Top” parameter of the “Heading”. When I remove the top border and thus deactivate the Top spacing to content and then create a master document there is no added space. However, when I reactivate this top border and its spacing to contents, the faulty space reappear when I create a Master document. And the greater the “Top spacing to contents” value, the greater is the added space in the master document.

I still do not know why this happens. But I know, which setting influence the spacing. It is the setting “Spacing to Contents” item “Top” in the “Borders” tab of the paragraph style. I think, that it is a bug. The spacing between content and border (often called “padding”) should not influence the spacing outside the border (often called “margin”).

It is not the master document itself. But it happens, because the child documents are inserted as sections. I see the same problem, if I use a paragraph with border in a section in the middle of a page without any master document.

Can you write a bug report?

A workaround is, to set the “Spacing to Contents” to 0cm and increase the distance between Text and border by increasing the font size of a space character inside the header text.

Bug report is now https://bugs.documentfoundation.org/show_bug.cgi?id=107497

I agree that this looks like a bug. I will fill a bug report…
And I will try your workaround.
Thank you very much for your help !

The workaround idea was a good one, but when I create the master document it splits into two stacked “Heading 2” with some added space in between… it seems like I will have to deals without master document after all.

Well you are faster than me… thank you for this bug report :slight_smile: