# -*-perl-*- ###################################################################### # # File: t2h_singular.init init file for singular t2h # use strict; my $T2H_BLUE_BUTTONS = 0; # we only redefine things which ar of relevance to singular # all the others we simply "include" # Set the output file prefix, prepended to all .html, .png and .pl files. texinfo_set_from_init_file('setfilename', 'sing'); # add html and tex to expanded formats. html should be redundant. texinfo_add_to_option_list('EXPANDED_FORMATS', ['html', 'tex']); # if set, creates one html file per node texinfo_set_from_init_file('SPLIT', 'node'); # we use .htm, but not for external references, both as target and # source. my $external_extension = 'html'; texinfo_set_from_init_file('EXTERNAL_CROSSREF_EXTENSION', $external_extension); #if set cross-references use the xref node name argument texinfo_set_from_init_file('XREF_USE_NODE_NAME_ARG', 1); # if set, chatter about what we are doing texinfo_set_from_init_file('VERBOSE', 1); my $T2H_SING_base_images = '../singular_images/'; # inside
texinfo_set_from_init_file('BODYTEXT','lang="en" background="'.${T2H_SING_base_images}.'Mybg.png"'); # after texinfo_set_from_init_file('AFTER_BODY_OPEN', "\n"); # before texinfo_set_from_init_file('PRE_BODY_CLOSE', "\n"); # there is a redefinition of about special element body formatting # function to replace the text at the same place as PROGRAM_NAME_IN_ABOUT. texinfo_set_from_init_file('PROGRAM_NAME_IN_ABOUT', 0); # if using tex4ht, must be in latex mode due to \textbf $Texinfo::TeX4HT::STYLE='latex'; # title is already in the manual #$print_title = \&T2H_DEFAULT_print_title; texinfo_set_from_init_file('SHOW_TITLE', 0); # footer texinfo_register_formatting_function('format_element_footer' , \&singular_format_footer); sub singular_format_footer($$$$) { my $self = shift; my $type = shift; my $element = shift; my $content = shift; my $end_page = (!$element->{'structure'}->{'unit_next'} or (defined($element->{'structure'}->{'unit_filename'}) and $element->{'structure'}->{'unit_filename'} ne $element->{'structure'}->{'unit_next'}->{'structure'}->{'unit_filename'} and $self->count_elements_in_filename('current', $element->{'structure'}->{'unit_filename'}) == 1)); if ($self->element_is_tree_unit_top($element)) { my $buttons = $self->get_conf('TOP_BUTTONS'); my $content_href = $self->from_element_direction('Contents', 'href', $element); my $about_href = $self->from_element_direction('About', 'href', $element); my $result = ''; if ($content_href or $about_href) { $result .= "\n"; $result .= "Table of Contents\n"; } $result .= " " if ($self->get_conf('VERTICAL_HEAD_NAVIGATION')); $result .= $self->get_conf('DEFAULT_RULE')."\n" if (defined($self->get_conf('DEFAULT_RULE'))); if ($end_page) { $result .= join('', $self->close_registered_sections_level(0)); $result .= &{$self->formatting_function('format_navigation_panel')}($self, $buttons, undef, $element); } return $result; } return &{$self->default_formatting_function('format_element_footer')}($self, $type, $element, $content); } texinfo_register_formatting_function('format_end_file' , \&singular_format_end_file); # footer of page sub singular_format_end_file($$$) { my $self = shift; my $pre_body_close = $self->get_conf('PRE_BODY_CLOSE'); my $program_homepage = $self->get_conf('PACKAGE_URL'); my $program_and_version = $self->get_conf('PACKAGE_AND_VERSION'); my $version = $self->get_value('VERSION'); my $version_date = $self->get_value('VERSION_DATE'); $version = 'NO VERSION' if (!defined($version)); $version_date = 'NO VERSION DATE' if (!defined($version_date)); my $result = ' User manual for Singular version '."$version, $version_date, generated by $program_and_version. $pre_body_close
\n" if ($content_href); $result .= "About this document" if ($about_href); $result .= "