10.4.5.1 Sectioning Commands Elements and Document Structure

The following keys of the extra sectioning elements hash can be interesting in user-defined formatting and conversion functions:

section_level

The level of the section, taking into account @raisesections and @lowersections. Level 0 corresponds to @top or @part and level 1 to @chapter level sectioning commands. See Raise/lower sections in Texinfo.

Most of the information on document structure associated to a sectioning command tree element is available in the sectioning command relations information associated to the sectioning command tree element. This is an hash reference obtained by calling converter_section_relations_of_section:

Function: \%section_relations = $converter->converter_section_relations_of_section (\%element)

Return the sectioning command relations information associated to the sectioning command tree element \%element, or ‘undef’ if it cannot be found4.

The following keys are in section relations hash references:

element

The sectioning command Texinfo tree element associated to the section relations.

associated_node

Node relations information corresponding to the node associated to the sectioning command.

associated_part

Part @-command relations information of the @part preceding the sectioning command.

section_children

The children of the section relations element in the sectioning tree. These children are also section relations.

section_directions

Hash reference with up, next and prev keys associated to the corresponding section relations directions.

toplevel_directions

Hash reference with up, next and prev keys associated to toplevel sectioning relations directions, for elements like @top, @chapter, @appendix, not taking into account @part elements.

part_associated_section

For @part tree elements only. Sectioning command relations following the @part.

part_following_node

For @part tree elements only. Node relations of the node associated to the @part.

Sections relations can also be retrieved by calling $document->sections_list() on the $document obtained through get_info (see Converter General Information).


Footnotes

(4)

If there is a document associated to the converter and the tree element is actually a sectioning command tree element, the relations information should always be found.