Ask Your Question
0

How do I show section and chapter in header and footer [Solved]

asked 2018-03-22 04:27:20 +0200

jinnicky gravatar image

updated 2018-03-23 16:16:01 +0200

I have documents with major sections each of which has a number of chapters. I would like to put the section name in the header and the chapter name in the footer.

My first thought was to make the sections a heading 1 style and the chapters a heading 2 style. But I can't put heading 2 into the footer

Making a new style for each section is not a viable option

Here is a test document.
C:\fakepath\test-headings.odt

As you can see in page 4 the footer is 'Section 2' where it should be 'Chapter 3'.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2018-03-22 08:03:29 +0200

ajlittoz gravatar image

updated 2018-03-23 11:33:13 +0200

First, let's clear a vocabulary problem. I assume that your "sections" are the main first-level subdivisions of your document and contain then "chapters" as a second-level hierarchy. With this ordering, section heading are "naturally" styled Heading 1 and chapters Heading 2.

The styles are applied to the relevant paragraphs in the text flow.

In the header, you Insert>Fields>Other, tab Document, choosing Type Chapter, Format either Chapter name or another one if you want the number also displayed. Check that Level is 1 to reference the current Heading 1 title.

In the footer, you insert a similar field, but you set Level to 2 to reference the current Heading 2.

But, the captured Heading x is the one active at time of the capture. Said otherwise, you have no problem in the header because the first Heading 1 in the page is used. However, in the footer, you display the last Heading 2 of the page, which may confuse the reader if you have a change in the middle of the page.

Note: when you write

But I can't put heading 2 into the footer

I hope you did not style the text in the footer as Heading 2 . This will never work.

EDIT 2018-03-23

You define your new "sections" with a Heading 1 paragraph. You enabled the Hidden attribute in the style to make it invisible.

As far as I know, the Hidden attribute is meant to remove completely the flagged paragraphs as if they were never inserted. This allows to print several versions of the same document simply by adjusting the attribute. In academics, thinks for instance of the teacher and student books.

Here you attempt a border line usage. I am surprised that it half works, but that may be a side effect of Heading x special properties.

Heading 1: despite being hidden, the heading is entered into the known list of headings but all other effects are disabled as expected (for instance, I added a page break to force your "section" on a new page but it did not work because paragraph is hidden).

Heading 2: bears the page break to right page to force your "chapters" to begin on a new page and, also, enters the heading in the known list.

However, with this scheme, I see two pitfalls.

  • Since your Heading 1 is hidden, your section does not start systematically on a new page. This is what happens in the last page of your "section" 1. The Heading 1 for "section" 2 is part of this page, so that when we reach the footer, this Heading 1 is now the current one. We're already in "section" 2 while you intend it be effective only after the Heading 2 for the new "chapter". Keep with next paragraph could have solved the issue, but it has no effect since the paragraph is hidden and, nevertheless, it is overridden by the page break in Heading 2.

    I experimented with a page ...

(more)
edit flag offensive delete link more

Comments

I meant to say that I tried to put the chapter name level 2 into the footer.

Your explanation of the flow makes a lot of sense. To expand on it a little: a new heading 1 (level 1) will wipe out all the levels 2,3,... Until there is a heading 2, chapter level 2 will show the level 1 or heading 1.

Thanks

jinnicky gravatar imagejinnicky ( 2018-03-22 15:30:47 +0200 )edit

The problem comes with my last sentence.

What I tried was to make heading 1 non-print and heading 2 force a new right page. The problem is that on the last page of my section 1 the footer shows the heading 1 name for section 2 instead of the heading 2 name of the old heading 2 because a new heading 1 wipes out the heading 2.

I still think that there needs to be a way to change the header and footer without having to go through the kludge of new styles.

jinnicky gravatar imagejinnicky ( 2018-03-22 16:56:05 +0200 )edit

This should not be a problem. Attach your file in the original question and I'll have a look at it. I think it's only a matter of placing the page break to the right place.

ajlittoz gravatar imageajlittoz ( 2018-03-22 17:15:48 +0200 )edit
0

answered 2018-03-23 09:04:14 +0200

Kruno gravatar image

updated 2018-03-23 14:04:13 +0200

You should use Heading 1 for sections and Heading 2 for chapters, but make sure you know where to put page brakes. Think this might help.

Is this what you're looking for: fixed-sectioning.odt?

Write your document with Heading 1 representing sections and do not hide them till the very end, hide them just before printing. Check if that works.

edit flag offensive delete link more

Comments

I came up with a different solution because the chapters should force a right page unless they immediately follow a section heading.

So: Heading 1 forces a break to a right page and is centered with a next style of Heading 2a Heading 2 forces a break to a right page Heading 2a is the same as Heading 2 and is level 2 but doesn't force a new page

Thanks for your help

jinnicky gravatar imagejinnicky ( 2018-03-23 16:15:42 +0200 )edit

Then be kind enough to the community by closing your question.

ajlittoz gravatar imageajlittoz ( 2018-03-23 16:19:31 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-03-22 04:27:20 +0200

Seen: 567 times

Last updated: Mar 23 '18