Commit Graph
17054 Commits
Author SHA1 Message Date
John MacFarlane c9bf4da74f Docx writer: ensure that elements in settings are ordered correctly.
The elements must occur in a specific order. This was being
messed up when integrating a custom reference.docx. Closes #9264.
2023-12-17 17:03:14 -08:00
John MacFarlane 3abbf97d0b Docx writer: don't emit empty rows.
These (`<w:tr />`) seem to cause problems for word. Closes #9224.
2023-12-17 11:32:27 -08:00
Edwin Török 5875de3f86 test/docx/golden: regenerate
Using `make test TESTARGS=--accept`

Signed-off-by: Edwin Török <edwin@etorok.net>
2023-12-17 10:07:10 -08: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 c3038dcd54 Bump to 3.1.11, update changelog.
pandoc-cli version is updated in sync.
man pages regenerated.
3.1.11 pandoc-cli-3.1.11
2023-12-15 18:56:27 -08:00
John MacFarlane 0f5435a46d Depend on released typst 0.5. 2023-12-15 18:38:39 -08:00
John MacFarlane 9f43da7f81 Logging: add MakePDFWarning constructor to LogMessage.
[API change]

Use this to pass LaTeX warnings on to user as warnings.
2023-12-15 12:23:33 -08:00
John MacFarlane 04acb3f7f7 Logging: add MakePDFInfo constructor to LogMessage.
[API change]

Use this with `report` in Text.Pandoc.PDF instead of manually
writing to stderr.
2023-12-15 11:16:46 -08:00
John MacFarlane bd8e31708a PDF: Refactored PDF generation via LaTeX. 2023-12-15 10:23:41 -08:00
John MacFarlane 53fbce09be Text.Pandoc.PDF: parse logs to determine whether additional runs needed.
Previously we ran a fixed number of times. Closes #9255.
2023-12-15 10:02:26 -08:00
John MacFarlane fd73880a87 Typst writer: emit ; after typst code...
unless followed by space.  Otherwise there's the potential
that the typst code will swallow up a following character.
Closes #9252.
2023-12-14 12:28:04 -08:00
John MacFarlane 272117f112 Use dev version of typst. 2023-12-14 11:55:15 -08:00
John MacFarlane b46d00343a Depend on texmath 0.12.8.6.
This gives us less verbose typst math output.
2023-12-12 19:08:30 -08:00
John MacFarlane 040f3e3e6b Minor changes to release checklist 2023-12-12 19:08:24 -08:00
John MacFarlane 24c50b9730 Makefile: add check that pandoc-cli depends on exact version of pandoc. 2023-12-12 13:40:42 -08:00
John MacFarlane 708bfa5c27 Regenerate man pages with pandoc 3.1.10.
This properly escapes hyphens.
Also, we get proper version numbers in pandoc-server and pandoc-lua.

The Makefile has already been modified to ensure that all three
man pages will be regenerated when there is a new version of pandoc.
2023-12-12 13:33:59 -08:00
John MacFarlane 6e8fcda326 Makefile: add more prerelease checks.
Check for agreement of pandoc and pandoc-cli version.
Check for presence of changelog entry for this version.
Check that man pages specify this version.
2023-12-12 13:33:00 -08:00
John MacFarlane 257d5cba7a stack.yaml - bump commonmark-extensions version. pandoc-cli-3.1.10 pandoc-server-0.1.0.4 3.1.10 2023-12-12 09:29:52 -08:00
John MacFarlane c41f11a12d Cirrus build: set path so it finds ghc 9.6. 2023-12-12 09:11:43 -08:00
John MacFarlane a29049bd76 Fix man page locations in linux and macos package build scripts.
man pages have moved to pandoc-cli/man.
2023-12-11 23:08:40 -08:00
John MacFarlane 4a5e5a4c90 Cirrus build: use ghc 9.6 on macos. 2023-12-11 23:04:44 -08:00
John MacFarlane b98f3eda19 update AUTHORS.md 2023-12-11 22:21:47 -08:00
John MacFarlane 4abf9a28e9 stack.yaml - update toml-parser 2023-12-11 22:19:08 -08:00
John MacFarlane 3d4a6cc4a7 Whitespace fix. 2023-12-11 22:13:27 -08:00
John MacFarlane df403fb3ea Update MANUAL.txt date and man page date. 2023-12-11 22:12:53 -08:00
John MacFarlane e9be7ea451 Bump pandoc/pandoc-cli to 3.1.10, update changelog. 2023-12-11 22:10:56 -08:00
John MacFarlane 705e3e6aaf pandoc-server: bump to 0.1.0.4. 2023-12-11 22:10:38 -08:00
John MacFarlane 4b6fe06ba9 Fix duplicate entry in stack.yaml. 2023-12-11 12:43:53 -08:00
John MacFarlane 4243ae841a Use released versions of commonmark, commonmark-extensions, commonmark-pandoc. 2023-12-11 12:01:30 -08:00
John MacFarlane 55e3bf4ba7 Use texmath 0.12.8.5. 2023-12-11 11:13:31 -08:00
John MacFarlane 14e44385e3 Typst reader: don't include metadata from document element.
The problem is that typst doesn't print this metadata; it is only
used in PDF properties. The title, authors, and so on are represented
in the typst document (and there is no standardized method like
LaTeX's `\maketitle`).  So if we parse this as metadata then converting
a typst document will likely lead to a double title.
2023-12-11 10:44:10 -08:00
John MacFarlane ea9317c73d Typst template fixes. 2023-12-11 10:18:37 -08:00
John MacFarlane 3039f99f3b Depend on released version of typst. 2023-12-10 23:59:19 -08:00
John MacFarlane 42091d1e13 Typst reader: parse metadata from document element. 2023-12-10 12:56:59 -08:00
John MacFarlane b0e8e99c83 Typst reader: add state fields for metadata. 2023-12-10 11:50:25 -08:00
John MacFarlane 8c90b46d8b Typst reader: support sys.version. 2023-12-10 11:22:08 -08:00
John MacFarlane 74b4e10125 Use latest dev typst-hs. 2023-12-10 11:00:42 -08:00
John MacFarlane 2a09252014 LaTeX writer: Add performance optimization to #9168.
We only walk the tree to raise big notes if the document
contains big notes (it is fast to check).  The removes the
slight performance penalty of #9168 for most documents.
2023-12-10 09:54:26 -08:00
John MacFarlane 61314a02df Benchmark: use standalone documents for reader tests.
Otherwise typst reader test fails.

Note: this means that we are now parsing longer documents,
so bench results on readers won't be comparable to before.
2023-12-10 09:53:40 -08:00
Hikaru Ibayashi 3be253fb90 LaTeX writer: fix bug with big footnotes inside emphasis (#9168)
Closes #8982.
2023-12-10 09:29:45 -08:00
John MacFarlane aa95770743 Typst writer: use quote for block quotes.
Remove custom definitiion of blockquote in default template.
2023-12-09 23:23:15 -08:00