16.5 Special Unit Body Formatting Functions

In addition to the formatting possibilities available with the default special output units formatting presented previously, it is also possible to control completely how a separate special output unit is formatted.

To register body formating user defined functions for special output units (see Output Units), the special output units varieties are used, as described in Table 16.1. Special element body formatting user defined functions are registered with texinfo_register_formatting_special_unit_body:

Function: texinfo_register_formatting_special_unit_body ($special_unit_variety, \&handler)

$special_unit_variety is the element variety (see Table 16.1). \&handler is the user defined function reference.

The call of the user defined functions is:

Function Reference: $text special_unit_body ($converter, $special_unit_variety, \%special_unit)

$converter is a converter object. $special_unit_variety is the unit variety. \%special_unit is the special output unit.

The $text returned is the formatted special output unit body.

To call a special output unit body formatting function from user defined code, the function reference should first be retrieved using special_unit_body_formatting:

Function: \&special_unit_body_formatting = $converter->special_unit_body_formatting ($special_unit_variety)

$special_unit_variety is the special output unit variety. Returns the conversion function reference for $variety, or ‘undef’ if there is none, which should not happen for the special output units described in this manual.

For example:

my $footnotes_element_body
 = &{$converter->special_unit_body_formatting('footnotes')}(
                                   $converter, 'footnotes', $element);

It is possible to have access to the default conversion function reference. The function used is:

Function: \&default_special_unit_body_formatting = $converter->defaults_special_unit_body_formatting ($special_unit_variety)

$special_unit_variety is the special output unit variety. Returns the default conversion function reference for $special_unit_variety, or undef if there is none, which should not happen for the special output units described in this manual.

See Customizing Footnotes for more on footnotes formatting. See Contents and Short Table of Contents Customization for more on the contents and shortcontents formatting. See About Special Output Unit Customization for more on the about special output unit body formatting.