There is a better way of doing this without tweaking the file (which is always hazardous).
You apparently consider the picture to be your “main” object to which a description or caption is attached. This is how Insert
>Caption
works but it does not allow modifications after creation. In addition it complicates document structure by inserting frames (which can’t be constrained to proper nesting).
Reverse your paradigm. Consider your description to be the main object which is decorated by your picture.
Your description becomes an “ordinary” paragraph to which you apply an adequate paragraph style. Insert the picture you anchor to the paragraph (or some character). Apply a dedicated frame style.
By default, built-in Graphics style is applied. You can go with it if you have only one “type” of pictures, i.e. all your pictures are handled the same.
DON’T POSITION YOUR PICTURE MANUALLY! Doing so attaches direct formatting (DF) to the picture and this DF is next to impossible to get rid of. According to precedence rule, DF has higher priority than styles and your manual position will never be replaced by position defined in the style.
Position of picture is specified in the Type
tab of the style.
- make sure Anchor is To paragraph
-
Position Horizontal Center relative to Entire paragraph area for global centring between margins,
-
Position Vertical Top or Bottom for pictore above or below description paragraph
- tick Keep inside text boundaries to prevent the image from being clipped if it is too close to page top or bottom
In Wrap
tab there are extra settings to tune picture relationship to text.
- select Wrap Off (because you want the picture neatly above or below the description)
-
Spacing allows to add extra spacing to better separate the picture from text; only Top and Bottom are relevant here
- untick Allow overlap (so that the frames are automatically repositioned if you attach several pictures to the same description – I don’t understand why developers ticked this setting by default; it causes more problems this way)
Now, if you want to change from top description to bottom description, you simply change the vertical position reference in the Type
tab of the style.
Frame styles are bit more fragile than other styles. If you don’t see any change after a style modification, click in some “ordinary” paragraph (i.e. one without picture attached). If it still does not update, Tools
>Update
>Update All
.
Here LO 24.8.4.2 under Fedora 41 with KDE Plasma desktop.
PS: if you want to tweak document XML, save it as .fodt This will spare you the pain of using a zip utility and reinserting modified contents in it. A .fodt can be opened in any text editor.