diff options
| author | John MacFarlane <[email protected]> | 2024-12-22 13:18:27 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2024-12-22 13:18:27 -0800 |
| commit | b6aff2145231a7284b47b030c08a6410fb114ec1 (patch) | |
| tree | 7121ea41c9f833b975d9558a2312a8ab6cbb0a14 | |
| parent | ab29a767ff292d41bc6f76da4e02b81b9f298a03 (diff) | |
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.
40 files changed, 13 insertions, 5 deletions
diff --git a/data/docx/word/document.xml b/data/docx/word/document.xml index 475ae1894..aca3487d2 100644 --- a/data/docx/word/document.xml +++ b/data/docx/word/document.xml @@ -189,7 +189,7 @@ Body Text. Body Text Char. </w:r> <w:r> <w:t xml:space="preserve"> - + </w:t> </w:r> <w:r> @@ -207,7 +207,7 @@ Verbatim Char </w:r> <w:r> <w:t xml:space="preserve"> - + </w:t> </w:r> <w:hyperlink r:id="rId30"> @@ -227,7 +227,7 @@ Hyperlink </w:r> <w:r> <w:t xml:space="preserve"> - + </w:t> </w:r> <w:r> @@ -391,6 +391,10 @@ Definition </w:t> </w:r> </w:p> - <w:sectPr /> + <w:sectPr> + <w:footnotePr> + <w:numRestart w:val="eachSect" /> + </w:footnotePr> + </w:sectPr> </w:body> </w:document> diff --git a/data/templates/default.openxml b/data/templates/default.openxml index 000609df7..b86efffa2 100644 --- a/data/templates/default.openxml +++ b/data/templates/default.openxml @@ -64,7 +64,11 @@ $-- sectpr will be set to the last sectpr in a reference.docx, if present $if(sectpr)$ $sectpr$ $else$ - <w:sectPr /> + <w:sectPr> + <w:footnotePr> + <w:numRestart w:val="eachSect" /> + </w:footnotePr> + </w:sectPr> $endif$ </w:body> </w:document> diff --git a/test/docx/golden/block_quotes.docx b/test/docx/golden/block_quotes.docx Binary files differindex abd6fbdf1..d948c834d 100644 --- a/test/docx/golden/block_quotes.docx +++ b/test/docx/golden/block_quotes.docx diff --git a/test/docx/golden/codeblock.docx b/test/docx/golden/codeblock.docx Binary files differindex 302f661ad..a18b27af6 100644 --- a/test/docx/golden/codeblock.docx +++ b/test/docx/golden/codeblock.docx diff --git a/test/docx/golden/comments.docx b/test/docx/golden/comments.docx Binary files differindex 50601caf6..8049a19f3 100644 --- a/test/docx/golden/comments.docx +++ b/test/docx/golden/comments.docx diff --git a/test/docx/golden/custom_style_no_reference.docx b/test/docx/golden/custom_style_no_reference.docx Binary files differindex ea4b7608c..6c488a2f5 100644 --- a/test/docx/golden/custom_style_no_reference.docx +++ b/test/docx/golden/custom_style_no_reference.docx diff --git a/test/docx/golden/custom_style_preserve.docx b/test/docx/golden/custom_style_preserve.docx Binary files differindex c0939143c..dc77bd69a 100644 --- a/test/docx/golden/custom_style_preserve.docx +++ b/test/docx/golden/custom_style_preserve.docx diff --git a/test/docx/golden/custom_style_reference.docx b/test/docx/golden/custom_style_reference.docx Binary files differindex 16c94d068..149b3db55 100644 --- a/test/docx/golden/custom_style_reference.docx +++ b/test/docx/golden/custom_style_reference.docx diff --git a/test/docx/golden/definition_list.docx b/test/docx/golden/definition_list.docx Binary files differindex d4adb9e1b..365f3dd1b 100644 --- a/test/docx/golden/definition_list.docx +++ b/test/docx/golden/definition_list.docx diff --git a/test/docx/golden/document-properties-short-desc.docx b/test/docx/golden/document-properties-short-desc.docx Binary files differindex 1f74335fa..62092834b 100644 --- a/test/docx/golden/document-properties-short-desc.docx +++ b/test/docx/golden/document-properties-short-desc.docx diff --git a/test/docx/golden/document-properties.docx b/test/docx/golden/document-properties.docx Binary files differindex b2685f7c7..2b8c5d79c 100644 --- a/test/docx/golden/document-properties.docx +++ b/test/docx/golden/document-properties.docx diff --git a/test/docx/golden/headers.docx b/test/docx/golden/headers.docx Binary files differindex 678e2a1ca..b772cac90 100644 --- a/test/docx/golden/headers.docx +++ b/test/docx/golden/headers.docx diff --git a/test/docx/golden/image.docx b/test/docx/golden/image.docx Binary files differindex 90be4af5d..fc349dc48 100644 --- a/test/docx/golden/image.docx +++ b/test/docx/golden/image.docx diff --git a/test/docx/golden/inline_code.docx b/test/docx/golden/inline_code.docx Binary files differindex 1bcf6866c..6589c1fae 100644 --- a/test/docx/golden/inline_code.docx +++ b/test/docx/golden/inline_code.docx diff --git a/test/docx/golden/inline_formatting.docx b/test/docx/golden/inline_formatting.docx Binary files differindex bcdaa624e..b427dd7b6 100644 --- a/test/docx/golden/inline_formatting.docx +++ b/test/docx/golden/inline_formatting.docx diff --git a/test/docx/golden/inline_images.docx b/test/docx/golden/inline_images.docx Binary files differindex cff435829..06710261b 100644 --- a/test/docx/golden/inline_images.docx +++ b/test/docx/golden/inline_images.docx diff --git a/test/docx/golden/link_in_notes.docx b/test/docx/golden/link_in_notes.docx Binary files differindex b860f0945..91d8e8c05 100644 --- a/test/docx/golden/link_in_notes.docx +++ b/test/docx/golden/link_in_notes.docx diff --git a/test/docx/golden/links.docx b/test/docx/golden/links.docx Binary files differindex 29b8eb794..9c969c449 100644 --- a/test/docx/golden/links.docx +++ b/test/docx/golden/links.docx diff --git a/test/docx/golden/lists.docx b/test/docx/golden/lists.docx Binary files differindex 777430926..f20b040a8 100644 --- a/test/docx/golden/lists.docx +++ b/test/docx/golden/lists.docx diff --git a/test/docx/golden/lists_9994.docx b/test/docx/golden/lists_9994.docx Binary files differindex a8cb21372..4aedf4077 100644 --- a/test/docx/golden/lists_9994.docx +++ b/test/docx/golden/lists_9994.docx diff --git a/test/docx/golden/lists_continuing.docx b/test/docx/golden/lists_continuing.docx Binary files differindex a24e04fe2..0430c2fd9 100644 --- a/test/docx/golden/lists_continuing.docx +++ b/test/docx/golden/lists_continuing.docx diff --git a/test/docx/golden/lists_div_bullets.docx b/test/docx/golden/lists_div_bullets.docx Binary files differindex 6eafe8cf4..9f26682f1 100644 --- a/test/docx/golden/lists_div_bullets.docx +++ b/test/docx/golden/lists_div_bullets.docx diff --git a/test/docx/golden/lists_multiple_initial.docx b/test/docx/golden/lists_multiple_initial.docx Binary files differindex ec7555793..69b265436 100644 --- a/test/docx/golden/lists_multiple_initial.docx +++ b/test/docx/golden/lists_multiple_initial.docx diff --git a/test/docx/golden/lists_restarting.docx b/test/docx/golden/lists_restarting.docx Binary files differindex 4b72c3668..937898c3f 100644 --- a/test/docx/golden/lists_restarting.docx +++ b/test/docx/golden/lists_restarting.docx diff --git a/test/docx/golden/nested_anchors_in_header.docx b/test/docx/golden/nested_anchors_in_header.docx Binary files differindex 77dcc9f14..e014d263a 100644 --- a/test/docx/golden/nested_anchors_in_header.docx +++ b/test/docx/golden/nested_anchors_in_header.docx diff --git a/test/docx/golden/notes.docx b/test/docx/golden/notes.docx Binary files differindex 045f6e81d..b8466226e 100644 --- a/test/docx/golden/notes.docx +++ b/test/docx/golden/notes.docx diff --git a/test/docx/golden/raw-blocks.docx b/test/docx/golden/raw-blocks.docx Binary files differindex 7f834d67a..c1cd25a0f 100644 --- a/test/docx/golden/raw-blocks.docx +++ b/test/docx/golden/raw-blocks.docx diff --git a/test/docx/golden/raw-bookmarks.docx b/test/docx/golden/raw-bookmarks.docx Binary files differindex 5250f9eaf..39177e14e 100644 --- a/test/docx/golden/raw-bookmarks.docx +++ b/test/docx/golden/raw-bookmarks.docx diff --git a/test/docx/golden/table_one_row.docx b/test/docx/golden/table_one_row.docx Binary files differindex 420adde76..e5c197b63 100644 --- a/test/docx/golden/table_one_row.docx +++ b/test/docx/golden/table_one_row.docx diff --git a/test/docx/golden/table_with_list_cell.docx b/test/docx/golden/table_with_list_cell.docx Binary files differindex 94d5a1ad8..ed5fc1c7d 100644 --- a/test/docx/golden/table_with_list_cell.docx +++ b/test/docx/golden/table_with_list_cell.docx diff --git a/test/docx/golden/tables-default-widths.docx b/test/docx/golden/tables-default-widths.docx Binary files differindex 3cf32fbfd..c21ccdf1e 100644 --- a/test/docx/golden/tables-default-widths.docx +++ b/test/docx/golden/tables-default-widths.docx diff --git a/test/docx/golden/tables.docx b/test/docx/golden/tables.docx Binary files differindex dc7bfe26e..c211984c4 100644 --- a/test/docx/golden/tables.docx +++ b/test/docx/golden/tables.docx diff --git a/test/docx/golden/tables_separated_with_rawblock.docx b/test/docx/golden/tables_separated_with_rawblock.docx Binary files differindex a9e86de00..3206647a7 100644 --- a/test/docx/golden/tables_separated_with_rawblock.docx +++ b/test/docx/golden/tables_separated_with_rawblock.docx diff --git a/test/docx/golden/task_list.docx b/test/docx/golden/task_list.docx Binary files differindex af86040bb..93df73c0b 100644 --- a/test/docx/golden/task_list.docx +++ b/test/docx/golden/task_list.docx diff --git a/test/docx/golden/track_changes_deletion.docx b/test/docx/golden/track_changes_deletion.docx Binary files differindex a1767a5ad..271163e16 100644 --- a/test/docx/golden/track_changes_deletion.docx +++ b/test/docx/golden/track_changes_deletion.docx diff --git a/test/docx/golden/track_changes_insertion.docx b/test/docx/golden/track_changes_insertion.docx Binary files differindex d47b0421f..16b03ea92 100644 --- a/test/docx/golden/track_changes_insertion.docx +++ b/test/docx/golden/track_changes_insertion.docx diff --git a/test/docx/golden/track_changes_move.docx b/test/docx/golden/track_changes_move.docx Binary files differindex 6c45c17bc..0ebc449f7 100644 --- a/test/docx/golden/track_changes_move.docx +++ b/test/docx/golden/track_changes_move.docx diff --git a/test/docx/golden/track_changes_scrubbed_metadata.docx b/test/docx/golden/track_changes_scrubbed_metadata.docx Binary files differindex ff164e527..05d77e294 100644 --- a/test/docx/golden/track_changes_scrubbed_metadata.docx +++ b/test/docx/golden/track_changes_scrubbed_metadata.docx diff --git a/test/docx/golden/unicode.docx b/test/docx/golden/unicode.docx Binary files differindex 360956a27..1794d4d6a 100644 --- a/test/docx/golden/unicode.docx +++ b/test/docx/golden/unicode.docx diff --git a/test/docx/golden/verbatim_subsuper.docx b/test/docx/golden/verbatim_subsuper.docx Binary files differindex 92b6cdb2e..35fdad092 100644 --- a/test/docx/golden/verbatim_subsuper.docx +++ b/test/docx/golden/verbatim_subsuper.docx |
