aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2024-09-07 20:29:04 -0700
committerJohn MacFarlane <[email protected]>2024-09-08 08:29:23 -0700
commite589dd62d77d3eb79fcd9428e69c6979c66e733f (patch)
tree193a5c2db4a628a08db35459b9ce1e7682850247
parentbdcbb67168ce67d341f2ee0f9dfad1330735de48 (diff)
Docx writer: Support `--number-offsets`.
-rw-r--r--MANUAL.txt2
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs3
2 files changed, 3 insertions, 2 deletions
diff --git a/MANUAL.txt b/MANUAL.txt
index 865fa8cb1..a17ce00ae 100644
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -1117,7 +1117,7 @@ header when requesting a document from a URL:
`--number-offset` only directly affects the number of the
first section heading in a document; subsequent numbers
increment in the normal way. Implies `--number-sections`.
- Currently this feature only affects HTML output.
+ Currently this feature only affects HTML and Docx output.
`--listings[=true|false]`
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index ec1c682af..d20142e7f 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -94,7 +94,8 @@ writeDocx :: (PandocMonad m)
writeDocx opts doc = do
let Pandoc meta blocks = walk fixDisplayMath doc
setupTranslations meta
- let blocks' = makeSections True Nothing blocks
+ let blocks' = makeSectionsWithOffsets (writerNumberOffset opts)
+ True Nothing blocks
let doc' = Pandoc meta blocks'
username <- P.lookupEnv "USERNAME"