From db559e100c02ca1f95953f3eeeca005fdc01b595 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 19 May 2024 10:47:46 -0700 Subject: Allow OpenXML templates to be used with `docx`. The `--reference-doc` option allows customization of styles in docx output, but it does not allow one to adjust the content of the output (e.g., changing the order in which metadata, the table of contents, and the body of the document are displayed), or adding boilerplate text before or after the document body. For these changes, one can now use `--template` with an OpenXML template. (See the default `openxml` template for a sample.) This patch also allows `--include-before-body` and `--include-after-body` to be used with `docx` output. The included files must be OpenXML fragments suitable for inclusion in the document body. Closes #8338 (`--include-before-body`, `--include-after-body`). Closes #9069 (a custom template can be used to omit the title page). Closes #7256. Closes #2928. --- data/templates/default.openxml | 69 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 data/templates/default.openxml (limited to 'data/templates/default.openxml') diff --git a/data/templates/default.openxml b/data/templates/default.openxml new file mode 100644 index 000000000..b002e3496 --- /dev/null +++ b/data/templates/default.openxml @@ -0,0 +1,69 @@ + + + +$if(title)$ + + + + + $title$ + +$endif$ +$if(subtitle)$ + + + + + $subtitle$ + +$endif$ +$for(author)$ + + + + + $author$ + +$endfor$ +$if(date)$ + + + + + $date$ + +$endif$ +$if(abstract)$ + + + + + $if(abstract-title)$ + $abstract-title$ + $else$ + + Abstract + + + $endif$ + + $abstract$ +$endif$ +$for(include-before)$ + $include-before$ +$endfor$ +$if(toc)$ + $toc$ +$endif$ + $body$ +$for(include-after)$ + $include-after$ +$endfor$ +$-- sectpr will be set to the last sectpr in a reference.docx, if present +$if(sectpr)$ + $sectpr$ +$else$ + +$endif$ + + -- cgit v1.2.3