Images anchored to a page, but inserted where the cursor is currently located

I want my images to stay exactly the same X and Y position where I placed them, hence I anchor them to a page. I have the corresponding tweak in my Graphics frame style.

However, this also means that when I insert images, they are inserted at the top, bottom, or middle of the page. Is it possible to tell Writer to insert them where my cursor is currently located, instead?

As a workaround, I can insert them as anchored to a character and then re-anchor to a page afterwards, but I don’t think this workflow is really convenient to me. Too many clicks.

Until you know what this means and have enough experimented with it, never NEVER anchor images (or more generally frames) To page. This mode is reserved for a cheap replacement for desktop publishing (DTP) mode.

Anchor mode only tells Writer to which “reference” the frame/image is attached so that when the “reference” moves due to edits, the frame/image can follow the “reference”. To page creates a fixed reference where the frame will never move. To paragraph and To character are equivalent and attach the frame to some paragraph. They differ only in the case where the paragraph straddles a page break. As character makes the frame part of the paragraph and you won’t be able to position it manually.

To summarise, you want To paragraph anchor mode.

You can of course start positioning the frame by dragging it with the mouse, but consider this is a coarse approximation. Right-click on the frame and Properties. The Type tab has a Position section where you’ll finely set the position properties of your frame.

If the frame should remain in relation with the paragraph, select a reference containing Paragraph. If the frame should go to a specific position in the page not at all related to the paragraph, select a reference with word Page. The difference between area/margin and text area is: the latter excludes spacing above/below and indents, i.e. the “location” is strictly the rectangle containing paragraph text.

If all your frames share the same positioning parameters, it is convenient to store them in a frame style and apply it to the frames. This allows, among others, to reposition all frames simultaneously. simply by updating the style.

2 Likes

This is useful to know, but in fact I’m aware that images anchored to a page are always stay on this specific page. This is exactly what I need from them. The only problem that I don’t like that when I insert them, they appear far away from where my cursor is.

If your only sorrow is the initial position, put all settings in a frame style (for a first page logo this should be fairly simple and standard; don’t forget the wrapping parameters) and assign the style with a double-click.

Hm, but I don’t talk about a logo on the first page. I talk about images placed here and there across the whole document. In the frame style, I can set something “always insert this frame 2 inches from the top of the page”, but I don’t see an option to set something like “always insert this frame where my cursor is”

Because “where my cursor is” is not well defined next time you open the document. I understand the rationale behind initial insertion “where my cursor is” but this must be translated into some more permanent location. The only accurate “where my cursor is” position is met when anchor mode is As character. But this has huge impact on line spacing. Could you describe the other settings you expect at the cursor position (wrapping mode, what happens when the paragraph is moved, …)? With a detailed description of your goal, I could perhaps suggest something.

How come “where my cursor is” is not “well defined”?

At least for me, I’m not thinking about the mouse pointer, which may very well be at an arbitrary point in the document. I’m speaking of the text cursor, which if I place it in paragraph 3 and start typing, text will appear in paragraph 3. For some reason I expect that when I do Insert → Image, the inserted image will be anchored to paragraph 3 as well, however it will be arbitrarily located somewhere else in the document.

The same problem appears when working with frames. I want frames to appear where the text cursor is located, but they seem to follow the same set of rules as for images.

@al_F

Images create a frame. So, positioning images or frames is the same.

I won’t discuss the case of As character as this turns the inserted object into a “big character” which follows the text flow, just like any other character. This case is easy to understand.

A frame has an anchor point. Basically it is a paragraph. By default the exact anchor is located at start of paragraph. You can slightly change this location by choosing To character but this is relevant only if your paragraph straddles a page break.

Since a frame contains information related to what is close to the anchor, Writer constrains the frame to show on the same page as the anchor. But this seems to be too coarse for your goal.

Moving the frame position with the mouse will not allow you to define your constraints. Only right-click+Properties or a frame style has all the parameters under control in the Position & Size or Type tab. See the Position section.

The X,Y coordinates are relative to some origin. You have the choice between paragraph and page.

  • With page reference, your frame will have a fixed position in the page, regardless of the actual position of the paragraph. If you add or remove text before the anchor paragraph, the paragraph will move but not the frame (until the paragraph jumps to another page).
  • With paragraph reference, your frame will be close to the paragraph, either inside its bounding rectangle or outside, but always in the same relative position. If you add or remove text before the paragraph, the paragraph and its frame move together.

    If the frame is below the paragraph, it may overflow into the footer or even be clipped by the page limit. This can be avoided by ticking Keep inside boundaries.

    A page boundary may disturb the layout if there is not enough room for the anchor+frame. In this case, the anchor (i.e. everything from the anchor point to the end of the paragraph) and the frame are sent to the next page, leaving an unwanted blank space at bottom of page. This can’t presently be avoided because anchor and frame must reside on the same page.

    This can somehow be mitigated, without being perfect, by using To character and an empirical rule:
    • frame above paragraph => anchor at start (or To paragraph)
    • frame inside paragraph, if centered anchor nearest the middle of paragraph text, otherwise at start
    • frame below paragraph => anchor after last character

Does this answer your question?

1 Like

You can set the default for Writer to anchor the image As Character which will place the image at the point of the cursor, or the available space which could be next line or next page.
I have this default set as I find it easier to arrange images at the end when I finish a document and then I can leave them as they are or apply a different anchor. Start at the beginning and go forward so changes won’t affect earlier positioning.

Only for LO 6 and above I think. Click Tools > Options > LibreOffice Writer > Formatting Aids and Under heading of Image, in field Anchor, select As Character

Regardless of above setting, Frames inserted manually use the settings from Frame Style Frame