15.5 Special Element Body Formatting Functions

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

To register body formating user defined functions for special element (see Output Element Units), the special elements varieties are used, as described in Table 15.1. Special element body formatting user defined functions are registered with texinfo_register_formatting_special_element_body:

Function: texinfo_register_formatting_special_element_body ($special_element_variety, \&handler)

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

The call of the user defined functions is:

Function Reference: $text special_element_body ($converter, $special_element_variety, \%element)

$converter is a converter object. $special_element_variety is the element variety. \%element is the Texinfo element.

The $text returned is the formatted special element body.

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

Function: \&special_element_body_formatting = $converter->special_element_body_formatting ($special_element_variety)

$special_element_variety is the special element variety. Returns the conversion function reference for $variety, or ‘undef’ if there is none, which should not happen for the special elements described in this manual.

For example:

my $footnotes_element_body
 = &{$converter->special_element_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_element_body_formatting = $converter->defaults_special_element_body_formatting ($special_element_variety)

$special_element_variety is the special element variety. Returns the default conversion function reference for $special_element_variety, or undef if there is none, which should not happen for the special elements 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 Element Customization for more on the about special element body formatting.