How can I set default anchoring for an image?

For my purposes (and I suspect nearly everyone else who uses Libreoffice) the only kind of anchoring that makes any sense is “Anchor as Character”.

It takes a lot of clicking to get each and every new image to line up the same way – is there a way to just make this happen in a setting?

“For my purposes (and I suspect nearly everyone else who uses Libreoffice) the only kind of anchoring that makes any sense is “Anchor as Character”.”

Absolutelly not. I am using the “to page” and “to paragraph” options mostly. I am using the he “to character” option for the very small (letter like) images only.

@Zizi64: as you’re now a “regular”, I assume you’re aware of the counter-intuitive properties of To page anchoring. Because of these, this mode is strongly discouraged for newbies. It anchors the frame to an absolute page and the frame will no longer follow text flow, resulting sometimes in undeletable blank pages between the last paragraph of the document and the frame/image.

To page should be reserved to desktop publishing-like work.

That said, my favorite anchor mode is also To paragraph.

@ajlittoz: “To page should be reserved to desktop publishing-like work.”

Yes it is true. My order is: I am using most frequently the “To paragraph” option, the second is the “To page”, and the less frequently used is the “To character” one.

@Zizi64: I use To character very rarely because it is rather difficult to anchor to a precisely designated character and it very easily reverts to To paragraph when editing. My second anchoring mode is As character.

When I insert a picture into Writer, the frame style “Picture” is applied to it. I can change the anchoring of that frame style and all new pictures will follow.

It takes a lot of clicking to get each
and every new image to line up the
same way – is there a way to just
make this happen in a setting?

I suppose it, there is not such option in the settings. But you can create your own “Insert picture” feature (by writing a macro) that will be insert the browsed image to the actual cursor position with the desired anchoring method.

The following is what I did to get images anchored as character in my writter .ott template:

I use Manjaro Linux 22
and
LibreOffice 7.4.2.3 (2022-11-14)

Saw it on:
superuser com/
/questions/550240/make-libreoffice-writer-insert-pictures-as-character-by-default#675014

Take an Archiver like Ark
open your LibreOffice-Writer Template e.g: default.ott
( /usr/lib/libreoffice/share/template/common/styles/default.ott )

chose the file:
styles.xml

open it with an editor like Kate,
in the upcoming message chose “temporaly raise and limit…”.

search (f5 oder ctrl+f) for:
<style:graphic-properties text:anchor-type=“paragraph”

and replace “paragraph” with “as-char”
<style:graphic-properties text:anchor-type=“as-char”

Save it and start Writer, chose your Template
File > New > Templates > Defaultxxx

Now you can add your images one by one.
Do not insert to many images at a time, this will crash writer.

After “Default anchor for newly added images can be set per Tools ▸ Options ▸ LibreOffice Writer ▸ Formatting Aids” in 7.1, and “Anchor type selector added to frame style dialog” in 7.2, you don’t need to edit the ODF manually. Version 7.4 allows you to configure it in its UI.

1 Like

Thank you, thats right, it works good.
For some reason I have not found this until you told it.

There is another approach: frame style.

If you can characterise your images to share many parameters, store these in a frame style (including the anchor mode).

Then insert your image. Select it and assign it your frame style. The anchor mode, position, size, wrap mode, borders, … will all be set according to what is defined in the frame style.