Commit Graph
8318 Commits
Author SHA1 Message Date
John MacFarlane 2a1d5c49d0 Support typst as a pdf-engine. 2023-03-26 10:25:07 -07:00
John MacFarlane 9edf965712 Add typst writer.
See #8713.
2023-03-25 22:05:52 -07:00
Albert Krewinkel cf8370f4e5 T.P.App.CommandLineOptions: don't lowercase arg to --from/--read
This prevented users to use custom writers with uppercase characters in
their filenames. Format-normalization, including lower-casing of
format identifiers, happens during format parsing.
2023-03-23 07:08:45 +01:00
Christian Christiansen fe720dd0c6 Org reader: Allow zero width space as an escape character
Allow the character U+200B to be used as an escape character as described
in the Org-mode documentation https://orgmode.org/manual/Escape-Character.html

Closes issue #8716.
2023-03-22 18:29:53 +01:00
Andres Freund 821cf3df4d DocBook reader: handle "book" for xref references
This also adds a test xref to book and part. See also 4ea0508e6 / #8712.
2023-03-22 08:32:48 -07:00
John MacFarlane 4ea0508e68 DocBook reader: handle <part>.
Closes #8712.
2023-03-21 19:06:04 -07:00
Albert Krewinkel f1b55be65f T.P.Format: add new function formatFromFilePaths [API Change] (#8710)
* T.P.Format: export `formatFromFilePaths` [API change]
* Lua: add function `pandoc.format.from_path`
* Update lua-filters.md
* The old T.P.App.FormatHeuristics module has been removed.

This is an alternative to #8693.
2023-03-20 21:19:16 -07:00
John MacFarlane b5d54f7f38 HTML reader: fix behavior with -native_spans-raw_html.
Previously with this configuration, `<span>`s were not treated
as inline elements at all.

Closes #8711.
2023-03-20 19:42:43 -07:00
John MacFarlane 01dd910d9a HTML writer: Remove redundant nubOrd.
Now that we're doing `nubOrd` on classes at the end (when changing
pandoc attributes to HTML attributes), we don't need to do it here.
2023-03-20 11:41:59 -07:00
John MacFarlane df9418c819 Remove superfluous import. 2023-03-20 11:41:48 -07:00
John MacFarlane 87ff4d63d1 HTML writer: avoid duplicate classes.
Closes #8705.
2023-03-20 07:59:38 -07: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 774e3be265 HTML writer: use img element instead of embed for .svg.gz...
and .png.gz etc.

Closes #8699.
2023-03-15 09:15:01 -07:00
John MacFarlane 1bfab1d11e HTML writer footnotes changes:
When `--reference-location=section` or `=block`, use an
`aside` element for the notes rather than a `section`.

When `--reference-location=section`, include the `aside`
element inside the section element, rather than outside.
(In slide shows, this option causes footnotes on a slide
to be displayed at the bottom of the slide.)

Closes #8695.
2023-03-14 21:49:05 -07:00
John MacFarlane 03d80ccd38 Remove confusing comment. 2023-03-14 19:36:36 -07:00
Albert Krewinkel effca7f7cf Markdown writer: use implicit figures if there's a caption but no alt.
Closes: #8689
2023-03-14 07:22:11 +01:00
Albert Krewinkel 51750d6d9a Jira reader: add panel title as nested div
The title of a jira panel is added in a nested div as the first element
of the div panel.

Fixes: #8681
2023-03-13 17:31:12 +01:00
John MacFarlane 5b78210ebe LaTeX writer: Add Chinese to Babel languages. 2023-03-10 13:52:12 -08:00
John MacFarlane 1643225cdd Ms writer: fix handling of Figure.
The Ms writer was never updated to handle the new
Figure element now produced by the markdown reader.

