Skip to main content

Module handler

Module handler 

Source
Expand description

The content handler that the graphics feature contributes to the floats feature: includegraphics, which accepts exactly one image.

A float type lists by name the content handlers it accepts. A content handler (FloatContentHandler) is a value that accepts a float’s content or refuses it, contributed to the service slot CONTENT_SLOT (flm.floats.content) by the feature that owns that kind of content. This feature owns images, so it contributes HANDLER (includegraphics, IncludeGraphicsContent): it accepts a float’s content where the content is exactly one node of the image element IMAGE_ELEMENT (the body of a figure holding \includegraphics{plot.png} beside its caption and labels), and refuses it otherwise with the words exactly one image, which complete the float’s Error (“a ‘figure’ must hold exactly one image”).

The contribution is a peer contribution: in a registry without the floats feature, no feature declares the slot, the registry build drops the contribution with one Note, and the graphics feature builds and works as it does on its own.

Structs§

IncludeGraphicsContent
The content handler HANDLER (includegraphics): it accepts exactly one image, a node of IMAGE_ELEMENT, and refuses anything else: two images, text, an image beside a paragraph, or no content at all. See the module documentation.

Constants§

HANDLER
The name of the feature’s content handler, includegraphics: the name a float type lists among its handlers to accept one image (FloatType::handlers).