Commit Graph
832 Commits
Author SHA1 Message Date
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 ea9317c73d Typst template fixes. 2023-12-11 10:18:37 -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
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 5bd301ef45 Typst writer/template: support --toc-depth as in other writers.
Closes #9242.
2023-12-07 14:39:21 -08:00
Ian Max Andolina e562d23bc7 Update default.typst to support csl (#9186)
Typst now supports CSL for its native citation engine, so pandoc
should use a specified `csl` style in the template, falling back to
`bibliographystyle` if `csl` is not specified.

https://typst.app/docs/reference/meta/bibliography/
2023-11-14 19:46:18 -08:00
John MacFarlane bb36f127e2 LaTeX template: include bookmark package unconditionally.
This package produces better PDF bookmarks than hyperref
and does it on the first pass.

As a consequence, we now default to running LaTeX only
once in producing a PDF (instead of twice). If a table
of contents is present, we still have to run three times
to get the page numbers.
2023-11-03 10:40:38 -07:00
John MacFarlane 196bf96932 epub.css: add styling for sup and sub.
Closes #9160.
2023-10-28 09:46:56 -07:00
priiduonu 67ea7cd253 Update et translation 2023-10-01 17:38:16 -04:00
Stephan Daus 11facf72cd Updated Norwegian language translation files
1) Renamed no.yaml (macrolanguage Norwegian) to nb.yaml (Norwegian Bokmål)
2) Created soft symbolic link from no.yaml pointing to nb.yaml.
2023-09-29 09:41:21 -07:00
samuel-weinhardt edbea270f5 Apply style to h6 2023-09-23 22:10:52 -07:00
samuel-weinhardt 957489de85 Format styles 2023-09-23 22:10:52 -07:00
samuel-weinhardt 35b23526b2 Combine identical styles under shared selectors 2023-09-23 22:10:52 -07:00
John Purnell c9fe8b81ca LaTeX template: fix \CSLBlock vertical space 2023-09-10 21:22:54 -07:00
John MacFarlane 0d6a3378b4 Update default.csl to latest chicago-author-date.csl. 2023-09-07 15:43:09 -07:00
John MacFarlane 254e22f3e7 LaTeX template: remove space around \strut in CSL commands.
See #9058.
2023-09-07 15:40:55 -07:00
John MacFarlane d051aa9c9d Fix typo in latex template. 2023-09-07 13:02:25 -07:00
John MacFarlane 6273220449 Adjust default latex template to improve citeproc output.
- Add a strut to avoid inconsistencies in spacing.
- Remove a break at the end of CSLRightInline to avoid
  inconsistencies in spacing. It shouldn't be necessary
  because the paragraph should extend to the right margin.

See #9058.
2023-09-07 09:04:56 -07:00
John MacFarlane b7e1ce422c Rewrite CSLReferences environment...
...to avoid depending on enumitem, which plays badly with
beamer.  Instead we use a regular list environment.
Thanks to @jpcirrus for the concept.

We also restore the pre-3.1.7 format of the CSLReferences
environment, which again has two parameters. The first
determines whether a hanging indent is used (1 = yes, 0 = no),
and the second is the entry line spacing (0 = none).

Closes #9053.
2023-09-05 20:24:20 -07:00
John MacFarlane 4b1fc4de72 LaTeX template: fix regression with CSL display="block".
We no longer got a line break before the block; this restores it.
Closes #7363.
2023-09-04 16:55:47 -07:00
John MacFarlane c017bbed58 LaTeX template: add code allow \cite to break across lines.
Closes #9050.
2023-09-03 15:29:28 -06:00
John MacFarlane 353177f9e7 Use \cite and \bibitem to link up citations, even with citeproc.
See #9031 and discussion in #9020. This will give us better
accessibility; when tagging is enabled, the citation can be
linked to the bibliography entry.

This changes some of the details of the layout and the default
template. We now make CSLReferences a special enumitem list
that will contain `\bibitem`s.

Internal links inside citations to ids beginning in `ref-` are
put inside a `\cite` instead of `\hyperref`.

