Frames anchored to paragraphs: why they move when I press Enter on the line below them? Is there a fix?

When I insert a frame anchored to a paragraph and I press the Enter key on the line below it (that is, below the frame), the frame moves down.

I don’t think this is a bug, but this is inconventient for me. For example, if I insert a frame for a note and a frame for a quotation one after another separated by an empty line (yes, I use empty lines to separate paragraphs; I know this is not correct, but I still like this), and then I want to insert additional empty lines between them – so that I put the mouse cursor on that empty line and press the Enter key, – both frames moves down.

image

The workaround is to change the way how both frames are anchored from “To paragraph” to “As character”. This works fine, but as a purist I don’t like that this is not really how it should be. Anchoring as character should be reserved for frames that are really inline, such as inline formulas:

Blah blah blah [e=mc^2 ] (inline frame) blah blah blah

And since my frames are full-width, the correct way to anchor them is “to paragraph”, not “as character”.

So, is there a way to keep these frames anchored “to paragraph”, but fix the issue described above?

An update a day after:

…as a purist I don’t like that this is not really how it should be. Anchoring as character should be reserved for frames that are really inline, such as inline formulas.

I don’t know whether OpenOffice Wiki is something “official”, but it seems that it suggests to use anchoring as character in such cases:

As character. The frame is placed in the document like any other character and, therefore, affects the height of the text line and the line break. The frame moves with the paragraph as you add or delete text before the paragraph. This method is useful for adding a small icon in sequence in a sentence. It is also the best method for anchoring a graphic to an empty paragraph so it does not move around the page in unexpected ways.

I admit that I frequently use this trick for ease of positioning, but in a specific context.

I first insert a frame (an image or drawing) at the location where it will be anchored. It comes out as a To paragraph anchor. The I Insert>Caption to number the frame. To avoid multiple positioning issues, I change the image anchor to As character to eliminate the nesting of two frames: the inner one for the image and the outer one for the caption. Thus I have only one frame for the captioned image instead of two.
I only need to concentrate on its positioning instead of having to deal with the secondary position inside the outer frame, which is always tricky.

As long as you have no nested frame, positioning is “simple”. Once you have a good idea about where it should go, this can be translated into a frame style, e.g. frame centered between the margins, vertical position can be near the reference paragraph or always at top of page. You also tune the wrap property accordingly.

The most sophisticated use of frames with automatic positioning was in a document with both footnotes and side notes. Side notes were implemented by frames positioned in the outer margin. A paragraph can have several margin notes, so care must be taken to prevent overlap and automatically shift would-be-overlapping frames. This can’t be done with As character. The magic of it is the automatic repositioning of the frames when you edit the main text.

1 Like

Interesting, thanks. What are your personal reasons to prefer anchoring the outer frame of image “to paragraph” instead of “as character”?

More freedom in positioning

I met such a situation. The cause is the wrong appreciation of where the anchor is located.

You screenshot is taken without View>Formatting Marks enabled. We don’t see exactly where the paragraph marks are.

What I imagine is your new formatting mark is inserted before the current one. The frame is anchored to this current paragraph. The new mark inserts the new paragraph above the current one. The new one has no frame attached to it bit it needs room.

So, you end up with a new empty paragraph and below it the original paragraph with its frame. You may think the frame moved but it didn’t. It is still anchored to its maiden paragraph.

This is more prone to happen to the last paragraph in the document. To avoid this, when I can forecast I’ll insert future elements, I always hit Enter twice before attaching a frame (to the first of the pair) so that I can recover quickly.

2 Likes

This is a screenshot with formatting marks enabled:

image

And this one is with both formatting marks and anchors:

image

The frames move down even when they are inserted as not the last paragraph in the document.

@jsv1 Please upload your file here to be able to examine it. Thank you.


And please name your operating system and LibreOffice version. Thank you.

@Hrbrgr Here it is:

jsv-test.odt (10.1 KB)

LibreOffice:
Version: 7.2.2.2 (x86) / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: ru-RU (en_US); UI: en-US
Calc: threaded

Operating system is Windows-7, 32-bit. (Yes, still).

@jsv1
I have looked at your file, thank you very much for making it available.
I have not seen something like this myself, but it is very interesting.
According to your settings in the properties, the paragraph mark that is normally at the end of the frame slides to the next line.
In that respect, IMHO it is correct that when you put the cursor on that paragraph mark and press Enter, the frame goes down with the paragraph.
I don’t see any misbehavior, although it looks strange.


I think the explanations of @ajlittoz are more detailed.

Do you want to file it as a bug?

  • In Writer 6.4.7.2, 7.1.5.2 & 7.1.7.2 the frame above does not move, I think this is correct behaviour.
  • In Writer 7.2.2.2 the frame anchored above the cursor moves for no reason.

Cheers, Al

1 Like

@Hrbrgr , it seems I understand what you mean. Since the frame is the same width as the paragraph itself, there is no space for newline character (represented in Writer as blue ¶), and therefore this character is moved to the new line, which leads to the observed behavior.

I’m not sure if this can be called a bug, but this definitely should be improved because normal paragraphs don’t need this space: if there is not enough space, the newline character (¶) is placed outside the paragraph, and that’s it.

click here for a full image

image

This definitely should be reported, see my last comment and image. I will post the link here.

I can repeat the same effect in 7.1.5.2 by changing the anchor to To character. The anchor point then visibly moves to the paragraph marker below. Putting any letter or space character at the beginning of that paragraph stops the frame above from moving.

@EarnestAl, @Hrbrgr, @ajlittoz. I just reported it here:

145802 – Frame that is anchored to paragraph should need no additional space for its newline character (documentfoundation.org)

1 Like

@jsv1: the situation depicted in your screenshot covers two very different cases.

  • Ordinary text paragraph extending from margin to margin
    Text “saturates” available space and paragraph mark indicates end of paragraph contents. The mark, using no space, is rightfully displayed “in the margin” (but in fact is “at” the margin as a 0-width marker).

  • To paragraph frame extending from margin to margin
    A frame “punches” a hole in the sheet, removing it from the available area for the main text flow. In the present case, you leave absolutely no room for anything, be it a 0-width element. In the main text flow, you have the empty support paragraph. This paragraph can be set only in an active part of the sheet, i.e. above or below the frame.
    I changed slightly your aaa Test frame style so as to leave a 0.01cm space at right of the frame. This space is so tiny that no character can really be put there, but this doesn’t align to the right margin and the sheet is not fully cut off. Now the paragraph mark is where you think it should be.
    You may object that this changes a bit the vertical layout but this is consistent with the “punching out” created by frames. The paragraph marker creates a line (even if it is empty). This line has a vertical extent defined by the font properties. Above and below it, you have the paragraph spacings.
    When your frame extends from margin to margin, the empty line can be created only below (or above) the frame. If you leave a tiny bit of sheet, this tiny space is allocated to the paragraph and its empty line can be inserted there. Its vertical extent is probably dwarfed by the height of the frame and above/below spacings are independently added. Whether they make a difference depends on frame height and wrap property.

IMHO, there is no bug but a very subtle behaviour. And this is undocumented.

4 Likes

@ajlittoz

IMHO, there is no bug but a very subtle behaviour.

Reason: frames are full-width

Thanks for your explanation.