Commit Graph

844 Commits

Author SHA1 Message Date
Andrew Dunning 6556675ba8 Add footnote block text sample 2025-01-31 09:13:18 -08:00
Andrew Dunning 0e1764ec61 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-01-31 09:13:18 -08:00
Oliver Fabel f20f74512c Fix block headings support for unnumbered paragraphs (#9542)
`block-headings: true` seems to break unnumbered paragraphs and subparagraphs. This is due to the fact, that the unnumbered version uses the star macros \paragraph* and \subparagraph*. See issue #6018 for details.
2024-03-09 08:46:27 -08:00
John MacFarlane 892bcca2c9 Korean translations: delete colon in translation for 'to'.
This was invalid YAML, and not desired anyway, since a colon
is added.
2024-03-03 10:14:25 -08:00
John MacFarlane 5877ec546d Replace polyfill provider in HTML templates.
The PR replaces polyfill.io with cdnjs.cloudflare.com/polyfill.
polyfill.io has been acquired by Funnull, and the service has
become unstable.

This is essentially a cleaned up version of PR #2384 by @SukkaW;
see the PR for more information.
2024-03-01 08:46:10 -08:00
John MacFarlane 8c42926cb2 Add djot reader and writer.
Djot is a light markup syntax (https://djot.net).

This patch adds djot as input and output formats.

API changes:

Add Text.Pandoc.Readers.Djot
Add Text.Pandoc.Writers.Djot
2024-02-13 23:10:42 -08:00
Lawrence Chonavel 7164a238dd ConTeXt template: support font fallback (#9361)
This uses the same YAML options as the LaTeX template.
2024-02-03 10:27:31 -08:00
Max Heller 74f4ae25d2 LaTeX writer: set font fallback for babel main font 2024-01-20 09:47:12 -08:00
lawcho 0110f59053 LaTeX template: support font fallback
* LuaLaTeX-specific (uses luaotfload)
* Configured in YAML metadata
* Sans/main/mono fonts have separate fallback chains
2024-01-19 17:41:27 -08:00
mh4ckt3mh4ckt1c4s dce7f7a6a8 Fix beamer highlighting 2024-01-05 22:26:49 -07:00
John MacFarlane b1a1f04168 ODT/opendocument writers: properly handle highlighting styles.
These styles were going into an office:styles element in content.xml,
but this is invalid.  Instead they must go in styles.xml. See #9287.

The variable `highlighting-styles` no longer has any effect on
the default opendocument template, and highlighting styles are
not included in opendocument output.
2023-12-26 22:12:44 -08:00
John MacFarlane 907b1192d1 Remove html5shiv from default HTML5 template.
I don't think we need to support IE < 9 any more!
2023-12-20 10:10:21 -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 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