How to anchor image to paragraph but prevent blank space [writer]

After looking for a solution for about 5 hours this is my question:

I’d like to anchor images to paragraphs without any blank space between paragraphs.
See screenshot here (I can’t upload to this forum atm):
I’m expecting lines of paragraph 3 moved to page 1.
(Or fit the image to page 1, move paragraph 2 and lines of paragraph 1 to page 2)

Settings are:

  • Image anchored to 2nd paragraph and vertical-positioned to the top of it
  • Follow text flow” is ticked
  • Wrap is set to “None

I’m sharing my example file here:

(I’d like it to work kind of like it works with anchoring “to page”: No empty space before and after the image. Obviously with that option images don’t move when text is added to previous paragraphs.)
LibreOffice version

In your screenshot, it looks like there is a page break due to the image size which means the image is anchored to para 3 not 2. Can you check? What happens if para 1 is shorter?

Thanks for your answer ajlittoz.
The image is anchored to para 2, see here
When it has enough space the image moves to page 1 like expected, see here

Unfortunately I can’t shorten para 1 in my paper.
So to get rid of the empty space, I’d need an option which either:

  • moves portions of para 3 to page 1 or
  • moves the image to page 1 and para 2 with portions of para 1 to page 2

Mmmh! I’m afraid that what you’re requesting in a desktop publishing feature far beyond LO capabilities because LO can’t reorder paragraphs: they are supposed to be rendered in the same order as they are typed.

The best I could do was to shift the image on one side (horizontal alignment right or left instead of center), with wrap set to “optimal” and some space around the image, so that text would sit next to the image (resp. left or right). You can then alternate image alignment to …

… give a visual clue on change of “subject” (i.e. change of image) in case text is higher than image. Image behaves then like a drop cap.

If this is a workaround for your need, I’ll change my comment into an answer.

Thank you. Unfortunately wrapping text left or right of images violates the style guide of my institution (but I’d give you a upvote if I could).

Would be a major bummer if I’d need to go back to Latex for a, in my arrogant opinion, very basic feature: anchoring images to paragraphs and no unnecessary blank space. For other stuff LO is really great.

You cannot do this fully automatically on Writer. The best way to handle this kind of situations (at least, the way that works for me) is to change the anchoring to “to the character” and then move the anchor point to the end of paragraph 3. And yes, you’ll need to manually check the anchoring points every time you add new text before the image :frowning:

Note: sometimes the text will not flow as it should when you change the anchor point so you’ll need to press Enter at the end of paragraph 2 in order to make Writer aware of the change. Then, you can delete that empty paragraph without problems.

Thank you for your answer.
I’m afraid that doesn’t work here on version
But as a workaround I’m thinking about writing a script which changes anchoring of all images, tables, frames etc “to page”, and running that right before the export to pdf. If that is possible.
If I only had the time…