2094 Commits
Author SHA1 Message Date
John MacFarlane fd85560b84 Typst: Use customized term instead of custom macro for def lists. 2023-03-27 10:47:15 -07:00
John MacFarlane cf6a742710 Typst writer: support column aligns in tables. 2023-03-27 10:47:15 -07:00
John MacFarlane 4780b4760d More Typst writer improvements.
+ Update manual with variables for Typst.
+ Split `lang` metadata into separate `lang` and `region` for Typst.
+ Fix label positioning in Divs.
+ Fix text customizations (lang, region, font, size) so they actually
  work.
+ Update tests and man page.
2023-03-26 21:32:31 -07:00
John MacFarlane cd6b3bde62 Typst writer improvements.
+ Fix non-decimal enumerated lists.
+ Fix endnotes ending with code blocks.
+ Improve default template to use a typst template.
+ Factor out definitions and typst template into partials.
+ Properly escape backslash and quote inside double quotes.
+ Update tests.
2023-03-26 19:02:05 -07:00
John MacFarlane 9919d62df2 Moved a misplaced command test. 2023-03-26 11:09:58 -07:00
John MacFarlane 9edf965712 Add typst writer.
See #8713.
2023-03-25 22:05:52 -07: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 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 9a9946e1c4 Update latex writer tests for change to default template. 2023-03-20 11:41:22 -07:00
John MacFarlane 7f1a8f9cee Update docx golden tests for style changes. 2023-03-17 22:27:52 -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 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
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 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 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 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
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
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
Thomas Hodgson 351a8e6c7c URL style in ConTeXt (#8612)
Previously, a URL like this would be in monospace text: `\useURL[url1][https://example.com]`.
Now, it will match the main text unless the `linkstyle` variable is set, which controls the styling of all links.
Closes #8602.

Added documentation for `urlstyle` variable in the ConTeXt template, and added detail to its
documentation in the LaTeX template.
2023-02-12 13:32:40 -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 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 1a7146ba70 Handle % in biblatex doi field.
Closes #8595.
2023-02-01 14:20:05 -08:00
John MacFarlane 58dfc3115a Add some diagnostics to newif test. 2023-02-01 09:17:45 -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 131f546282 Ensure that automatically set variables ...
`pandoc-version`, `outputfile`, `title-prefix`, `epub-cover-image`,
`curdir`, `dzslides-core` can be overridden by `--variable` on the
command line.

Previously they would create lists in the template Context,
which is not desirable.
2023-01-25 09:51:59 -08:00
John MacFarlane 23178ec96e LaTeX reader: Fix bug in macro resolution for environments.
This is a regression in pandoc 3.0 that affects environments
with arguments.  Closes #8573.
2023-01-23 12:48:49 -08:00
John MacFarlane 6ebabd2118 HTML writer: don't omit newlines in task lists. 2023-01-20 10:29:40 -08:00
John MacFarlane 62e14233cd HTML writer: don't disable checkboxes in task lists.
Closes #8562.
2023-01-20 09:53:33 -08:00
Albert Krewinkel 8e688c2b0c Add tests for org tags
These were intended to be part of commit 0cc908519.
2023-01-16 18:21:36 +01:00
Albert Krewinkel ca6d4bfa49 Markdown, CommonMark: add support for wiki links. [API change]
Adds the Markdown/CommonMark extensions `wikilinks_title_after_pipe` and
`wikilinks_title_before_pipe`. The former enables links of style `[[Name
of page|Title]]` and the latter `[[Title|Name of page]]`. Titles are
optional in both variants, so this works for both:
`[[https://example.org]]`, `[[Name of page]]`.

The writer is modified to render links with title `wikilink` as a
wikilink if a respective extension is enabled.

Pandoc will use `wikilinks_title_after_pipe` if both extensions are
enabled.

Closes: #2923
2023-01-15 10:46:55 -08:00
Albert Krewinkel c71d476fa6 ConTeXt writer: support tagging extension [API Change]
Paragraphs are enclosed by `\bpar` and `\epar` commands, and `highlight`
commands are used for emphasis. This results in much better tagging in
PDF output.
2023-01-15 10:03:58 -08:00
Albert Krewinkel 8f394a17f2 Remove Null constructor from docs 2023-01-14 10:10:26 +01:00
John MacFarlane 676a6b1f82 Remove block constructor Null from the code base.
It has been removed from pandoc-types.
2023-01-13 15:20:50 -08:00
Albert KrewinkelandAner Lucero 909ced5153 Support complex figures. [API change]
Thanks and credit go to Aner Lucero, who laid the groundwork for this
feature in the 2021 GSoC project. He contributed many changes, including
modifications to the readers for HTML, JATS, and LaTeX, and to the HTML
and JATS writers.

Shared (Albert Krewinkel):

- The new function `figureDiv`, exported from `Text.Pandoc.Shared`,
  offers a standardized way to convert a figure into a Div element.

Readers (Aner Lucero):

- HTML reader: `<figure>` elements are parsed as figures, with the
  caption taken from the respective `<figcaption>` elements.

- JATS reader: The `<fig>` and `<caption>` elements are parsed into
  figure elements, even if the contents is more complex.

- LaTeX reader: support for figures with non-image contents and for
  subfigures.

- Markdown reader: paragraphs containing just an image are treated as
  figures if the `implicit_figures` extension is enabled. The identifier
  is used as the figure's identifier and the image description is also
  used as figure caption; all other attributes are treated as belonging
  to the image.

Writers (Aner Lucero, Albert Krewinkel):

- DokuWiki, Haddock, Jira, Man, MediaWiki, Ms, Muse, PPTX, RTF, TEI,
  ZimWiki writers: Figures are rendered like Div elements.

- Asciidoc writer: The figure contents is unwrapped; each image in the
  the figure becomes a separate figure.

- Classic custom writers: Figures are passed to the global function
  `Figure(caption, contents, attr)`, where `caption` and `contents` are
  strings and `attr` is a table of key-value pairs.

- ConTeXt writer: Figures are wrapped in a "placefigure" environment
  with `\startplacefigure`/`\endplacefigure`, adding the features
  caption and listing title as properties. Subfigures are place in a
  single row with the `\startfloatcombination` environment.

- DocBook writer: Uses `mediaobject` elements, unless the figure contains
  subfigures or tables, in which case the figure content is unwrapped.

- Docx writer: figures with multiple content blocks are rendered as
  tables with style `FigureTable`; like before, single-image figures are
  still output as paragraphs with style `Figure` or `Captioned Figure`,
  depending on whether a caption is attached.

- DokuWiki writer: Caption and "alt-text" are no longer combined. The
  alt text of a figure will now be lost in the conversion.

- FB2 writer: The figure caption is added as alt text to the images in
  the figure; pre-existing alt texts are kept.

- ICML writer: Only single-image figures are supported. The contents of
  figures with additional elements gets unwrapped.

- HTML writer: the alt text is no longer constructed from the caption,
  as was the case with implicit figures. This reduces duplication, but
  comes at the risk of images that are missing alt texts. Authors should
  take care to provide alt texts for all images.

  Some readers, most notably the Markdown reader with the
  `implicit_figures` extension, add a caption that's identical to the
  image description. The writer checks for this and adds an
  `aria-hidden` attribute to the `<figcaption>` element in that case.

- JATS writer: The `<fig>` and `<caption>` elements are used write
  figures.

- LaTeX writer: complex figures, e.g. with non-image contents and
  subfigures, are supported. The `subfigure` template variable is set if
  the document contains subfigures, triggering the conditional loading
  of the *subcaption* package. Contants of figures that contain tables
  are become unwrapped, as longtable environments are not allowed within
  figures.

- Markdown writer: figures are output as implicit figures if possible,
  via HTML if the `raw_html` extension is enabled, and as Div elements
  otherwise.

- OpenDocument writer: A separate paragraph is generated for each block
  element in a figure, each with style `FigureWithCaption`. Behavior for
  single-image figures therefore remains unchanged.

- Org writer: Only the first element in a figure is given a caption;
  additional block elements in the figure are appended without any
  caption being added.

- RST writer: Single-image figures are supported as before; the contents
  of more complex images become nested in a container of type `float`.

- Texinfo writer: Figures are rendered as float with type `figure`.

- Textile writer: Figures are rendered with the help of HTML elements.

- XWiki: Figures are placed in a group.

Co-authored-by: Aner Lucero <4rgento@gmail.com>
2023-01-13 09:13:27 -08:00
John MacFarlane 8a10300785 HTML style template: put Consolas before Lucida Console for code font.
This is to prevent Lucida Console from being used on Windows, where
there seems to be a spacing issue in some applications, with boldface
glyphs wider than regular ones.

Closes #8543.
2023-01-13 08:47:19 -08:00
lifeunleaded 4746d0c806 Store "unnumbered" class in DocBook role attribute (#8481)
Markdown allows marking a heading as unnumbered, which is stored
as a class token internally. This change will recognize this
particular class token and append it to the role attribute, or
create a role attribute with it if needed. This does not imply
any processing in DocBook but is intended to let customized
stylesheets identify these sections and act accordingly.

Closes #1402
2023-01-12 19:29:53 -08:00
Albert Krewinkel 7f5bd4031b Use jira-wiki-markup 1.5.0
Fixed issues with icon-like sequences at the beginning of words.

Fixes: #8511
2023-01-11 14:55:01 +01:00
Albert Krewinkel b55cd83a60 Update copyright years, it's 2023! 2023-01-10 20:28:27 +01:00
John MacFarlane a682e72c03 Add code { hyphens: manual; } to HTML and EPUB CSS.
Closes #8530.
2023-01-06 10:50:48 -08:00
John MacFarlane 0d891afab6 isURI: don't require non-ASCII characters to be escaped.
Closes #8508.
2023-01-05 21:14:02 -08:00
John MacFarlane 7a82686adc Use \toprule\noalign{} instead of \toprule() in LaTeX tables.
And similar for `\midrule` and `\bottomrule`.

This facilitates redefining `\toprule`, `\midrule`, and `\bottomrule`
without needing to gobble the ()s.

Closes #8223.
2023-01-04 13:57:41 -08:00
John MacFarlane ce7d1d1c20 Man writer: use UTF-8 by default for non-ascii characters.
Only use groff escapes if `--ascii` has been specified on the
command line (`writerPreferAscii`).

Closes #8507.
2022-12-28 17:16:30 -08:00
John MacFarlane 6c96340bf6 Support "software" type in biblatex <-> CSL conversions.
Closes #8504.
2022-12-22 17:30:44 -08:00