|
3 | 3 | Header and Footer |
4 | 4 | ================= |
5 | 5 |
|
6 | | -In a WordprocessingML document, a page header is text that is separated from |
7 | | -the main body of text and appears at the top of a printed page. The page |
8 | | -headers in a document are often the same from page to page, with only small |
9 | | -differences in content, such as a section title or page number. Such a header |
10 | | -is also known as a running head. |
11 | | - |
12 | | -In book-printed documents, where pages are intended to be bound on the long |
13 | | -edge and presented side-by-side, the header on a right-hand (recto) page is |
14 | | -often different than that on a left-hand (verso) page. Supporting this |
15 | | -difference gives rise to the option to have an even-page header that differs |
16 | | -from the default odd-page header in a document. |
17 | | - |
18 | | -A page footer is analogous in every way to a page header except that it |
19 | | -appears at the bottom of a page. It should not be confused with a footnote, |
20 | | -which is not uniform between pages. For brevity's sake, the term *header* is |
21 | | -often used below to refer to what may be either a header or footer object, |
22 | | -trusting the reader to understand its applicability to both object types. |
23 | | - |
24 | | -In WordprocessingML, a header or footer appears within the margin area of |
25 | | -a page. With a few exceptions, a header or footer may contain all the types |
26 | | -of content that can appear in the main body, including text and images. Each |
27 | | -header and footer has access to the styles defined in ``/word/styles.xml``. |
28 | | - |
29 | | -Each section has its own set of headers and footers, although a section can |
30 | | -be configured to "inherit" headers and footers from the prior section. Each |
31 | | -section can have three header definitions, the default header, even header, |
32 | | -and first page header. When different even/odd headers are not enabled, the |
33 | | -default header appears on both even and odd numbered pages. If even/odd |
34 | | -headers are enabled, the default header is used for odd pages. |
35 | | -A corresponding set of three footer definitions are also possible. All |
| 6 | +In a WordprocessingML document, a page header is text that is separated from the main |
| 7 | +body of text and appears at the top of a printed page. The page headers in a document |
| 8 | +are often the same from page to page, with only small differences in content, such as |
| 9 | +a section title or page number. Such a header is also known as a running head. |
| 10 | + |
| 11 | +A page footer is analogous in every way to a page header except that it appears at the |
| 12 | +bottom of a page. It should not be confused with a footnote, which is not uniform |
| 13 | +between pages. For brevity's sake, the term *header* is often used here to refer to what |
| 14 | +may be either a header or footer object, trusting the reader to understand its |
| 15 | +applicability to both object types. |
| 16 | + |
| 17 | +In book-printed documents, where pages are printed on both sides, when opened, the front |
| 18 | +or *recto* side of each page appears to the right of the bound edge and the back or |
| 19 | +*verso* side of each page appears on the left. The first printed page receives the |
| 20 | +page-number "1", and is always a recto page. Because pages are numbered consecutively, |
| 21 | +each recto page receives an *odd* page number and each verso page receives an *even* |
| 22 | +page number. |
| 23 | + |
| 24 | +The header appearing on a recto page often differs from that on a verso page. Supporting |
| 25 | +this difference gives rise to the option to have an even-page header that differs from |
| 26 | +the default odd-page header in a document. This "both odd-and-even headers" option is |
| 27 | +applied at the document level and affects all sections of the document. |
| 28 | + |
| 29 | +The header appearing on the first page of a section (e.g. a chapter) may differ from |
| 30 | +that appearing on subsequent pages. Supporting this difference gives rise to the option |
| 31 | +to set a distinct first-page header. This "different first-page-header" option is |
| 32 | +applied at the section level and may differ from section-to-section in the document. |
| 33 | + |
| 34 | +In WordprocessingML, a header or footer appears within the margin area of a page. With |
| 35 | +a few exceptions, a header or footer may contain all the types of content that can |
| 36 | +appear in the main body, including text and images. Each header and footer has access to |
| 37 | +the styles defined in ``/word/styles.xml``. |
| 38 | + |
| 39 | +Each section has its own set of headers and footers, although a section can be |
| 40 | +configured to "inherit" headers and footers from the prior section. Each section can |
| 41 | +have three header definitions, the default header, even header, and first page header. |
| 42 | +When different even/odd headers are not enabled, the default header appears on both even |
| 43 | +and odd numbered pages. If even/odd headers are enabled, the default header is used for |
| 44 | +odd pages. A corresponding set of three footer definitions are also possible. All |
36 | 45 | header/footer definitions are optional. |
37 | 46 |
|
38 | 47 |
|
| 48 | +Open Questions |
| 49 | +-------------- |
| 50 | + |
| 51 | +* What about a continuous section break? What is the header/footer behavior there? |
| 52 | + |
| 53 | + |
39 | 54 | Candidate Protocol |
40 | 55 | ------------------ |
41 | 56 |
|
@@ -96,12 +111,12 @@ Conversely, an existing header is deleted from a section by assigning True to |
96 | 111 | >>> header.is_linked_to_previous |
97 | 112 | True |
98 | 113 |
|
99 | | -The document settings object has a read/write |
100 | | -`.odd_and_even_pages_header_footer` property that indicates verso and recto |
101 | | -pages will have a different header. An existing even page header definition is |
102 | | -preserved when `.odd_and_even_pages_header_footer` is False; it is simply not |
103 | | -rendered by Word. Assigning `True` to `.odd_and_even_pages_header_footer` |
104 | | -does not automatically create a new even header definition:: |
| 114 | +The document settings object has a read/write `.odd_and_even_pages_header_footer` |
| 115 | +property that indicates verso and recto pages will have a different header. Any existing |
| 116 | +even page header definitions are preserved when `.odd_and_even_pages_header_footer` is |
| 117 | +False; they are simply not rendered by Word. Assigning `True` to |
| 118 | +`.odd_and_even_pages_header_footer` does not automatically create new even header |
| 119 | +definitions:: |
105 | 120 |
|
106 | 121 | >>> document.settings.odd_and_even_pages_header_footer |
107 | 122 | False |
@@ -174,6 +189,19 @@ Distinct first, even, and odd page headers:: |
174 | 189 | ... |
175 | 190 | </w:sectPr> |
176 | 191 |
|
| 192 | +A header part:: |
| 193 | + |
| 194 | + <w:hdr> |
| 195 | + <w:p> |
| 196 | + <w:pPr> |
| 197 | + <w:pStyle w:val="Header"/> |
| 198 | + </w:pPr> |
| 199 | + <w:r> |
| 200 | + <w:t>Header for section-1</w:t> |
| 201 | + </w:r> |
| 202 | + </w:p> |
| 203 | + </w:hdr> |
| 204 | + |
177 | 205 |
|
178 | 206 | Word Behavior |
179 | 207 | ------------- |
@@ -250,7 +278,7 @@ Schema Excerpt |
250 | 278 | </xsd:complexType> |
251 | 279 |
|
252 | 280 | <xsd:complexType name="CT_HdrFtrRef"> |
253 | | - <xsd:attribute ref="r:id" use="required"/> |
| 281 | + <xsd:attribute ref="r:id" use="required"/> |
254 | 282 | <xsd:attribute name="type" type="ST_HdrFtr" use="required"/> |
255 | 283 | </xsd:complexType> |
256 | 284 |
|
|
0 commit comments