Direct formatting in the LO 72 template

Here is a little problem that you should look out for.

When changing text in Heading 1, 2 and 3, direct formatting is directly applied to the new text. This shows when updating the index for the ToC.
The only way to get rid of the error is to highlight the heading and go to Format > Clear Direct Formatting in the Menu bar.
Update the index for the ToC and the formatting error has gone.

Could this be a problem in the template or in LibreOffice and has anyone got a solution?

Regards
Peter Schofield
psauthor@gmail.com
Technical Writer, LO Documentation Team

Hello Peter
Yes I noticed that behaviour in the ToC and when I changed color of the Heading style.

I don't know why this happens, I though originally that it was a mistake introduced by the reviewer/author.

No error in a blank file.

Olivier
Untested guess: can it be a consequence of odtclean.py ?

Hello Olivier

I do not know what odtclean.py is and its purpose. I am definitely no software expert.

When the ToC should odd formatting, I did not know what was causing it. Only noticed a few months ago when changing a Heading 3 in a chapter. The new text did not format to the Heading 3 style.
Solution was to change the Heading 3 into Text Body, make the change and then reapply Heading 3. Updating the ToC was then without problems.

Regards
Peter Schofield
psauthor@gmail.com
Technical Writer, LO Documentation Team

Hi Peter,

odtclean.py is a script used to remove (usually invisible) direct
formatting (i. e. its tags) from text, so that the text can be
translated by translation programs (e. g. OmegaT).
I do not think it can cause this problem, but I have to check to be sure.
But I do not understand how to reproduce the problem - please send a
more detailed description how to reproduce it. Thanks.
milos

Milos,

In my experience, the problem Peter described occurs in some files that
began life years ago and have been edited by various people since then. I
have never seen it in newly created files, except in some cases when old
material is pasted in with retained formatting.

Jean

Hello Milos and Jean

Using the LibreOffice_7.x.V2_Template.ott.
Copy and paste unformatted text from the previous version of a chapter into the template to create a new chapter file.
Go though the pasted text and add the heading styles to all headings in the unformatted text.
Go though the chapter again to make the necessary changes to text to match the LO version I am working on (now 7.2).
Sometimes I have to change a heading to match the changes. Simply done by highlighting and typing in the change.
Normally there is no visible change in the appearance of the recently typed text.
Occasionally, the typed text looks slightly different and not correct. Reapplying the heading style usually fixes it.
Update the table of contents index and this is when you see the problem, mainly with Heading 3 style.
The text that has been replaced in a Heading 3 style is in italic format in the table of contents. The text in the style that was not changed is OK.
Solution is to go to the heading the chapter and delete it.
Create a Text Body paragraph.
Retype the heading.
Reapply the heading style.
Update the index for the ToC and the problem is fixed.

I am using LO 7.2 for macOS on a Mac mini that uses macOS Big Sur 11.5.1.

Hope that helps in identifying the problem.

Regards
Peter Schofield
psauthor@gmail.com
Technical Writer, LO Documentation Team