Skip to content

Commit b6aff21

Browse files
committed
Docx writer: restart footnotes by section by default.
This can be overridden by a final sectPr element in the body of the reference.docx. It will only change things for `--top-level-division=chapter`, since only top-level chapters are put in separate sections. For that use it will mean that footnote numbers start over with each chapter, which is usually what is wanted. Closes #2773.
1 parent ab29a76 commit b6aff21

40 files changed

+13
-5
lines changed

data/docx/word/document.xml

+8-4
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ Body Text. Body Text Char.
189189
</w:r>
190190
<w:r>
191191
<w:t xml:space="preserve">
192-
192+
193193
</w:t>
194194
</w:r>
195195
<w:r>
@@ -207,7 +207,7 @@ Verbatim Char
207207
</w:r>
208208
<w:r>
209209
<w:t xml:space="preserve">
210-
210+
211211
</w:t>
212212
</w:r>
213213
<w:hyperlink r:id="rId30">
@@ -227,7 +227,7 @@ Hyperlink
227227
</w:r>
228228
<w:r>
229229
<w:t xml:space="preserve">
230-
230+
231231
</w:t>
232232
</w:r>
233233
<w:r>
@@ -391,6 +391,10 @@ Definition
391391
</w:t>
392392
</w:r>
393393
</w:p>
394-
<w:sectPr />
394+
<w:sectPr>
395+
<w:footnotePr>
396+
<w:numRestart w:val="eachSect" />
397+
</w:footnotePr>
398+
</w:sectPr>
395399
</w:body>
396400
</w:document>

data/templates/default.openxml

+5-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ $-- sectpr will be set to the last sectpr in a reference.docx, if present
6464
$if(sectpr)$
6565
$sectpr$
6666
$else$
67-
<w:sectPr />
67+
<w:sectPr>
68+
<w:footnotePr>
69+
<w:numRestart w:val="eachSect" />
70+
</w:footnotePr>
71+
</w:sectPr>
6872
$endif$
6973
</w:body>
7074
</w:document>

test/docx/golden/block_quotes.docx

34 Bytes
Binary file not shown.

test/docx/golden/codeblock.docx

34 Bytes
Binary file not shown.

test/docx/golden/comments.docx

33 Bytes
Binary file not shown.
34 Bytes
Binary file not shown.
31 Bytes
Binary file not shown.
34 Bytes
Binary file not shown.

test/docx/golden/definition_list.docx

32 Bytes
Binary file not shown.
Binary file not shown.
29 Bytes
Binary file not shown.

test/docx/golden/headers.docx

37 Bytes
Binary file not shown.

test/docx/golden/image.docx

35 Bytes
Binary file not shown.

test/docx/golden/inline_code.docx

36 Bytes
Binary file not shown.
34 Bytes
Binary file not shown.

test/docx/golden/inline_images.docx

33 Bytes
Binary file not shown.

test/docx/golden/link_in_notes.docx

30 Bytes
Binary file not shown.

test/docx/golden/links.docx

36 Bytes
Binary file not shown.

test/docx/golden/lists.docx

32 Bytes
Binary file not shown.

test/docx/golden/lists_9994.docx

29 Bytes
Binary file not shown.
35 Bytes
Binary file not shown.
34 Bytes
Binary file not shown.
32 Bytes
Binary file not shown.
34 Bytes
Binary file not shown.
37 Bytes
Binary file not shown.

test/docx/golden/notes.docx

31 Bytes
Binary file not shown.

test/docx/golden/raw-blocks.docx

30 Bytes
Binary file not shown.

test/docx/golden/raw-bookmarks.docx

35 Bytes
Binary file not shown.

test/docx/golden/table_one_row.docx

33 Bytes
Binary file not shown.
33 Bytes
Binary file not shown.
33 Bytes
Binary file not shown.

test/docx/golden/tables.docx

34 Bytes
Binary file not shown.
Binary file not shown.

test/docx/golden/task_list.docx

32 Bytes
Binary file not shown.
32 Bytes
Binary file not shown.
33 Bytes
Binary file not shown.
34 Bytes
Binary file not shown.
Binary file not shown.

test/docx/golden/unicode.docx

35 Bytes
Binary file not shown.
34 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)