Adding images to a document in Writer

I am using Writer to write a book.

The book contains around 100 photos. I have been inserting images between paragraphs, but no matter whether I anchor to page, paragraph or character, the images do not stay where I have inserted them. Well., some do and others don’t!

I will save the document and re-open it to find the images are on different pages and not where they are meant to be.

This is really frustrating. I have read other posts saying that Writer isn’t the right tool for this, but the ability to add images to a document should be standard so I’m guessing I’m probably doing something wrong.

Is Writer really not capable of doing the above?

Writer can do that.

Insert and edit images in Writer Part 1 - The Document Foundation Wiki

Insert and edit images in Writer Part 2 - The Document Foundation Wiki

Inserting images in Writer Part 3 - The Document Foundation Wiki

2 Likes

Yes, but you must follow some strict method.

The first notion to undestand is the difference between anchor and position.

The anchor attaches your image (or more generally a frame) to some “object”. This object can be:

  • the image itself when you turn it into a custom “character” (As character) where the image is inserted inside the text flow at a given location
  • a character of the text (To character)
  • a paragraph (To paragraph)
  • or a physical page (To page)
    Beware of this last option. It is a very special mode intended to bridge the gap between text processing and desktop publishing. Don’t use it routinely; it does not do what you think.

The role of the anchor is to compute on which page the frame will appear. Full stop. When you edit your text, the anchor location moves with text; therefore, the page (except To page mode) may vary. This is usually what you want. An image associated with a paragraph must remain in the “vicinity” of the paragraph.


One the page is known, position parameters are taken into consideration, except for As character because in this mode the frame is a (big) character managed by the text flow algorithm. The frame can be sent anywher in the page.


The position in the page can be constrained inside various “regions”:

  • page text area (excluding margins)
  • full page (no constraint)
  • left or right margins
    Note there is no constraint for header or footer; you must then use “full page” with absolute coordinates)
  • full paragraph bounding rectangle (extending from margin to margin and including spacing above and below)
  • paragraph text area

You can select separate vertical and horizontal areas. Within the selected area, you choose left, center, right alignment or absolute positioning from top/left origin of the area.


One last important setting is interaction with text: this is the wrap property. By default, Off is preselected, avoiding any complex interaction between frame and text: an area from left to right margins is reserved for the image and no text can be set here. Selecting another wrap option allows some text to be flown on either side of the image.


The only way to achieve stable and predictable position of images/frames is to design carefully frame styles. This is the most difficult aspect in Writer. It took me years to master the feature. It is very powerful but not as rock-solid as paragraph styles. In paricular, it is very sensitive to direct formatting. Resist the temptation to move an image with the mouse or resize it. Prepare them outside LO to the exact dimensions and density you need. Request the least from Writer (it is not a sophisticated image manipulation program).


Once your image is inserted into your document, apply a frame style to it and never again move it or resize it with the mouse. This would irremediably alter all the parameters, notably the “reference” and coordinates.

If you have any doubt about manual fiddling, apply another frame style, preferentially some unrelated one like Formula and reapply your required style. Otherwise your manual operation takes precedence and results in what you experience after edits or text reflow.

3 Likes

@Hrbrgr Thank you for these links - I wil work through them.

1 Like

@ajlittoz Thank you so much for taking the time to give me these pointers. I’m going through your points slowly to fully understand them, but am sure they wil really help me going forward.

One thing I will note immediately is I have been moving images with my mouse to place them where I want them. That could be a source of much of my frustration.

I also haven’t been applying frame styles to images.

I have been inserting image, adjusting position (for example, it may not work where I originally hope so drag it up a paragraph) then using image properties to add a border, anchor, etc.,

Check this book with hundreds of images (anchoring, wrapping):


Designing with LibreOffice


Full book (ODT) – 27MB

1 Like

@Grantler - many thanks for this. Proof positive that Writer can handle what I’m attempting and a lot more besides.

“Never use spaces or empty lines to position objects. Instead, always use styles.” Yes, I’ve been separating paragraphs and inserting the image in the empty line…

Haughland’s solution says: Create a new paragraph and click INSERT > IMAGE to add the image.

Can you explain the difference between creating a new paragraph and inserting the image and what I’ve been doing?

Not sure to understand what you want clarification for.


“Empty lines”
A document is supposed to contain “significance”, i.e. information for the reader. An empty paragraph contains no data. Its information value is therefore null. Consequently, it can be eliminated without changing the global “message” nor the layout.

When you space paragraphs with empty line(s), you “detach” the ancillary details from some paragraph. A paragraph has many important attributes beside text: font face, size, indents (lateral “margins”), spacing above and below, … Many people tend to disregard these various parameters as intrinsic to the paragraph, notably vertical spacing. This has many harmful consequences.

Writer sees all paragraphs as equally valuable: if user has entered a paragraph, it is significant for him and Writer handles all paragraphs the same, whether empty or not. Depending on text flow and edits, these empty paragraph can “kill” your layout, while intrinsic vertical spacing can be ignored (if so configured) at top or bottom of pages. Also, if you vary the height of your margins, an intrinsic vertical spacing can be automatically adapted, contrary to empty lines which must be manually removed or added.

All properties of a given paragraph category (narrative, heading, comment, note, …) are stored in a paragraph style.

A well-behaved document should contain absolutely no empty paragraph (remember they bring no value, 0 bit of information).

Spaces to align objects
Spaces are not reliable. A space character is only a separator between words. When text is set, U+0020 SPACE is not used. Position (coordinates) of words are computed before sending the string to its line. Indeed, width of space in the font is used to provide a starting estimate of the position but Writer is allowed to change this width when justifying text. You don’t know for sure how many SPACEs to use. Things get complicated if successive lines are composed with different fonts or sizes.

When you must format tabular data, use tables or, as a surrogate, tabs to explicitly declared positions (don’t rely on the default implicit evenly spaced stops where typing several tab to achieve positioning is strictly equivalent to using SPACEs).

Well, I am a bit puzzled. Technically, the paragraph is not “empty” because it is home for the image anchor. However, since the image can be sent anywhere in the page, there is no obvious visual relation between the paragraph and the image. Moreover, your image is not independent from your text. There is always some mention of it somewhere (at least “See image xxx”).

I prefer to anchor my images to these “mentions”. Then, the image will always be positioned correctly, i.e. in the same page, with regard to the “mention”.

When an image has a caption, I attach it to the caption paragraph. The caption is either a “standard” paragraph in the main text flow or the contents of a frame so that I have a side illustration. The frame is in its turn anchored to a “mention” in text (indirect access to image).

1 Like