Skip to content

Commit

Permalink
Docx writer: restart footnotes by section by default.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jgm committed Dec 22, 2024
1 parent ab29a76 commit b6aff21
Show file tree
Hide file tree
Showing 40 changed files with 13 additions and 5 deletions.
12 changes: 8 additions & 4 deletions data/docx/word/document.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Body Text. Body Text Char.
</w:r>
<w:r>
<w:t xml:space="preserve">

</w:t>
</w:r>
<w:r>
Expand All @@ -207,7 +207,7 @@ Verbatim Char
</w:r>
<w:r>
<w:t xml:space="preserve">

</w:t>
</w:r>
<w:hyperlink r:id="rId30">
Expand All @@ -227,7 +227,7 @@ Hyperlink
</w:r>
<w:r>
<w:t xml:space="preserve">

</w:t>
</w:r>
<w:r>
Expand Down Expand Up @@ -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>
6 changes: 5 additions & 1 deletion data/templates/default.openxml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Binary file modified test/docx/golden/block_quotes.docx
Binary file not shown.
Binary file modified test/docx/golden/codeblock.docx
Binary file not shown.
Binary file modified test/docx/golden/comments.docx
Binary file not shown.
Binary file modified test/docx/golden/custom_style_no_reference.docx
Binary file not shown.
Binary file modified test/docx/golden/custom_style_preserve.docx
Binary file not shown.
Binary file modified test/docx/golden/custom_style_reference.docx
Binary file not shown.
Binary file modified test/docx/golden/definition_list.docx
Binary file not shown.
Binary file modified test/docx/golden/document-properties-short-desc.docx
Binary file not shown.
Binary file modified test/docx/golden/document-properties.docx
Binary file not shown.
Binary file modified test/docx/golden/headers.docx
Binary file not shown.
Binary file modified test/docx/golden/image.docx
Binary file not shown.
Binary file modified test/docx/golden/inline_code.docx
Binary file not shown.
Binary file modified test/docx/golden/inline_formatting.docx
Binary file not shown.
Binary file modified test/docx/golden/inline_images.docx
Binary file not shown.
Binary file modified test/docx/golden/link_in_notes.docx
Binary file not shown.
Binary file modified test/docx/golden/links.docx
Binary file not shown.
Binary file modified test/docx/golden/lists.docx
Binary file not shown.
Binary file modified test/docx/golden/lists_9994.docx
Binary file not shown.
Binary file modified test/docx/golden/lists_continuing.docx
Binary file not shown.
Binary file modified test/docx/golden/lists_div_bullets.docx
Binary file not shown.
Binary file modified test/docx/golden/lists_multiple_initial.docx
Binary file not shown.
Binary file modified test/docx/golden/lists_restarting.docx
Binary file not shown.
Binary file modified test/docx/golden/nested_anchors_in_header.docx
Binary file not shown.
Binary file modified test/docx/golden/notes.docx
Binary file not shown.
Binary file modified test/docx/golden/raw-blocks.docx
Binary file not shown.
Binary file modified test/docx/golden/raw-bookmarks.docx
Binary file not shown.
Binary file modified test/docx/golden/table_one_row.docx
Binary file not shown.
Binary file modified test/docx/golden/table_with_list_cell.docx
Binary file not shown.
Binary file modified test/docx/golden/tables-default-widths.docx
Binary file not shown.
Binary file modified test/docx/golden/tables.docx
Binary file not shown.
Binary file modified test/docx/golden/tables_separated_with_rawblock.docx
Binary file not shown.
Binary file modified test/docx/golden/task_list.docx
Binary file not shown.
Binary file modified test/docx/golden/track_changes_deletion.docx
Binary file not shown.
Binary file modified test/docx/golden/track_changes_insertion.docx
Binary file not shown.
Binary file modified test/docx/golden/track_changes_move.docx
Binary file not shown.
Binary file modified test/docx/golden/track_changes_scrubbed_metadata.docx
Binary file not shown.
Binary file modified test/docx/golden/unicode.docx
Binary file not shown.
Binary file modified test/docx/golden/verbatim_subsuper.docx
Binary file not shown.

0 comments on commit b6aff21

Please sign in to comment.