How to create bookmark at the very top of a page?

Using Writer 25.8.3.2, I have a document with a floating image with Wrap set as In Background. I have a Heading 1 text “Section 1” on the first line of the page, with a bookmark “sec_1”. The TOC and other links direct correctly to that bookmark, but the layout being displayed is now borked because the bookmark is not at the top of the page. Is there any way to set a bookmark on the image or set it at the same 0px coordinate that is the picture’s top?

Instead of asking for a fix on your current implementation, give a specification of your goal in typographical or geometric terms, independent of any office suite. E.g. the image is a companion of the heading. Its size is full page (or small size not related at all to page size). It should be located here or there (absolute top/bottom of page, below the header, in the vicinity of the heading, …). It is intended to be overlaid by text (suggested by your background property).

Give maximum information about it.

Don’t forget OS name and save format. The latter is particularly important because the solution probably relies on a frame style which exists only in .odt.

By the way, do you knwo what a frame style is and what is its use?

Explain why you have created a bookmark. A picture cannot be positioned relative to a bookmark.

I’m sorry, this is my first post here, it was the middle of the night, and I was highly agitated. Thank you for responding with what additional detail I need to provide.

The goal is ODT > DOCX > Calibre EPUB/MOBI, so I my understanding is I can’t use frames or custom styles.

The reason for a bookmark is that this is an interactive ebook with links to different sections based on choices the reader makes. Choose A, go to section 12, choose B, go to section 15, things like that.

I can use a Header 1 at the top of the text with the margin set the way it is, but then the top of the image may be cut off and the text on the next page displayed, which a suboptimal experience. I understand that may not actually be the case with a reflowable medium, but it certainly is for PDFs.

Is there anything else I should clarify? Or am I totally out of luck because of EPUB/MOBI format?

Since you’re saving .odt, you might have a try with an ODF-consistent formatting and let the DOCX conversion do its job, then check the result.

If your bookmarks are only intended to navigate from the TOC, this is implemented by default without bookmark insertion. Ctl-click on a line in the TOC and you jump to the destination. I don’t know how it converts to DOCX and even less to EPUB (I kind of remember some visitors of this site complaining about it – perhaps the feature is not implemented in EPUB; or was it Kindle format?).

What is exactly your requirement?

+--------------------------------
|
|          top margin
|
|      +-----limit of text---+================+
|      |A. Heading at top    |  Image here?   |
|      |                     +================+

Do you want the image to be lined up with text limit? with page top? some fixed distance from these references?


Attach a 1-page sample file with your heading, the image and some text after it. Describe the expected result and I’ll design a mock-up.

… something like this?! Please test it and change:
LO-WRiTER_heading w bookmark w picture_025951.odt (253.3 KB)

Before I suggest a solution:

  • what is the role of "<Überschrift>//bookmark 1// ?
    It is styled Heading. Heading is a “subroot” at head of all Heading 1. It is a “technical” style intended to configure defaults (font face mainly) for Heading n, Title, Subtitle and a few other styles. It is not supposed to be used in a document.

    Is it supposed to go into the top margin (as a running header?)?

  • does “bookmark 1” refer to the image, a chapter header or some other text?
    The image can be captioned and the caption be an implicit navigation target.
    A chapter header is a bookmark by itself.
    Common text needs a bookmark for navigation purpose.

EDIT:
Here is a modified version of your document from which I first removed all direct formatting (work exclusively with styles; this eliminates 3/4 of problems at least).

In the first example, I kept the image in background, but the result is ugly.

In the second example I forced the image to appear above the heading, but it is not great.

In the third example, the image is below the heading.

Everything is done with dedicated frame styles. To avoid image truncation, I ticked property Keep inside text boundaries which could cause in some circulstances the heading to be flushed to next page with the image.

LO-WRiTER_heading w bookmark w picture_025951.odt (261.1 KB)

1 Like

It is NOT just TOC. There are hyperlinks in the TEXT that point to subsequent sections!

Can a caption be set at the top of the image rather than the bottom of the image? What happens to captions when the image is full-page Wrap = In Backgound?

@ajlittoz
My file is intended for demonstration purposes only for learning. <heading> is simply an “overformat” that itself does *not contain a bookmark and therefore cannot appear in the table of contents. A bookmark must be inserted manually for referencing.
Demonstrative examples for learning are sorely lacking everywhere anyway!

A thousand apologies. I was so much focused on the problem that I didn’t notice you weren’t the OP!

Yes

“Full-page” is not the same as “In background”.

“In background” means the image in sent in a layer below text and no longer interferes with text. Text overlays the image as if it did not exist.

“Full-page” is just a matter of size.

Both properties are independent from each other.

You can move a picture within its frame, so the inserted text will appear above the picture. You must add the text as a label afterwards into the picture frame.

