We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

Writer: How to add First and last H1 name to Header?

asked 2020-05-26 10:20:25 +0200

free-pg gravatar image

updated 2020-07-12 02:09:03 +0200

Alex Kemp gravatar image

I'm working on a dictionary-styled book for a class, and I'd like it if the header would automatically list the first and last entry on each page of the work.

If I use H1 fields to start each entry, I can tell the header to insert a CHAPTER NAME, and it displays the FIRST h1 entry in the header. Likewise, if I add CHAPTER NAME to the footer, I get the LAST H1 entry on the page.

Is there any way to get the header to show BOTH the first and last h1 field?

That is ... instead of getting "FROG" in the header and "FUSS" in the footer, I'd like to get "FROG - FUSS" in the header.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-05-26 10:36:01 +0200

keme gravatar image

updated 2020-05-26 10:38:56 +0200

A little workaround in this post. See the answer from me (at the time of writing, that is not the accepted solution, but it is the one that works ;-) ).

Insert field in the header as you normally would, and position the footer-anchored frame with the same field to look like a continuation of the header content. Note that as you need the header activated, my instruction to drag the frame will most likely unanchor it from footer and anchor it to header, which defeats its purpose. See @ajlittoz' comment about using the Frame properties dialog to adjust placement.

edit flag offensive delete link more


Hmm.... I'm trying that out, and it's clunky, but it is at least WORKING. I was really hoping there was some way to pull up a field from the footer, or something like this... I mean, the use case of listing the first and last entry on a page can't be THAT uncommon, right?

free-pg gravatar imagefree-pg ( 2020-05-26 11:02:39 +0200 )edit

... the use case of listing the first and last entry on a page can't be THAT uncommon, right?

Quite so. And in LibreOffice (and related software) the only solution I have found is to "pull it up by the anchor", as it were.

keme gravatar imagekeme ( 2020-05-26 11:07:41 +0200 )edit

I just realized there is an easier way to do this... instead of mixing the header with a frame from the footer... I can just create a frame in the HEADER and the FOOTER, then set both to position themselves to about .2" from the top of the page.

Now I just need to hide the unused space of the header and footer ...

free-pg gravatar imagefree-pg ( 2020-05-26 11:11:05 +0200 )edit

@free-pg, it isn't "that uncommon" but implementation is quite simple (and IMHO should remain simple for obvious stability reason). Pages are dynamic and do not exist until needed. When a page break occurs, a footer is created using the current environment (i.e. the current state of the Heading n family). The break is inserted. The first paragraph of the page is checked to see if it is a Heading n, eventually updating the state and the header is created.

It is thus inaccurate to say that the header is set using the first Heading n in the page.It uses in fact what is known at the page break + the first paragraph if it is a Heading n.

ajlittoz gravatar imageajlittoz ( 2020-05-26 11:27:10 +0200 )edit

@free-pg: use other positioning reference than "top of page". Your frame is anchored to the header paragraph, then position it relative to this paragraph and it will automatically adapt when you change the margin widths in the page style.

ajlittoz gravatar imageajlittoz ( 2020-05-26 11:29:27 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-05-26 10:20:25 +0200

Seen: 58 times

Last updated: May 26 '20