Commit Graph
18115 Commits
Author SHA1 Message Date
John MacFarlane 0d2114ee4e Markdown writer: improve use of implicit figures when possible.
Closes #10758.

When the alt differs from the caption, but only as regards
formatting, we still use an implicit figure.
2025-04-05 11:32:29 -07:00
John MacFarlane 0cf41697c5 MANUAL.txt: remove "Body Text Char" from list of Word styles...
that can be customized using a reference.docx. This doesn't seem
to be present in pandoc-generated docx files, nor is it a Word default.

Closes #10646.
2025-04-04 21:55:51 -07:00
John MacFarlane 2155b5f9bc Markdown writer: render a figure with Para caption as implicit figure.
Also, when falling back to a Div with class `figure` for a figure
that can't be represented any other way, include a Div with class
`caption` containing the caption.

Closes #10755.
2025-04-04 10:16:23 -07:00
John MacFarlane 84946bf819 MANUAL.txt: add note that alerts extension only works with commonmark.
See #9716.
2025-04-04 10:06:03 -07:00
John MacFarlane 82668ff9aa Typst writer: support mark class on spans.
Closes #10747.
2025-04-01 15:35:22 -07:00
John MacFarlane 69feb5ea9a Ms writer: ensure no line breaks in '.pdfhref O'. 2025-03-31 20:42:42 -07:00
John MacFarlane 2a53e25fac JATS writer: fix escaping for writing-review-editing role.
Closes #10744.
2025-03-31 14:11:34 -07:00
John MacFarlane 5e29f0f770 Fix version number in stack.yaml. 2025-03-31 10:09:01 -07:00
John MacFarlane 099a4ed2e6 stack.yaml - use random-1.3. 2025-03-31 09:57:40 -07:00
John MacFarlane e6974dfecb Require random >= 1.3 and use splitGen.
`split` has been deprecated.
2025-03-31 09:00:42 -07:00
John MacFarlane 3a3fc66726 Use pdf-engine variable instead of extensions...
...to determine what to do about `.pdfhref` macros in `ms`
output.

When no PDF engine is specified, we don't use the `.pdfhref`
macros at all. This gives better results for links in formats
other than PDF, since the link text would simply disappear if
it exists only in a `.pdfhref` macro.

When a PDF engine is specified,  escape the argument of
`.pdfhref O` in a way that is appropriate.

Remove `groff` extension.

Text.Pandoc.Extensions: remove `Ext_groff` constructor.

See #10738.  This revises the earlier commit
3adcb4bd80.
2025-03-29 22:42:22 -07:00
John MacFarlane 021b9cee8d ms template: put PDF-specific things under a conditional.
Don't inculde them if `pdf-engine` isn't set.
2025-03-29 22:39:38 -07:00
John MacFarlane 8016196562 Text.Pandoc.App: set pdf-engine variable.
If `--pdf-engine` is specified or if a PDF is being produced,
we set the `pdf-engine` variable. This allows writers and
templates to behave differently depending on the PDF engine.
2025-03-29 22:37:14 -07:00
John MacFarlane 3adcb4bd80 Allow groff to be used as --pdf-engine with ms.
When `groff` is used as a PDF engine, the `groff` extension
to `ms` is automatically enabled.

Limitations:

- `groff` currently produces larger PDFs than `pdfroff`.
- With `groff`, a table of contents produced with
  `--table-of-contents/--toc` will always be placed at the end of
  the document.
- Certain characters (e.g. Greek characters) may be dropped in
  the PDF outline.

Closes #10738.
2025-03-29 19:31:19 -07:00
John MacFarlane 5de83a4cc5 Add groff extension affecting ms writer.
When this extension is enabled, the `ms` writer won't
escape `.pdfhref O` macros in the way that is required
when `pdfroff` is used (octal-encoded UTF-16).

The extension is not enabled by default.

