Expand description
This module defines the lowering rule image_rule of the graphics
feature, along with what every lowering rule of the image element shares:
the computation of the size at which an image is shown (shown_size),
and the warning UnknownSize, which is reported when this size is
unknown.
The rule image_rule lowers an image, that is, a node of the element
IMAGE_ELEMENT of \includegraphics, to a
flm.pres.image node. The
graphics feature registers this rule for the backends text, html and
latex-rendered. On the backend latex-recomposed, the rule
LATEX_RULE writes an image as a LaTeX hook
(latex).
The payload of the flm.pres.image node (ImagePayload) contains the
following values:
src: the published address of the image, that is, the address at which the output refers to the image. The publish stage of the backend computes this address according to the strategy set for the output (publish), unless a publish stage of your own writes the published table in its place.display: whether the image is a block or inline content. An image is a block when it is a direct child of the body of a float, and inline content everywhere else (GraphicsImage).alt: the alternative text, given with the optionalt.widthandheight: the size at which the image is shown (shown_size).
Each backend writes this node in its own way. For instance, the plain-text
output prints \includegraphics[alt=A plot]{plot.png} as
[image: A plot], and the HTML output writes an <img> element. The
rendering guide describes the output of each backend: images in plain
text, images in
HTML, and images in the rendered
LaTeX.
Structs§
- Image
Rule - The implementation of the lowering rule
image_rulefor one backend. It lowers each image to aflm.pres.imagenode, as the module documentation describes. - Unknown
Size - The warning that is reported when the size of an image is unknown
(
flm.graphics.unknown-size).
Functions§
- image_
rule - Returns the lowering rule
flm.graphics.image.lower.<backend>(rule_name), which lowers each image to aflm.pres.imagenode onbackend, as the module documentation describes. - rule_
name - Returns the name of the lowering rule
image_ruleforbackend:flm.graphics.image.lower.<backend>. - shown_
size - Returns the width and the height at which an image is shown on an output.
A dimension is
Nonewhen it is not set.