Previously we relied on graphicx internals and made global
changes to Gin to force images to be resized if they exceed
textwidth. This approach is brittle and caused problems
with `\includesvg` (see #9660).
The new approach uses a new macro `\pandocbounded` that is
now defined in the LaTeX template. (Thanks here to Falk Hanisch in
https://github.com/mrpiggi/svg/issues/60.)
The LaTeX writer has been changed to enclose `\includegraphics`
and `\includesvg` commands in this macro when they don't explicitly
specify a width or height.
In addition, the writer now adds `keepaspectratio` to the
`\includegraphics` or `\includesvg` options if `height` is specified
without width, or vice versa. Previously, this was set in the preamble
as a global option.
Compatibility issues:
- If custom templates are used with the new LaTeX writer, they will have
to be updated to include the new `\pandocbounded` macro, or an error
will be raised because of the undefined macro.
- Documents that specify explicit dimensions for an image may render
differently, if the dimensions are greater than the line width or
page height. Previously pandoc would shrink these images to fit,
but the new behavior takes the specified dimensions literally.
In addition, pandoc previously always enforced `keepaspectratio`,
even when width and height were both specified, so images with
width and height specified that do not conform to their intrinsic
aspect ratio will appear differently.
Closes#9660.
- Turn captioned images into Figure elements. Closes#9391.
- Improve the logic for associating elements with captions.
Closes#9358.
- Ensure that captions that can't be associated with an
element aren't just silently dropped. Closes#9610.
...and only include it if `english` or `german` is used.
Since 3d8f011, the babel language is not specified as a
class option any more; so now we need to explicitly specify
the language option when we load `selnolig`. Only `german`
and `english` are valid, so we construct the variable
`selnolig-langs` in the writer and include `selnolig` if it
is nonempty.
This should restore proper ligature suppression when
lualatex is used.
Closes#9863. Supersedes #9864.
Thanks to @fkohrt for the initial fix.
Pandoc used to emit a `header` class on the `tr` element that forms the table header. This is no longer needed, because `head > tr` will do the same thing.
Similarly, pandoc used to emit `even` and `odd` classes on `tr`s, allowing striped styling. This is no longer needed, because one can use e.g. `tbody tr:nth-child(2n)`.
We now omit these classes, which have a good chance of conflicting with classes used for other things.
Closes#9325.
This extends support for fine-grained properties in Typst.
If the `typst:no-figure` class is present on a Table, the table will not be placed in a figure.
If the `typst:figure:kind` attribute is present, its value will be used for the figure's `kind`.
These features are documented in `doc/typst-property-output.md`.
Closes#9777.
Fixes#7473
Previously, `figclass`es weren't being extracted correctly.
`figclass` and `align` annotations are now implemented following the rst docs: these options apply to the figure while other options are passed onto the underlying image.
Previously a Div with an identifier derived from the filename
would be added around the contents of each file. This caused
problems for "chunking" files into chapters, e.g. in EPUB.
We no longer add the surrounding Div. This cooperates better with
chunking. Note, however, that if you have relied on the old
behavior to link to the beginning of the contents of a file using
its filename as identifier, that will no longer work.
Closes#8741.
The Typst writer will pass on specially marked attributes as raw Typst
parameters on selected elements. This allows extensive customization
using filters.
An attribute with key `typst:PROP` will set the PROP parameter on
the corresponding Typst element.
An attribute with key `typst:text:PROP` will set a parameter on a Typst
`#set text()` rule or a text element.
The feature has been implemented for the following elements:
* span text
* div and div text
* table and table text
* table cell and table cell text
It would be possible to support more elements in the future.
A separate document has been added that provides extensive
documentation and examples of the use of this feature.
This applies to both fenced and HTML-ish varieties.
Otherwise we face an exponential performance problem with
backtracking.
This also accords with the behavior of the `fenced_divs`
extension in commonmark.
A warning is issued when a div is implicitly closed.
Closes#9635.
soul commands (`ul`, `hl`, `st`) are very fragile and the math
must be handled specially. In #9597 we improved this for strikethrough
but omitted the other soul environments. This patch generalizes the
fix and a related fix for verbatim (#1294, #5529).
- Link text cannot contain formatting (e.g., `//` is not italics).
Closes#9630.
- An explicitly empty link text (`[[url|]]`) works the same as an omitted
link text. Closes#9632.
Previously the parser just failed if the column width
specified in `p{}` wasn't a multiple of `\linewidth`.
This led to cases where content was skipped.
Now we treat these as ColWidthDefault and silently
parse the table.
A future improvement could be to guess relative column
widths from the dimensions specified, based on a default
line width.
Closes#9579.
Make tokenization sensitive to `\makeatletter`/`\makeatother`.
Previously we just always treated `@` as a letter. This led
to bad results, e.g. with the sequence `\@`. E.g.,
`a\@ b` would parse as "ab" and `a\@b` as "a".
Closes#9555.
Screen readers don't seem to pay attention to an alt attribute on
svg. But they do read the aria-label. So if there's an alt
attribute, we copy its contents to aria-label, unless there is
already an aria-label. This will make pandoc's output with
`--embed-resources` more accessible.
Closes#9525.