Text.Pandoc.Extensions: add `Ext_groff` constructor [API change].
2025-03-29 19:30:04 -07:00
John MacFarlane 64cde1a038 ms template: use T rather than P as default font family.
This is more reliable; see #10738.
2025-03-29 18:42:44 -07:00
John MacFarlane 3a0743e815 Org reader: don't include newlines in inine code/verbatim.
Convert newlines to spaces as we do in other formats.
Closes #10730.
2025-03-29 18:36:18 -07:00
Kolen Cheung b526c504ea fix(revealjs)!: upgrade reveal.js to v5 (#10740)
because v4 on unpkg.com is no longer available.
2025-03-29 09:53:55 -07:00
Christian Christiansen 25253bdea4 Add AVIF to Org Reader image extensions (#10736)
AVIF is an image extension. This commit enables the Org reader to recognise
AVIF files as images to be displayed, and not simply links.
2025-03-29 09:22:20 -07:00
Christian Christiansen 6226166647 T.P.Mime: fix typo in avif mime type (#10735)
`impage` -> `image`.
2025-03-28 20:11:49 -07:00
John MacFarlane 3a682a798d Use latest dev citeproc. 2025-03-27 23:04:00 -06:00
John MacFarlane 8e04bab8c1 Release builds: build with ghc 9.8. 2025-03-27 16:11:41 -06:00
John MacFarlane 46399c0abd Ms writer: improve PDF TOC labels.
We now use the plain writer to render these, so that Greek characters
etc. will show up properly.

Note: the ms output this produces works well with pdfroff but not
with `groff -Tpdf`.
2025-03-25 10:24:02 -06:00
John MacFarlane 1f125bdf4e Fix default URL for revealjs in MANUAL.txt. 2025-03-24 23:20:42 -06:00
John MacFarlane 15052fd2fd Docx writer: ensure that figures and tables with custom styles...
...are not dropped.  Closes #10705.
2025-03-23 16:14:54 -07:00
Mohamed Akram e3f31588a3 INSTALL.md: update MacPorts information (#10719) 2025-03-23 16:09:17 -07:00
John MacFarlane 752f198187 T.P.Writers.Roff: use the most compatible form.
The form `\[e aa]` works for groff but not for all roff's (not for
macOS man for instance).  So instead we'll emit `e` followed by
an escape for a unicode combining accent.

See #10716.
2025-03-23 11:14:37 -07:00
John MacFarlane 3bbca20240 Use the most compatible form for roff escapes.
This affects T.P.RoffChar, T.P.Writers.Roff,
and the Man and Ms writers.

That is, `\(xy` instead of `\[xy]`. This was the original AT&T troff
form and is the most widely supported.  The bracketed form causes
problem for some tools, e.g. `makewhatis` on macOS.

Closes #10716.
2025-03-23 10:29:17 -07:00
John MacFarlane 4ab4c62de3 Commonmark Reader: handle GFM math irregularity with braces.
In GFM, you need to use `\\{` rather than `\{` for a literal brace.
Closes #10631.
2025-03-22 10:30:16 -07:00
John MacFarlane 59fb9c40de MediaWiki reader/writer: allow definition on same line as term.
Closes #10708.
2025-03-21 21:54:47 -07:00
John MacFarlane 6b467b55a0 HTML writer: remove trailing slash from default revealjs url.
This avoids a double slash in the URL's path component, which
sometimes causes problems with CDNs. See #8749.
2025-03-21 11:09:58 -07:00
silby 0f71b9e8c4 Skip at most one argument to LaTeX tabular newline (#10707)
In LaTeX's tabular environment, the tabular newline takes an optional
argument that we skip. But it only takes a single optional argument, and
any further square-bracketed text that follows shouldn't be skipped.

Fixes #7512, and also adds a test for the original problem raised in
that issue which was already fixed at some point.
2025-03-19 16:33:19 -07:00
John MacFarlane bfa81a52a5 T.P.Readers.Docx.Util: use xml-lights's onlyElems...
...instead of defining it again.
2025-03-19 09:28:11 -07:00
John MacFarlane 5882f2dae2 Mime: handle apng, avif, jxl.
See #10704.
2025-03-19 08:55:58 -07:00
John MacFarlane 68bb4ae580 Handle percent encoding in pBase64URI.
This improves efficiency. See #10704.
2025-03-18 23:25:39 -07:00
John MacFarlane 93437525a7 Add mime type and extension for avif.
See #10704.
2025-03-18 22:54:25 -07:00
John MacFarlane b5e9ae3595 Fix parsing of base64 data URIs...
...to allow (a) URI escapes, (b) whitespace (which will be ignored).

Partially addresses #10704.
2025-03-18 09:10:59 -07:00
John MacFarlane 3acd8859bd T.P.Writers.Shared: rename surroundInlines -> delimited. 2025-03-17 11:24:38 -07:00
John MacFarlane f717d1bccc Markdown writer: avoid spaces after/before open/close delimiters.
E.g. instead of rendering `x<em> space </em>y` as `x* space *y`
we render it as `x *space* y`.

Closes #10696.
2025-03-17 09:56:49 -07:00
John MacFarlane 6af1459a2b T.P.Writers.Shared: export surroundInlines.
[API change]
2025-03-17 09:56:15 -07:00
John MacFarlane 04476c550f Revert "Default beamer template: only emit \date if set (#10687)"
This reverts commit 3f1f58e96e.

The reason for reverting this change is that it led to an
undesirable behavior change. Documents with no explicit date
specified now have a date printed, because the default
title block will include a date if no `\date` command is used.
The empty `\date{}`, by contrast, suppressed the date, which
is the desirable behavior.

PR #10687 was motivated by the desire to include a custom `\date`
in the frontmatter via header-includes.  I think that aim can
be achieved more simply by simply setting the `date` variable.
In markdown you can even use `date:` in metadata and put some
raw LaTeX there.
2025-03-17 08:48:55 -07:00
John MacFarlane a92f44da42 stack.yaml - go back to tls 2.1.7. 2025-03-16 13:35:35 -07:00
John MacFarlane c21a07a972 Update AUTHORS.md. 3.6.4 pandoc-lua-engine-0.4.1.1 pandoc-cli-3.6.4 2025-03-16 11:52:46 -07:00
John MacFarlane bf9547327b Fix typo in stack.yaml. 2025-03-16 11:04:33 -07:00
John MacFarlane 7140861a0a Makefile - ignore missing upper bounds in cabal check. 2025-03-16 11:00:40 -07:00
John MacFarlane da45a9c76a pandoc-lua-engine to 0.4.1.1, allow latest containers 2025-03-16 10:58:49 -07:00
John MacFarlane d2621b3a69 Update tls version in stack.yaml. 2025-03-16 10:56:51 -07:00
John MacFarlane c2cf5bdc34 Update manual date and generate man pages 2025-03-16 10:54:48 -07:00
John MacFarlane 93e8027d32 Bump to 3.6.4 (also in pandoc-cli), update changelog. 2025-03-16 10:51:27 -07:00
John MacFarlane 5e44f7aa6c Use latest releases of texmath, typst. 2025-03-16 10:50:54 -07:00