40 Commits
Author SHA1 Message Date
Andrew Dunning 2196609989 Add footnote block text sample 2025-05-13 10:31:14 -07:00
Andrew Dunning 3d9d35a371 Remove extra spaces in default reference docx
The line breaks are interpreted as whitespace, resulting in extra leading and trailing spaces in the reference file.
2025-05-13 10:30:53 -07:00
Andrew Dunning 2aeb09f254 Docx title style corrections (#10581)
Base Author and Date styles on Title; remove condensed spacing.
2025-01-31 09:14:01 -08:00
John MacFarlane b6aff21452 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.
2024-12-22 13:18:27 -08:00
John MacFarlane c26211b0c9 Cleaned up Abstract Title and Subtitle in default reference docx.
Center Subtitle, remove color.
2024-05-18 10:50:07 -07:00
John MacFarlane 066d1ba7ef reference.docx: use current standard Word theme.
This includes using the sans-serif font Aptos instead of
the serif font Cambria.

See #7280.
2024-04-13 22:31:20 -07:00
John MacFarlane 14f69c60ef reference.docx: Remove duplicate DefaultParagraphFont in styles.xml. 2024-04-13 22:12:11 -07:00
John MacFarlane e0f37996b3 reference.docx: stay closer to Word's current defaults.
We use the default styles for headings and the title instead
of what pandoc was using.

See #7280.
2024-04-13 18:15:04 -07:00
Edwin Török 7e15ebb2ca reference.docx: fix validation error on w:bCs
```
  {
        "Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:bCs'.",
        "Path": {
            "NamespacesDefinitions": [
                "xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\""
            ],
            "Namespaces": {

            },
            "XPath": "/w:styles[1]/w:style[15]/w:rPr[1]",
            "PartUri": "/word/styles.xml"
        },
        "Id": "Sch_UnexpectedElementContentExpectingComplex",
        "ErrorType": "Schema"
    },
```

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-17 10:07:10 -08:00
Edwin Török 9fba209004 reference.docx: fix validation error on w:b
From OOXMLValidator:
```
    {
        "Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:b'.",
        "Path": {
            "NamespacesDefinitions": [
                "xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\""
            ],
            "Namespaces": {

            },
            "XPath": "/w:styles[1]/w:style[9]/w:rPr[1]",
            "PartUri": "/word/styles.xml"
        },
        "Id": "Sch_UnexpectedElementContentExpectingComplex",
        "ErrorType": "Schema"
    },
```

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-17 10:07:10 -08:00
Edwin Török 8fc8a857e2 reference.docx: fix validation error on doNotTrackMoves
```
{
        "Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:doNotTrackMoves'.",
        "Path": {
            "NamespacesDefinitions": [
                "xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\""
            ],
            "Namespaces": {

            },
            "XPath": "/w:settings[1]",
            "PartUri": "/word/settings.xml"
        },
        "Id": "Sch_UnexpectedElementContentExpectingComplex",
        "ErrorType": "Schema"
    }
```

According to `wml.xsd` the order is:
```
 <xsd:complexType name="CT_Settings">
    <xsd:sequence>
      <xsd:element name="doNotTrackMoves" type="CT_OnOff" minOccurs="0"/>
      [...]
      <xsd:element name="footnotePr" type="CT_FtnDocProps" minOccurs="0"/>
```

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-17 10:07:10 -08:00
Edwin Török 7b5808292c reference.docx: fix validation error on cnfStyle
Error from OOXMLValidator:
```
  {
        "Description": "The required attribute 'val' is missing.",
        "Path": {
            "NamespacesDefinitions": [
                "xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\""
            ],
            "Namespaces": {

            },
            "XPath": "/w:document[1]/w:body[1]/w:tbl[1]/w:tr[1]/w:trPr[1]/w:cnfStyle[1]",
            "PartUri": "/word/document.xml"
        },
        "Id": "Sch_MissRequiredAttribute",
        "ErrorType": "Schema"
    },
```

This is a bitmask where the first bit means 'first row', which is set as
an attribute already.

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-17 10:07:10 -08:00
Edwin Török f48fa9ac17 reference.docx: fix validation error on tblW
```
./tmp/document-pretty.xml:260: element tblW: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}tblW', attribute '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}w': '0.0' is not a valid value of the union type '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_MeasurementOrPercent'.
```

See http://officeopenxml.com/WPtableWidth.php, there is a disagreement
here between standard versions on whether a `%` is required or not when
type=`pct`, but the default is 0 when omitted, so just delete this
entry.

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-17 10:07:10 -08:00
Edwin Török 79204047a5 reference.docx: fix validation error on pStyle
There were 2 `pStyle` for `Abstract`:
```
./tmp/document-pretty.xml:47: element pStyle: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}pStyle': This element is not expected. Expected is one of ( {http://schemas.openxmlformats.org/wordprocessingml/2006/main}keepNext, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}keepLines, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}pageBreakBefore, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}framePr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}widowControl, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}numPr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}suppressLineNumbers, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}pBdr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}shd, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}tabs ).
```

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-17 10:07:10 -08:00
Edwin Török b7e9a6e0a7 reference.docx: Fix validation error on tcBorders
According to `wml.xsd` the order must be:
```
<xsd:sequence>
      <xsd:element name="tcBorders" type="CT_TcBorders" minOccurs="0" maxOccurs="1"/>
      [...]
      <xsd:element name="vAlign" type="CT_VerticalJc" minOccurs="0"/>
```

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-17 10:07:10 -08:00
Edwin Török c0febe86d5 reference.docx: fix validation error, remove extra >
There was an extra `>` which showed up as "character content" in the XML:
```
/tmp/styles-pretty.xml:113: element rPr: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}rPr': Character content other than whitespace is not allowed because the content type is 'element-only'.
```

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-17 10:07:10 -08:00
Edwin Török 39b59af8c9 reference.docx: fix validation error on spacing
```
./tmp/styles-pretty.xml:111: element spacing: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}spacing': This element is not expected. Expected is one of ( {http://schemas.openxmlformats.org/wordprocessingml/2006/main}textDirection, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}textAlignment, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}textboxTightWrap, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}outlineLvl, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}divId, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}cnfStyle, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}pPrChange ).
```

According to `wml.xsd` `spacing` must be placed before `jc`:
```
 <xsd:sequence>
      <xsd:element name="spacing" type="CT_Spacing" minOccurs="0"/>
      [...]
      <xsd:element name="jc" type="CT_Jc" minOccurs="0"/>

```

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-17 10:07:10 -08:00
Edwin Török 6a06f6f608 reference.docx: fix validation error on qFormat
```
./tmp/styles-pretty.xml:30: element qFormat: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}qFormat': This element is not expected. Expected is one of ( {http://schemas.openxmlformats.org/wordprocessingml/2006/main}rPr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}tblPr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}trPr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}tcPr, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}tblStylePr ).
```

According to `wml.xsd` it must come before `pPr`:
```
<xsd:complexType name="CT_Style">
    <xsd:sequence>
      [...]
      <xsd:element name="qFormat" type="CT_OnOff" minOccurs="0"/>
      [...]
      <xsd:element name="pPr" type="CT_PPrGeneral" minOccurs="0" maxOccurs="1"/>
```

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-17 10:07:10 -08:00
John MacFarlane fb4cea44b9 Docx writer: Use different style for block quotes in notes.
Using "Footnote Block Text" for the style name, so it can be
given a different font size if footnotes are.

Closes #9243.
2023-12-08 13:34:33 -08:00
John MacFarlane 80e750aa5e Docx writer: include abstract title.
Closes #8702.

Uses localized term for abstract.
2023-03-17 20:06:17 -07:00
John MacFarlane 31b650b4ec docx writer settings.xml:
- Set zoom to 100% by default.
- Align math options more with current Word defaults (e.g.
  Cambria Math font).
2021-05-15 11:04:53 -07:00
John MacFarlane 2cf971cf56 docx writer: Remove rsids from settings.docx.
Word will add these when revisions are made.  But it's
pointless to start out with a set of them.
2021-05-15 10:54:05 -07:00
John MacFarlane c451207b08 Docx writer: handle table header using styles.
Instead of hard-coding the border and header cell vertical alignment,
we now let this be determined by the Table style, making use of
Word's "conditional formatting" for the table's first row.
For headerless tables, we use the tblLook element to tell Word
not to apply conditional first-row formatting.

Closes #7008.
2021-01-12 09:49:10 -08:00
John MacFarlane 1e84178431 Docx writer: support --number-sections.
Closes #1413.
2020-07-22 11:53:31 -07:00
John MacFarlane 41d1ae0fdd Change styles in reference.docx.
All headings now have a uniform color.

Level-1 headings no longer set `w:themeShade="B5"`.

Level-2 headings are now 14 point rather than 16 point.

Level-3 headings are now 12 point rather than 14 point.

Level-4 headings are italic rather than bold.

Closes #5820.
2019-11-16 09:48:05 -08:00
John MacFarlane e8de53ce4a Change reference.docx to use more normal block quotes.
Indented left and right, same font and size.
Previously it was unindented, smaller font and different
typeface.

See #5820.
2019-11-14 22:20:58 -08:00
John MacFarlane 30033f417f Docx writer: added framework for custom properties.
So far, we don't actually write any custom properties,
but we have the infrastructure to add this.

See #3034.
2018-10-09 10:38:50 -07:00
John MacFarlane 596257f350 Updated reference.docx.
Instead of just "Hello, world", the document now contains
exemplars of most of the styles that have an effect on pandoc
documents.

This makes it easier to see the effect of style changes.

Closes #4175.
2017-12-26 22:02:49 -08:00
John MacFarlane cf3b9a4058 Removed redundant element from data/docx/word/numbering.xml.
The elements we need are generated when the document is
compiled; this didn't do anything.
2017-06-27 12:39:13 +02:00
John MacFarlane 650e1ac1fd Docx writer: Use Table rather than "Table Normal" for table style.
"Table Normal" is the default table style and can't be modified.

Closes #3275, further testing welcome.
2017-05-25 12:11:46 +02:00
Ian b9185b0216 Docx writer: Change FigureWithCaption to CaptionedFigure (#3658)
Edit styles.xml as part of the fix for #3656
2017-05-18 22:34:13 +02:00
John MacFarlane d5086e7bd7 Docx writer: Support 9 levels of headers.
Closes #1642.
2017-03-13 21:48:00 +01:00
Ophir Lifshitz cfa68c689f Reference Docx: Add missing Header 6 style (steel blue)
Based on Header 4 (bold, steel blue) and Header 5 (italic, steel blue)
2015-07-15 19:12:56 -04:00
Ophir Lifshitz c0c7f8377d Reference Docx: Correct outlineLvl for Header styles
Not sure if this actually affects anything
2015-07-15 19:11:01 -04:00
John MacFarlane 2b2f7fe15e Merge pull request #2035 from lierdakil/issue2031
Docx Writer/Reference: Add keepNext to objects w/ captions
2015-03-30 20:30:15 -07:00
Nikolay Yakimov 79be04df69 Add toc heading style to reference.docx 2015-03-29 09:03:33 +03:00
Nikolay Yakimov 78cf36a392 Reference Docx: Add keepNext to table captions 2015-03-29 08:02:23 +03:00
Nikolay Yakimov 69d5085c11 Docx Writer: Add a style to figure images
Figures with empty captions use style "Figure"

Figures with nonempty captions use style "Figure with Caption", which is
based on "Figure", and additionally has keepNext set.
2015-03-29 08:02:18 +03:00
Nikolay Yakimov d20add5b01 Reference Docx: update word/footnotes.xml 2015-03-29 05:59:09 +03:00
Nikolay Yakimov 1710c4bd8b Add unpacked reference data 2015-03-28 10:26:08 -07:00