Never do that, at least manually with the mouse. You create a very naughty form of direct formatting. Prefer frame styles for stability, reliability and predictability. However frame styles are very complex and extremely sensitive to direct formatting which completely ruins frame layout.

A frame can be positioned anywhere relative to its anchor paragraph (top, left, bottom, right) though “bottom” is buggy. You can even send it anywhere in the page, keeping it still anchored to the paragraph so that the frame “follows” the paragraph should it be moved on another page.

Captioning an image can be done two ways:

  • writing the caption first as part of your text flow
    Thus it has a well defined position in your reading order. You anchor the image to the caption and position it relatively with an ad hoc frame style.
  • using the Insert>Caption built-in feature
    It is quite user-friendly for beginners but has some problems if you need to change the image. Pasting a new one over the previous (to replace it) does not work because the captioning procedure is not recomputed. Frames cannot be positioned relative to one another and they don’t interfere (i.e. you cannot specify a frame-to-frame wrap mode). Consequently, the built-in caption feature creates a text frame with a size for both caption text and image and anchors the image to caption. It gives the illusion that the image is “jailed” inside the text frame. It works as long as you don’t try to play with the image (don’t move it lest it “leaves” the limits of the text frame) or even with the text frame.

Caption prevents full-page image In Background, so that won’t work.

I’m desperately trying to get a demo with just the TOC and the first sections heading, image, and text, but I can’t get it under 8M even after compressing the @#$ out of the image. This is really @#% stressful.

Oh, man, I really AM having a bad day. Updated the wrong file, almost clobbered my original. Anyway, here’s the example ODT. It’s probably fubar at this point.
lanista-vol3_populated_example.odt (129.0 KB)

By definition, “full-page” leaves no room for caption unless it overlaps. And “in background” means text overlays the image.

This is why you must always prepare your images outside Writer. Use a image processing program like GIMP to crop, resize and resample (to 300 dpi) your image. Insert only this processed image into Writer, not the original one. Ideally, Writer should do nothing on the image, accepting it “as is”.

I can have over 120 images per document, so you bet your @#$ I’m doing anything I can with them before they go into LO. The automation is in a state of flux at this point, though, so I had 7M PNGs. I did compress in Writer, but I don’t intend to do that in subsequent volumes.

I’m going come here with my questions more often. Deluging me with best practices is, while a little stressful, a VERY. GOOD. THING

By definition, “full-page” leaves no room for caption unless it overlaps. And “in background” means text overlays the image.

I do want the Section heading to overlay the background image, if that’s possible. I mean, it seems possible, but will that translate to ODT > DOCX > Calibre EPUB/MOBI?

I don’t see anything wrong at this stage apart from direct formatting, notably on vertical spacing with empty paragraphs.

Your bookmark is redundant because text “Section 1” is styled Heading 1. You can retrieve the position with a field referencing Headings.

Your only error is to anchor your image To page. If your TOC develops beyond on page, your image will remain on page 3 and will appear under second part of TOC. IMHO, the image is associated with Section 1 text and consequently must be anchored to this paragraph. Remember that anchor and position (within page= are two independent things. The anchor determines in which page the image appears: the same page as the anchor. Thus, when you request Paragraph, it is in the same page as the paragraph. If you request Page, it immutably remains in the designated page, no matter what happens to your text with edits. Position can be made relative to paragraph (allowing a small image to remain close to the paragraph) or to page (sending it anywhere).

But this works only if you don’t touch the image with the mouse.

I created a new Background Graphics frame style with anchor To paragraph and applied it to the image. (I didn’t ajust image size to 102% as you did in your sample).


lanista-vol3_populated_example.odt (129.1 KB)

How does the hyperlink link to a section header if not a bookmark?
The bookmark is not just for TOC it is also for hyperlinks.

Frames are going to be removed in the conversion to EPUB!

If the image is anchored to Paragraph, it doesn’t take up the full-screen which is what I’m after. Are you saying, tell me once and for all, AM I SOL?!

I’ve already specified these as requirements.

Because a heading implicitly defines a bookmark (in a different category or namespace)

Have you checked this? An image is managed in Writer the same as a frame. Of course, frames don’t exist in DOCX, but images are kept as images and text frames are converted into something like text boxes. All in all, the layout should be kept in DOCX and probably in the final EPUB (except perhaps hyperlinks).

Where have you seen that? The size of the image has nothing to do with its anchor. You may perhaps be confused by word “background”. In Writer it designates the bottommost layer of “objects” (text and geometric shapes live in higher layers). It does not mean the image “becomes” a full-page shape covering the sheet.

In the sample I sent back, I mentioned I didn’t copy exactly your image. I inserted it with its “original” size which is slightly smaller than the page. In your sample, you manually scaled it 102% to cover edge-to-edge. I didn’t rescale the image and this left a white border all around.

Excuse me, but I don’t understand (English is not my native language).