Closes #9031.
2023-08-29 09:23:50 -07:00
John MacFarlane 65985f5405 LaTeX template: special definition of \st for CJK.
soul's version raises on error on CJK text.
Closes #9019.
2023-08-26 17:18:55 -07:00
John MacFarlane a6fe02f46a Man writer: improvements to code and code blocks.
The aim here (see #9020) is to produce more standard and more
portable man pages.  To that end:

- We revert the fanciness introduced in #7506, which employs a
  custom font name V and a macro that makes this act like boldface
  in a terminal and monospace in other formats.  Unfortunately,
  this code uses a mechanism that is not portable (and does not
  work in mandoc).

- Instead of using V for inline code, we simply use CR.
  Note that `\f[CR]` is emitted instead of plain `\f[C]`,
  because there is no C font in man.  (This produces warnings
  in recent versions of groff.)

- For code blocks, we now use the `.EX` and `.EE` macros,
  together with `.IP` for spacing and indentation.  This gives
  more standard code that can be better interpreted e.g. by mandoc.
2023-08-25 21:35:47 -07:00
John MacFarlane 87716265c1 Man writer: don't emit .hy...
regardless of setting of `hyphenate` variable.  See #9020.
2023-08-24 21:24:33 -07:00
Jackson Schuster cfe8cc7979 Change semicolon to colon 2023-08-13 19:20:47 -07:00
John MacFarlane d3f8f50264 ODT writer: Use a style for Highlighted, so color can be adjusted. 2023-08-06 11:09:04 -07:00
John MacFarlane 0873895416 OpenDocument writer: implement syntax highlighting.
Still unimplemented: global background colors, line numbers.

Closes #6710, obsoletes #6717.
2023-08-04 20:43:39 -07:00
John MacFarlane 5e1b9591e1 Started implementing syntax highlighting for ODT.
Currently only colors are supported, not other text styles.

This change includes a new default opendocumnet template.

See #6710.
2023-08-04 13:31:06 -07:00
John MacFarlane d7c43fda32 Add clause for svg to default CSS for HTML.
Suggested at #8969.
2023-07-26 09:15:24 -06:00
John MacFarlane adba9d460c Make modern AsciiDoc the target for asciidoc.
The AsciiDoc community now regards the dialect parsed by `asciidoctor`
as the official AsciiDoc syntax, so it should be the target of our
`asciidoc` format.

Closes #8936.

The `asciidoc` output format now behaves like `asciidoctor` used to.
`asciidoctor` is a deprecated synonynm. For the old `asciidoc` behavior
(targeting the Python script), use `asciidoc_legacy`.

The templates have been consolidated. Instead of separate
`default.asciidoctor` and `default.asciidoc` templates, there is
just `default.asciidoc`.

Text.Pandoc.Writers.AsciiDoc API changes:

- `writeAsciiDoc` now behaves like `writeAsciiDoctor` used to.
- `writeAsciiDoctor` is now a deprecated synonym for `writeAsciiDoc`.
- New exported function `writeAsciiDocLegacy` behaves like
  `writeAsciDoc` used to.
2023-07-05 09:10:36 -07:00
John MacFarlane 1b52baaf37 Typst writer: consolidate bibliography files...
into one `#bibliography` command. (Separate bibliographies are
not possible.)  Closes #8937.
2023-07-03 08:24:01 -07:00
John MacFarlane 0c9b20cee1 Remove invalid term "Subject" from translations for tr.
Closes #8921.
2023-06-27 09:39:41 -07:00
Per Christian Gaustad fcf19186d4 Add Nynorsk (New Norwegian) translations 2023-06-22 10:49:54 -07:00
John MacFarlane 2c8de4c129 Typst writer: use #footnote for notes.
Closes #8893.
2023-06-05 16:07:36 -07:00
Michael Stahl 16be353077 Writers.ODT: don't add settings.xml
The way "ooo:configuration-settings" work is that if LibreOffice Writer
loads a file in which it exists, it assumes that an old version of
itself has produced it and it defaults any config-item that it knows but
that doesn't exist in the file to the "backward-compatible" value, which
usually means to enable some layout or text formatting bugs so that the
document looks the same as in the old LO version that created it.

If there is no "ooo:configuration-settings" then it will use the default
values for a new document, which should give the best formatting
results.

Pandoc's documents are obviously not created by LO, so it doesn't make
sense to produce ooo:configuration-settings.

Regarding the "ooo:view-settings", IIRC these mainly set to the
document view to the position where the document was last edited (by
default only if the user in meta.xml matches the user data in LO's
configuration), which is also irrelevant for Pandoc.

So just leave out the settings.xml; only content.xml/styles.xml are
required (see ODF 1.3, part 3, 2.2.1 OpenDocument Document, A.2).

(The settings.xml that is produced for formulas by the documentSettings
function hopefully isn't problematic because LO Math works a bit
differently and stores important formatting attributes in settings.xml
because MathML doesn't allow it in content.xml.)
2023-04-28 12:17:22 -07:00
Michael Stahl 60e72b2542 Writers.ODT: don't add Configurations2 dir
This empty file is some ancient OOo wart and it's quite pointless here.
2023-04-28 12:17:22 -07:00
Michael Stahl 54c0c494a2 Writers.ODT: don't add thumbnail
Quite pointless to add a hardcoded image that doesn't show the
document content.
2023-04-28 12:17:22 -07:00
Michael Stahl f3e1d33ea0 Writers.ODT: stop validator complaints by producing ODF 1.3
The ODF validator complains about an invalid attribute
style:contextual-spacing in styles.xml, ultimately an implementation
error in whatever old version of LibreOffice that produced the
data/odt/styles.xml (should have put it into an extension namespace).

Fortunately the attribute was added to ODF 1.3, which was released a
couple years ago.

So the easiest fix is to simply produce ODF 1.3 instead of 1.2; it's
supposed to be fully backward compatible.
2023-04-28 12:17:22 -07:00
Gabriel Lewertowski b21dee8198 add lang attribute to html tag in epub tpl 2023-04-27 16:27:08 -07:00
John MacFarlane d79c53ba12 Fix YAML in translation files for cs and pl.
The colon needs quoting.

Closes #8787.
2023-04-17 11:26:54 -07:00