See #8660.
2023-03-08 09:24:13 -08:00
John MacFarlane 92b3179e49 HTML writer: Use different structure for epub footnotes. (#8676)
Many EPUB readers are thrown off by pandoc's current footnote
output.  Both the ol and the fact that the footnote backlink is
at the end of the note seem to pose problems.

With this commit, we now create a list of aside (or div) elements,
instead of an ordered list. Each element begins with a note number
that is linked back to the note reference.  (So, the backlink occurs
at the beginning rather than the end.)

References:

- https://kindlegen.s3.amazonaws.com/AmazonKindlePublishingGuidelines.pdf
- http://kb.daisy.org/publishing/docs/html/notes.html

See #8672, closes #5583.

Thanks to @Porges and @lewer.
2023-03-08 09:21:43 -08:00
John MacFarlane dd50fef01f ICML writer: fix images with data.
The Contents element should be inside Properties.  Closes #8675.
2023-03-07 17:04:58 -08:00
John MacFarlane 118dd92232 JATS reader: avoid generating duplicate figure captions.
Closes #8669.
2023-03-05 12:44:44 -08:00
John MacFarlane 2dd645e26e DocBook reader: parse figure as a Figure element in the AST.
Closes #8668.
2023-03-05 12:23:32 -08:00
John MacFarlane 8898c5336d Asciidoc writer: Properly escape | in table cells.
Closes #8665.
2023-03-03 18:14:06 -08:00
John MacFarlane 19e4adaeb5 EPUB reader: Give additional information in error...
if the epub zip container can't be unpacked.

See #8663.
2023-03-02 08:24:00 -08:00
John MacFarlane 52ef7cac7c Fix shadowing from last commit. 2023-03-01 10:48:04 -08:00
John MacFarlane 6b906879af Make sure TSV reader doesn't gobble tabs as whitespace.
Closes #8661.
2023-03-01 09:25:31 -08:00
Albert Krewinkel c8147fc583 Org reader: accept empty tables
Fixes: #8659
2023-03-01 12:20:47 +01:00
John MacFarlane 5ef944a006 LaTeX table parser: also allow 6*c in column spec.
With no braces around `c`.
See #8658.
2023-02-28 10:22:52 -08:00
John MacFarlane 536f72ba11 LaTeX reader: fix multiplication syntax for tabular.
We recognized `*{6}{...}` but not `*6{...}`.

Closes #8658.
2023-02-28 09:21:33 -08:00
John MacFarlane b81ead43e0 RST reader: align with spec in syntax for role names.
In particular, we now allow colons in row names.

Closes #8653.
2023-02-24 09:55:25 -08:00
John MacFarlane 56d0aaadd3 Trap error in getAppUserDataDirectory.
This can raise an error if pandoc is run in a non-user environment.
Closes #8648.
2023-02-22 14:21:32 -08:00
Albert Krewinkel 0088b776bc LaTeX writer: do not use longtable foot with Beamer
The table foot is made part of the table body, as otherwise it won't
show up in the output. The root cause for this is that longtable cannot
detect page breaks in Beamer.

Fixes: #8638
2023-02-22 09:26:26 +01:00
John MacFarlane 5d00cbed64 HTML writer: allow "track" element to be treated as block-level HTML.
Closes #8629.
2023-02-18 21:14:31 -07:00
Albert Krewinkel ff20354c58 Docx reader: parse image alt texts in LibreOffice generated files
LibreOffice tags images slightly differently than Word; this change lets
the parses take that difference into account when looking for an image
description (alt text).
2023-02-18 00:09:21 +01:00
Albert Krewinkel d08d1c04c5 JATS writer: include alt-text in <graphic>, <inline-graphic> elements
Closes: #8631
2023-02-18 00:09:21 +01:00
Pavol Otto da9c196e09 fixed <xref> references to tables in DocBook files
Closes #8626.
2023-02-15 15:51:51 -08:00
John MacFarlane 5889d70a97 Retain metadata in processing sections for chunked HTML.
Previously we suppressed metadata in all but the top page,
in order to prevent the title block from being printed
on every page. This prevented use of custom variables set
by metadata fields.

This commit moves to a better solution: a conditional
in the default template restricts the title block to the
top page.

Closes #8620.
2023-02-15 15:48:11 -08:00
John MacFarlane fd3b955fe5 Remove unnecessary pragmas. 2023-02-15 15:47:43 -08:00
John MacFarlane 6c934abe6d Citeproc: Fix bug in metaValueToReference.
This bug caused us to get some repeated content when converting
MetaBlock to Inlines.  Closes #8611.
2023-02-09 20:02:39 -08:00
Albert Krewinkel 6f83099f6e PPTX writer: fix handling of simple figures
This ensures that simple figures are displayed in the same way as before
the introduction of a dedicated `Figure` constructor in the AST.

Closes: #8565
2023-02-09 21:45:03 +01:00
Albert Krewinkel 9eee4a2582 Lua: add field chunk_template to WriterOptions objects [API change]
The PathTemplate type exported from Text.Pandoc.Chunks is now an
instance of the ToJSON and FromJSON classes.

Closes: #8607
2023-02-09 08:15:13 +01:00
Albert Krewinkel a197b57c0a LaTeX writer: include short figure/table caption if one is given.
Short captions are used by LaTeX when generating a the list of figures
or list of tables. Adding a short caption will now overwrite the full
caption in these lists.
2023-02-05 13:09:51 +01:00
John MacFarlane ee51696e13 Improve handling of % in bib(la)tex parsing.
bibtex/biblatex seem to pass through an unescaped `%` inside
braces or quotes; it won't escape the closing brace.

So we'll do the same. This prevents the need for our previous
special treatment of url and doi fields.

Closes #8597.
2023-02-04 10:24:13 -08:00
John MacFarlane 1a7146ba70 Handle % in biblatex doi field.
Closes #8595.
2023-02-01 14:20:05 -08:00
John MacFarlane 8fc4fc66a3 Add new --chunk-template option (closes #8581).
* Add `--chunk-template` CLI option, allowing more control over the
  chunk filenames in chunked HTML output.
* Text.Pandoc.App: Add `optChunkTemplate` constructor to Opt [API change].
* Text.Pandoc.Options: add `writerChunkTemplate` contsructor to
  WriterOptions [API change].
* Text.Pandoc.Chunks: add Data, Typeable, Generic instances for
  PathTemplate.
2023-01-30 21:09:02 -08:00
Stephen Altamirano 1193bb5964 Add support for Textile footnote backlinks (#8585)
Backlinking from footnotes is already the behavior of `Note` values
when writing HTML. This adds parsing support for the explicit
backlinking syntax in Textile as described here:
https://textile-lang.com/doc/footnotes

Previously, these lines would be interpreted as a new paragraph
beginning with "fn3^." in text.
2023-01-29 19:10:48 -08:00
Daniel Kessler 9dbb75dacb ODT reader: fix blockquote indent detection
The ODT reader is supposed to detect blockquotes by checking a paragraph
style's indentation level. But it's broken for two reasons:

* The parser fails on non-integers. So "1in" will get read as 25mm, but
  "1.0in" fails. By default, the Quotations style is "0.3937in".
* The reader doesn't check indentation levels of parent styles.
  In my test documents, LibreOffice often creates child styles for
  individual paragraphs, so it's important to check parents (ODT files
  created by the Pandoc ODT writer don't have this issue though).

I added a new test "blockquote2" whose ODT file is generated directly
from the corresponding Markdown file with pandoc.

Fixes #3437.
2023-01-29 16:40:32 -08:00
John MacFarlane 845894592a Fix 3.0 regression with --print-highlight-style option.
Closes #8586.
2023-01-29 10:53:45 -08:00
John MacFarlane 49c8bd0a2e Textile reader: don't allow brackets in URLs.
Closes #8582.
2023-01-28 09:08:03 -08:00