OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gdb-6.8/] [pre-binutils-2.20.1-sync/] [readline/] [doc/] [texi2html] - Diff between revs 157 and 223

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

';';';';\n", __LINE__));\n", __LINE__));\n", __LINE__));\n", __LINE__));\n", __LINE__));\n", __LINE__));\n");\n");
Rev 157 Rev 223
#! /usr/bin/perl
#! /usr/bin/perl
'di ';
'di ';
'ig 00 ';
'ig 00 ';
#+##############################################################################
#+##############################################################################
#
#
# texi2html: Program to transform Texinfo documents to HTML
# texi2html: Program to transform Texinfo documents to HTML
#
#
#    Copyright (C) 1999, 2000  Free Software Foundation, Inc.
#    Copyright (C) 1999, 2000  Free Software Foundation, Inc.
#
#
#    This program is free software; you can redistribute it and/or modify
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#    (at your option) any later version.
#
#
#    This program is distributed in the hope that it will be useful,
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#    GNU General Public License for more details.
#
#
#    You should have received a copy of the GNU General Public License
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
#
#-##############################################################################
#-##############################################################################
# This requires perl version 5 or higher
# This requires perl version 5 or higher
require 5.0;
require 5.0;
#++##############################################################################
#++##############################################################################
#
#
# NOTE FOR DEBUGGING THIS SCRIPT:
# NOTE FOR DEBUGGING THIS SCRIPT:
# You can run 'perl texi2html.pl' directly, provided you have
# You can run 'perl texi2html.pl' directly, provided you have
# the environment variable T2H_HOME set to the directory containing
# the environment variable T2H_HOME set to the directory containing
# the texi2html.init file
# the texi2html.init file
#
#
#--##############################################################################
#--##############################################################################
# CVS version:
# CVS version:
# $Id: texi2html.pl,v 1.55 2000/07/27 14:39:41 obachman Exp $
# $Id: texi2html.pl,v 1.55 2000/07/27 14:39:41 obachman Exp $
# Homepage:
# Homepage:
$T2H_HOMEPAGE = <
$T2H_HOMEPAGE = <
http://www.mathematik.uni-kl.de/~obachman/Texi2html
http://www.mathematik.uni-kl.de/~obachman/Texi2html
EOT
EOT
# Authors:
# Authors:
$T2H_AUTHORS = <
$T2H_AUTHORS = <
Written by: Lionel Cons  (original author)
Written by: Lionel Cons  (original author)
            Karl Berry  
            Karl Berry  
            Olaf Bachmann 
            Olaf Bachmann 
            and many others.
            and many others.
Maintained by: Olaf Bachmann 
Maintained by: Olaf Bachmann 
Send bugs and suggestions to 
Send bugs and suggestions to 
EOT
EOT
# Version: set in configure.in
# Version: set in configure.in
$THISVERSION = '1.64';
$THISVERSION = '1.64';
$THISPROG = "texi2html $THISVERSION";   # program name and version
$THISPROG = "texi2html $THISVERSION";   # program name and version
# The man page for this program is included at the end of this file and can be
# The man page for this program is included at the end of this file and can be
# viewed using the command 'nroff -man texi2html'.
# viewed using the command 'nroff -man texi2html'.
# Identity:
# Identity:
$T2H_TODAY = &pretty_date;          # like "20 September 1993"
$T2H_TODAY = &pretty_date;          # like "20 September 1993"
# the eval prevents this from breaking on system which do not have
# the eval prevents this from breaking on system which do not have
# a proper getpwuid implemented
# a proper getpwuid implemented
eval { ($T2H_USER = (getpwuid ($<))[6]) =~ s/,.*//;}; # Who am i
eval { ($T2H_USER = (getpwuid ($<))[6]) =~ s/,.*//;}; # Who am i
#+++############################################################################
#+++############################################################################
#                                                                              #
#                                                                              #
# Initialization                                                               #
# Initialization                                                               #
# Pasted content of File $(srcdir)/texi2html.init: Default initializations     #
# Pasted content of File $(srcdir)/texi2html.init: Default initializations     #
#                                                                              #
#                                                                              #
#---############################################################################
#---############################################################################
# leave this within comments, and keep the require statement
# leave this within comments, and keep the require statement
# This way, you can directly run texi2html.pl, if $ENV{T2H_HOME}/texi2html.init
# This way, you can directly run texi2html.pl, if $ENV{T2H_HOME}/texi2html.init
# exists.
# exists.
#
#
# -*-perl-*-
# -*-perl-*-
######################################################################
######################################################################
# File: texi2html.init
# File: texi2html.init
#
#
# Sets default values for command-line arguments and for various customizable
# Sets default values for command-line arguments and for various customizable
# procedures
# procedures
#
#
# A copy of this file is pasted into the beginning of texi2html by
# A copy of this file is pasted into the beginning of texi2html by
# 'make texi2html'
# 'make texi2html'
#
#
# Copy this file and make changes to it, if you like.
# Copy this file and make changes to it, if you like.
# Afterwards, either, load it with command-line option -init_file 
# Afterwards, either, load it with command-line option -init_file 
#
#
# $Id: texi2html.init,v 1.34 2000/07/27 14:09:02 obachman Exp $
# $Id: texi2html.init,v 1.34 2000/07/27 14:09:02 obachman Exp $
######################################################################
######################################################################
# stuff which can also be set by command-line options
# stuff which can also be set by command-line options
#
#
#
#
# Note: values set here, overwrite values set by the command-line
# Note: values set here, overwrite values set by the command-line
# options before -init_file and might still be overwritten by
# options before -init_file and might still be overwritten by
# command-line arguments following the -init_file option
# command-line arguments following the -init_file option
#
#
# T2H_OPTIONS is a hash whose keys are the (long) names of valid
# T2H_OPTIONS is a hash whose keys are the (long) names of valid
# command-line options and whose values are a hash with the following keys:
# command-line options and whose values are a hash with the following keys:
# type    ==> one of !|=i|:i|=s|:s (see GetOpt::Long for more info)
# type    ==> one of !|=i|:i|=s|:s (see GetOpt::Long for more info)
# linkage ==> ref to scalar, array, or subroutine (see GetOpt::Long for more info)
# linkage ==> ref to scalar, array, or subroutine (see GetOpt::Long for more info)
# verbose ==> short description of option (displayed by -h)
# verbose ==> short description of option (displayed by -h)
# noHelp  ==> if 1 -> for "not so important options": only print description on -h 1
# noHelp  ==> if 1 -> for "not so important options": only print description on -h 1
#                2 -> for obsolete options: only print description on -h 2
#                2 -> for obsolete options: only print description on -h 2
$T2H_DEBUG = 0;
$T2H_DEBUG = 0;
$T2H_OPTIONS -> {debug} =
$T2H_OPTIONS -> {debug} =
{
{
 type => '=i',
 type => '=i',
 linkage => \$main::T2H_DEBUG,
 linkage => \$main::T2H_DEBUG,
 verbose => 'output HTML with debuging information',
 verbose => 'output HTML with debuging information',
};
};
$T2H_DOCTYPE = '';
$T2H_DOCTYPE = '';
$T2H_OPTIONS -> {doctype} =
$T2H_OPTIONS -> {doctype} =
{
{
 type => '=s',
 type => '=s',
 linkage => \$main::T2H_DOCTYPE,
 linkage => \$main::T2H_DOCTYPE,
 verbose => 'document type which is output in header of HTML files',
 verbose => 'document type which is output in header of HTML files',
 noHelp => 1
 noHelp => 1
};
};
$T2H_CHECK = 0;
$T2H_CHECK = 0;
$T2H_OPTIONS -> {check} =
$T2H_OPTIONS -> {check} =
{
{
 type => '!',
 type => '!',
 linkage => \$main::T2H_CHECK,
 linkage => \$main::T2H_CHECK,
 verbose => 'if set, only check files and output all things that may be Texinfo commands',
 verbose => 'if set, only check files and output all things that may be Texinfo commands',
 noHelp => 1
 noHelp => 1
};
};
# -expand
# -expand
# if set to "tex" (or, "info") expand @iftex and @tex (or, @ifinfo) sections
# if set to "tex" (or, "info") expand @iftex and @tex (or, @ifinfo) sections
# else, neither expand @iftex, @tex, nor @ifinfo sections
# else, neither expand @iftex, @tex, nor @ifinfo sections
$T2H_EXPAND = "info";
$T2H_EXPAND = "info";
$T2H_OPTIONS -> {expand} =
$T2H_OPTIONS -> {expand} =
{
{
 type => '=s',
 type => '=s',
 linkage => \$T2H_EXPAND,
 linkage => \$T2H_EXPAND,
 verbose => 'Expand info|tex|none section of texinfo source',
 verbose => 'Expand info|tex|none section of texinfo source',
};
};
# - glossary
# - glossary
#if set, uses section named `Footnotes' for glossary
#if set, uses section named `Footnotes' for glossary
$T2H_USE_GLOSSARY = 0;
$T2H_USE_GLOSSARY = 0;
T2H_OPTIONS -> {glossary} =
T2H_OPTIONS -> {glossary} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_USE_GLOSSARY,
 linkage => \$T2H_USE_GLOSSARY,
 verbose => "if set, uses section named `Footnotes' for glossary",
 verbose => "if set, uses section named `Footnotes' for glossary",
 noHelp  => 1,
 noHelp  => 1,
};
};
# -invisible
# -invisible
# $T2H_INVISIBLE_MARK is the text used to create invisible destination
# $T2H_INVISIBLE_MARK is the text used to create invisible destination
# anchors for index links (you can for instance use the invisible.xbm
# anchors for index links (you can for instance use the invisible.xbm
# file shipped with this program). This is a workaround for a known
# file shipped with this program). This is a workaround for a known
# bug of many WWW browsers, including netscape.
# bug of many WWW browsers, including netscape.
# For me, it works fine without it -- on the contrary: if there, it
# For me, it works fine without it -- on the contrary: if there, it
# inserts space between headers and start of text (obachman 3/99)
# inserts space between headers and start of text (obachman 3/99)
$T2H_INVISIBLE_MARK = '';
$T2H_INVISIBLE_MARK = '';
# $T2H_INVISIBLE_MARK = ' ';
# $T2H_INVISIBLE_MARK = ' ';
$T2H_OPTIONS -> {invisible} =
$T2H_OPTIONS -> {invisible} =
{
{
 type => '=s',
 type => '=s',
 linkage => \$T2H_INVISIBLE_MARK,
 linkage => \$T2H_INVISIBLE_MARK,
 verbose => 'use text in invisble anchot',
 verbose => 'use text in invisble anchot',
 noHelp  => 1,
 noHelp  => 1,
};
};
# -iso
# -iso
# if set, ISO8879 characters are used for special symbols (like copyright, etc)
# if set, ISO8879 characters are used for special symbols (like copyright, etc)
$T2H_USE_ISO = 0;
$T2H_USE_ISO = 0;
$T2H_OPTIONS -> {iso} =
$T2H_OPTIONS -> {iso} =
{
{
 type => 'iso',
 type => 'iso',
 linkage => \$T2H_USE_ISO,
 linkage => \$T2H_USE_ISO,
 verbose => 'if set, ISO8879 characters are used for special symbols (like copyright, etc)',
 verbose => 'if set, ISO8879 characters are used for special symbols (like copyright, etc)',
 noHelp => 1,
 noHelp => 1,
};
};
# -I
# -I
# list directories where @include files are searched for (besides the
# list directories where @include files are searched for (besides the
# directory of the doc file) additional '-I' args add to this list
# directory of the doc file) additional '-I' args add to this list
@T2H_INCLUDE_DIRS = (".");
@T2H_INCLUDE_DIRS = (".");
$T2H_OPTIONS -> {I} =
$T2H_OPTIONS -> {I} =
{
{
 type => '=s',
 type => '=s',
 linkage => \@T2H_INCLUDE_DIRS,
 linkage => \@T2H_INCLUDE_DIRS,
 verbose => 'append $s to the @include search path',
 verbose => 'append $s to the @include search path',
};
};
# -top_file
# -top_file
# uses file of this name for top-level file
# uses file of this name for top-level file
# extension is manipulated appropriately, if necessary.
# extension is manipulated appropriately, if necessary.
# If empty, .html is used
# If empty, .html is used
# Typically, you would set this to "index.html".
# Typically, you would set this to "index.html".
$T2H_TOP_FILE = '';
$T2H_TOP_FILE = '';
$T2H_OPTIONS -> {top_file} =
$T2H_OPTIONS -> {top_file} =
{
{
 type => '=s',
 type => '=s',
 linkage => \$T2H_TOP_FILE,
 linkage => \$T2H_TOP_FILE,
 verbose => 'use $s as top file, instead of .html',
 verbose => 'use $s as top file, instead of .html',
};
};
# -toc_file
# -toc_file
# uses file of this name for table of contents file
# uses file of this name for table of contents file
# extension is manipulated appropriately, if necessary.
# extension is manipulated appropriately, if necessary.
# If empty, _toc.html is used
# If empty, _toc.html is used
$T2H_TOC_FILE = '';
$T2H_TOC_FILE = '';
$T2H_OPTIONS -> {toc_file} =
$T2H_OPTIONS -> {toc_file} =
{
{
 type => '=s',
 type => '=s',
 linkage => \$T2H_TOC_FILE,
 linkage => \$T2H_TOC_FILE,
 verbose => 'use $s as ToC file, instead of _toc.html',
 verbose => 'use $s as ToC file, instead of _toc.html',
};
};
# -frames
# -frames
# if set, output two additional files which use HTML 4.0 "frames".
# if set, output two additional files which use HTML 4.0 "frames".
$T2H_FRAMES = 0;
$T2H_FRAMES = 0;
$T2H_OPTIONS -> {frames} =
$T2H_OPTIONS -> {frames} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_FRAMES,
 linkage => \$T2H_FRAMES,
 verbose => 'output files which use HTML 4.0 frames (experimental)',
 verbose => 'output files which use HTML 4.0 frames (experimental)',
 noHelp => 1,
 noHelp => 1,
};
};
# -menu | -nomenu
# -menu | -nomenu
# if set, show the Texinfo menus
# if set, show the Texinfo menus
$T2H_SHOW_MENU = 1;
$T2H_SHOW_MENU = 1;
$T2H_OPTIONS -> {menu} =
$T2H_OPTIONS -> {menu} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_SHOW_MENU,
 linkage => \$T2H_SHOW_MENU,
 verbose => 'ouput Texinfo menus',
 verbose => 'ouput Texinfo menus',
};
};
# -number | -nonumber
# -number | -nonumber
# if set, number sections and show section names and numbers in references
# if set, number sections and show section names and numbers in references
# and menus
# and menus
$T2H_NUMBER_SECTIONS = 1;
$T2H_NUMBER_SECTIONS = 1;
$T2H_OPTIONS -> {number} =
$T2H_OPTIONS -> {number} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_NUMBER_SECTIONS,
 linkage => \$T2H_NUMBER_SECTIONS,
 verbose => 'use numbered sections'
 verbose => 'use numbered sections'
};
};
# if set, and T2H_NUMBER_SECTIONS is set, then use node names in menu
# if set, and T2H_NUMBER_SECTIONS is set, then use node names in menu
# entries, instead of section names
# entries, instead of section names
$T2H_NODE_NAME_IN_MENU = 0;
$T2H_NODE_NAME_IN_MENU = 0;
# if set and menu entry equals menu descr, then do not print menu descr.
# if set and menu entry equals menu descr, then do not print menu descr.
# Likewise, if node name equals entry name, do not print entry name.
# Likewise, if node name equals entry name, do not print entry name.
$T2H_AVOID_MENU_REDUNDANCY = 1;
$T2H_AVOID_MENU_REDUNDANCY = 1;
# -split section|chapter|none
# -split section|chapter|none
# if set to 'section' (resp. 'chapter') create one html file per (sub)section
# if set to 'section' (resp. 'chapter') create one html file per (sub)section
# (resp. chapter) and separate pages for Top, ToC, Overview, Index,
# (resp. chapter) and separate pages for Top, ToC, Overview, Index,
# Glossary, About.
# Glossary, About.
# otherwise, create monolithic html file which contains whole document
# otherwise, create monolithic html file which contains whole document
#$T2H_SPLIT = 'section';
#$T2H_SPLIT = 'section';
$T2H_SPLIT = '';
$T2H_SPLIT = '';
$T2H_OPTIONS -> {split} =
$T2H_OPTIONS -> {split} =
{
{
 type => '=s',
 type => '=s',
 linkage => \$T2H_SPLIT,
 linkage => \$T2H_SPLIT,
 verbose => 'split document on section|chapter else no splitting',
 verbose => 'split document on section|chapter else no splitting',
};
};
# -section_navigation|-no-section_navigation
# -section_navigation|-no-section_navigation
# if set, then navigation panels are printed at the beginning of each section
# if set, then navigation panels are printed at the beginning of each section
# and, possibly at the end (depending on whether or not there were more than
# and, possibly at the end (depending on whether or not there were more than
# $T2H_WORDS_IN_PAGE  words on page
# $T2H_WORDS_IN_PAGE  words on page
# This is most useful if you do not want to have section navigation
# This is most useful if you do not want to have section navigation
# on -split chapter
# on -split chapter
$T2H_SECTION_NAVIGATION = 1;
$T2H_SECTION_NAVIGATION = 1;
$T2H_OPTIONS -> {sec_nav} =
$T2H_OPTIONS -> {sec_nav} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_SECTION_NAVIGATION,
 linkage => \$T2H_SECTION_NAVIGATION,
 verbose => 'output navigation panels for each section',
 verbose => 'output navigation panels for each section',
};
};
# -subdir
# -subdir
# if set put result files in this directory
# if set put result files in this directory
# if not set result files are put into current directory
# if not set result files are put into current directory
#$T2H_SUBDIR = 'html';
#$T2H_SUBDIR = 'html';
$T2H_SUBDIR = '';
$T2H_SUBDIR = '';
$T2H_OPTIONS -> {subdir} =
$T2H_OPTIONS -> {subdir} =
{
{
 type => '=s',
 type => '=s',
 linkage => \$T2H_SUBDIR,
 linkage => \$T2H_SUBDIR,
 verbose => 'put HTML files in directory $s, instead of $cwd',
 verbose => 'put HTML files in directory $s, instead of $cwd',
};
};
# -short_extn
# -short_extn
# If this is set all HTML file will have extension ".htm" instead of
# If this is set all HTML file will have extension ".htm" instead of
# ".html". This is helpful when shipping the document to PC systems.
# ".html". This is helpful when shipping the document to PC systems.
$T2H_SHORTEXTN = 0;
$T2H_SHORTEXTN = 0;
$T2H_OPTIONS -> {short_ext} =
$T2H_OPTIONS -> {short_ext} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_SHORTEXTN,
 linkage => \$T2H_SHORTEXTN,
 verbose => 'use "htm" extension for output HTML files',
 verbose => 'use "htm" extension for output HTML files',
};
};
# -prefix
# -prefix
# Set the output file prefix, prepended to all .html, .gif and .pl files.
# Set the output file prefix, prepended to all .html, .gif and .pl files.
# By default, this is the basename of the document
# By default, this is the basename of the document
$T2H_PREFIX = '';
$T2H_PREFIX = '';
$T2H_OPTIONS -> {prefix} =
$T2H_OPTIONS -> {prefix} =
{
{
 type => '=s',
 type => '=s',
 linkage => \$T2H_PREFIX,
 linkage => \$T2H_PREFIX,
 verbose => 'use as prefix for output files, instead of ',
 verbose => 'use as prefix for output files, instead of ',
};
};
# -o filename
# -o filename
# If set, generate monolithic document output html into $filename
# If set, generate monolithic document output html into $filename
$T2H_OUT = '';
$T2H_OUT = '';
$T2H_OPTIONS -> {out_file} =
$T2H_OPTIONS -> {out_file} =
{
{
 type => '=s',
 type => '=s',
 linkage => sub {$main::T2H_OUT = @_[1]; $T2H_SPLIT = '';},
 linkage => sub {$main::T2H_OUT = @_[1]; $T2H_SPLIT = '';},
 verbose => 'if set, all HTML output goes into file $s',
 verbose => 'if set, all HTML output goes into file $s',
};
};
# -short_ref
# -short_ref
#if set cross-references are given without section numbers
#if set cross-references are given without section numbers
$T2H_SHORT_REF = '';
$T2H_SHORT_REF = '';
$T2H_OPTIONS -> {short_ref} =
$T2H_OPTIONS -> {short_ref} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_SHORT_REF,
 linkage => \$T2H_SHORT_REF,
 verbose => 'if set, references are without section numbers',
 verbose => 'if set, references are without section numbers',
};
};
# -idx_sum
# -idx_sum
# if value is set, then for each @prinindex $what
# if value is set, then for each @prinindex $what
# $docu_name_$what.idx is created which contains lines of the form
# $docu_name_$what.idx is created which contains lines of the form
# $key\t$ref sorted alphabetically (case matters)
# $key\t$ref sorted alphabetically (case matters)
$T2H_IDX_SUMMARY = 0;
$T2H_IDX_SUMMARY = 0;
$T2H_OPTIONS -> {idx_sum} =
$T2H_OPTIONS -> {idx_sum} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_IDX_SUMMARY,
 linkage => \$T2H_IDX_SUMMARY,
 verbose => 'if set, also output index summary',
 verbose => 'if set, also output index summary',
 noHelp  => 1,
 noHelp  => 1,
};
};
# -verbose
# -verbose
# if set, chatter about what we are doing
# if set, chatter about what we are doing
$T2H_VERBOSE = '';
$T2H_VERBOSE = '';
$T2H_OPTIONS -> {Verbose} =
$T2H_OPTIONS -> {Verbose} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_VERBOSE,
 linkage => \$T2H_VERBOSE,
 verbose => 'print progress info to stdout',
 verbose => 'print progress info to stdout',
};
};
# -lang
# -lang
# For page titles use $T2H_WORDS->{$T2H_LANG}->{...} as title.
# For page titles use $T2H_WORDS->{$T2H_LANG}->{...} as title.
# To add a new language, supply list of titles (see $T2H_WORDS below).
# To add a new language, supply list of titles (see $T2H_WORDS below).
# and use ISO 639 language codes (see e.g. perl module Locale-Codes-1.02
# and use ISO 639 language codes (see e.g. perl module Locale-Codes-1.02
# for  definitions)
# for  definitions)
# Default's to 'en' if not set or no @documentlanguage is specified
# Default's to 'en' if not set or no @documentlanguage is specified
$T2H_LANG = '';
$T2H_LANG = '';
$T2H_OPTIONS -> {lang} =
$T2H_OPTIONS -> {lang} =
{
{
 type => '=s',
 type => '=s',
 linkage => sub {SetDocumentLanguage($_[1])},
 linkage => sub {SetDocumentLanguage($_[1])},
 verbose => 'use $s as document language (ISO 639 encoding)',
 verbose => 'use $s as document language (ISO 639 encoding)',
};
};
# -l2h
# -l2h
# if set, uses latex2html for generation of math content
# if set, uses latex2html for generation of math content
$T2H_L2H = '';
$T2H_L2H = '';
$T2H_OPTIONS -> {l2h} =
$T2H_OPTIONS -> {l2h} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_L2H,
 linkage => \$T2H_L2H,
 verbose => 'if set, uses latex2html for @math and @tex',
 verbose => 'if set, uses latex2html for @math and @tex',
};
};
######################
######################
# The following options are only relevant if $T2H_L2H is set
# The following options are only relevant if $T2H_L2H is set
#
#
# -l2h_l2h
# -l2h_l2h
# name/location of latex2html progam
# name/location of latex2html progam
$T2H_L2H_L2H = "latex2html";
$T2H_L2H_L2H = "latex2html";
$T2H_OPTIONS -> {l2h_l2h} =
$T2H_OPTIONS -> {l2h_l2h} =
{
{
 type => '=s',
 type => '=s',
 linkage => \$T2H_L2H_L2H,
 linkage => \$T2H_L2H_L2H,
 verbose => 'program to use for latex2html translation',
 verbose => 'program to use for latex2html translation',
 noHelp => 1,
 noHelp => 1,
};
};
# -l2h_skip
# -l2h_skip
# if set, skips actual call to latex2html tries to reuse previously generated
# if set, skips actual call to latex2html tries to reuse previously generated
# content, instead
# content, instead
$T2H_L2H_SKIP = '';
$T2H_L2H_SKIP = '';
$T2H_OPTIONS -> {l2h_skip} =
$T2H_OPTIONS -> {l2h_skip} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_L2H_SKIP,
 linkage => \$T2H_L2H_SKIP,
 verbose => 'if set, tries to reuse previously latex2html output',
 verbose => 'if set, tries to reuse previously latex2html output',
 noHelp => 1,
 noHelp => 1,
};
};
# -l2h_tmp
# -l2h_tmp
# if set, l2h uses this directory for temporarary files. The path
# if set, l2h uses this directory for temporarary files. The path
# leading to this directory may not contain a dot (i.e., a "."),
# leading to this directory may not contain a dot (i.e., a "."),
# otherwise, l2h will fail
# otherwise, l2h will fail
$T2H_L2H_TMP = '';
$T2H_L2H_TMP = '';
$T2H_OPTIONS -> {l2h_tmp} =
$T2H_OPTIONS -> {l2h_tmp} =
{
{
 type => '=s',
 type => '=s',
 linkage => \$T2H_L2H_TMP,
 linkage => \$T2H_L2H_TMP,
 verbose => 'if set, uses $s as temporary latex2html directory',
 verbose => 'if set, uses $s as temporary latex2html directory',
 noHelp => 1,
 noHelp => 1,
};
};
# if set, cleans intermediate files (they all have the prefix $doc_l2h_)
# if set, cleans intermediate files (they all have the prefix $doc_l2h_)
# of l2h
# of l2h
$T2H_L2H_CLEAN = 1;
$T2H_L2H_CLEAN = 1;
$T2H_OPTIONS -> {l2h_clean} =
$T2H_OPTIONS -> {l2h_clean} =
{
{
 type => '!',
 type => '!',
 linkage => \$T2H_L2H_CLEAN,
 linkage => \$T2H_L2H_CLEAN,
 verbose => 'if set, do not keep intermediate latex2html files for later reuse',
 verbose => 'if set, do not keep intermediate latex2html files for later reuse',
 noHelp => 1,
 noHelp => 1,
};
};
$T2H_OPTIONS -> {D} =
$T2H_OPTIONS -> {D} =
{
{
 type => '=s',
 type => '=s',
 linkage => sub {$main::value{@_[1]} = 1;},
 linkage => sub {$main::value{@_[1]} = 1;},
 verbose => 'equivalent to Texinfo "@set $s 1"',
 verbose => 'equivalent to Texinfo "@set $s 1"',
 noHelp => 1,
 noHelp => 1,
};
};
$T2H_OPTIONS -> {init_file} =
$T2H_OPTIONS -> {init_file} =
{
{
 type => '=s',
 type => '=s',
 linkage => \&LoadInitFile,
 linkage => \&LoadInitFile,
 verbose => 'load init file $s'
 verbose => 'load init file $s'
};
};
##############################################################################
##############################################################################
#
#
# The following can only be set in the init file
# The following can only be set in the init file
#
#
##############################################################################
##############################################################################
# if set, center @image by default
# if set, center @image by default
# otherwise, do not center by default
# otherwise, do not center by default
$T2H_CENTER_IMAGE = 1;
$T2H_CENTER_IMAGE = 1;
# used as identation for block enclosing command @example, etc
# used as identation for block enclosing command @example, etc
# If not empty, must be enclosed in 
# If not empty, must be enclosed in 
$T2H_EXAMPLE_INDENT_CELL = '
 
$T2H_EXAMPLE_INDENT_CELL = '
 
# same as above, only for @small
# same as above, only for @small
$T2H_SMALL_EXAMPLE_INDENT_CELL = '
 
$T2H_SMALL_EXAMPLE_INDENT_CELL = '
 
# font size for @small
# font size for @small
$T2H_SMALL_FONT_SIZE = '-1';
$T2H_SMALL_FONT_SIZE = '-1';
# if non-empty, and no @..heading appeared in Top node, then
# if non-empty, and no @..heading appeared in Top node, then
# use this as header for top node/section, otherwise use value of
# use this as header for top node/section, otherwise use value of
# @settitle or @shorttitle (in that order)
# @settitle or @shorttitle (in that order)
$T2H_TOP_HEADING = '';
$T2H_TOP_HEADING = '';
# if set, use this chapter for 'Index' button, else
# if set, use this chapter for 'Index' button, else
# use first chapter whose name matches 'index' (case insensitive)
# use first chapter whose name matches 'index' (case insensitive)
$T2H_INDEX_CHAPTER = '';
$T2H_INDEX_CHAPTER = '';
# if set and $T2H_SPLIT is set, then split index pages at the next letter
# if set and $T2H_SPLIT is set, then split index pages at the next letter
# after they have more than that many entries
# after they have more than that many entries
$T2H_SPLIT_INDEX = 100;
$T2H_SPLIT_INDEX = 100;
# if set (e.g., to index.html) replace hrefs to this file
# if set (e.g., to index.html) replace hrefs to this file
# (i.e., to index.html) by ./
# (i.e., to index.html) by ./
$T2H_HREF_DIR_INSTEAD_FILE = '';
$T2H_HREF_DIR_INSTEAD_FILE = '';
########################################################################
########################################################################
# Language dependencies:
# Language dependencies:
# To add a new language extend T2H_WORDS hash and create $T2H_<...>_WORDS hash
# To add a new language extend T2H_WORDS hash and create $T2H_<...>_WORDS hash
# To redefine one word, simply do:
# To redefine one word, simply do:
# $T2H_WORDS->{}->{} = 'whatever' in your personal init file.
# $T2H_WORDS->{}->{} = 'whatever' in your personal init file.
#
#
$T2H_WORDS_EN =
$T2H_WORDS_EN =
{
{
 # titles  of pages
 # titles  of pages
 'ToC_Title' => 'Table of Contents',
 'ToC_Title' => 'Table of Contents',
 'Overview_Title' => 'Short Table of Contents',
 'Overview_Title' => 'Short Table of Contents',
 'Index_Title' => 'Index',
 'Index_Title' => 'Index',
 'About_Title' => 'About this document',
 'About_Title' => 'About this document',
 'Footnotes_Title' => 'Footnotes',
 'Footnotes_Title' => 'Footnotes',
 'See' => 'See',
 'See' => 'See',
 'see' => 'see',
 'see' => 'see',
 'section' => 'section',
 'section' => 'section',
# If necessary, we could extend this as follows:
# If necessary, we could extend this as follows:
#  # text for buttons
#  # text for buttons
#  'Top_Button' => 'Top',
#  'Top_Button' => 'Top',
#  'ToC_Button' => 'Contents',
#  'ToC_Button' => 'Contents',
#  'Overview_Button' => 'Overview',
#  'Overview_Button' => 'Overview',
#  'Index_button' => 'Index',
#  'Index_button' => 'Index',
#  'Back_Button' => 'Back',
#  'Back_Button' => 'Back',
#  'FastBack_Button' => 'FastBack',
#  'FastBack_Button' => 'FastBack',
#  'Prev_Button' => 'Prev',
#  'Prev_Button' => 'Prev',
#  'Up_Button' => 'Up',
#  'Up_Button' => 'Up',
#  'Next_Button' => 'Next',
#  'Next_Button' => 'Next',
#  'Forward_Button' =>'Forward',
#  'Forward_Button' =>'Forward',
#  'FastWorward_Button' => 'FastForward',
#  'FastWorward_Button' => 'FastForward',
#  'First_Button' => 'First',
#  'First_Button' => 'First',
#  'Last_Button' => 'Last',
#  'Last_Button' => 'Last',
#  'About_Button' => 'About'
#  'About_Button' => 'About'
};
};
$T2H_WORD_DE =
$T2H_WORD_DE =
{
{
 'ToC_Title' => 'Inhaltsverzeichniss',
 'ToC_Title' => 'Inhaltsverzeichniss',
 'Overview_Title' => 'Kurzes Inhaltsverzeichniss',
 'Overview_Title' => 'Kurzes Inhaltsverzeichniss',
 'Index_Title' => 'Index',
 'Index_Title' => 'Index',
 'About_Title' => 'Über dieses Dokument',
 'About_Title' => 'Über dieses Dokument',
 'Footnotes_Title' => 'Fußnoten',
 'Footnotes_Title' => 'Fußnoten',
 'See' => 'Siehe',
 'See' => 'Siehe',
 'see' => 'siehe',
 'see' => 'siehe',
 'section' => 'Abschnitt',
 'section' => 'Abschnitt',
};
};
$T2H_WORD_NL =
$T2H_WORD_NL =
{
{
 'ToC_Title' => 'Inhoudsopgave',
 'ToC_Title' => 'Inhoudsopgave',
 'Overview_Title' => 'Korte inhoudsopgave',
 'Overview_Title' => 'Korte inhoudsopgave',
 'Index_Title' => 'Index', #Not sure ;-)
 'Index_Title' => 'Index', #Not sure ;-)
 'About_Title' => 'No translation available!', #No translation available!
 'About_Title' => 'No translation available!', #No translation available!
 'Footnotes_Title' => 'No translation available!', #No translation available!
 'Footnotes_Title' => 'No translation available!', #No translation available!
 'See' => 'Zie',
 'See' => 'Zie',
 'see' => 'zie',
 'see' => 'zie',
 'section' => 'sectie',
 'section' => 'sectie',
};
};
$T2H_WORD_ES =
$T2H_WORD_ES =
{
{
 'ToC_Title' => 'índice General',
 'ToC_Title' => 'índice General',
 'Overview_Title' => 'Resumen del Contenido',
 'Overview_Title' => 'Resumen del Contenido',
 'Index_Title' => 'Index', #Not sure ;-)
 'Index_Title' => 'Index', #Not sure ;-)
 'About_Title' => 'No translation available!', #No translation available!
 'About_Title' => 'No translation available!', #No translation available!
 'Footnotes_Title' => 'Fußnoten',
 'Footnotes_Title' => 'Fußnoten',
 'See' => 'Véase',
 'See' => 'Véase',
 'see' => 'véase',
 'see' => 'véase',
 'section' => 'sección',
 'section' => 'sección',
};
};
$T2H_WORD_NO =
$T2H_WORD_NO =
{
{
 'ToC_Title' => 'Innholdsfortegnelse',
 'ToC_Title' => 'Innholdsfortegnelse',
 'Overview_Title' => 'Kort innholdsfortegnelse',
 'Overview_Title' => 'Kort innholdsfortegnelse',
 'Index_Title' => 'Indeks', #Not sure ;-)
 'Index_Title' => 'Indeks', #Not sure ;-)
 'About_Title' => 'No translation available!', #No translation available!
 'About_Title' => 'No translation available!', #No translation available!
 'Footnotes_Title' => 'No translation available!',
 'Footnotes_Title' => 'No translation available!',
 'See' => 'Se',
 'See' => 'Se',
 'see' => 'se',
 'see' => 'se',
 'section' => 'avsnitt',
 'section' => 'avsnitt',
};
};
$T2H_WORD_PT =
$T2H_WORD_PT =
{
{
 'ToC_Title' => 'Sumário',
 'ToC_Title' => 'Sumário',
 'Overview_Title' => 'Breve Sumário',
 'Overview_Title' => 'Breve Sumário',
 'Index_Title' => 'Índice', #Not sure ;-)
 'Index_Title' => 'Índice', #Not sure ;-)
 'About_Title' => 'No translation available!', #No translation available!
 'About_Title' => 'No translation available!', #No translation available!
 'Footnotes_Title' => 'No translation available!',
 'Footnotes_Title' => 'No translation available!',
 'See' => 'Veja',
 'See' => 'Veja',
 'see' => 'veja',
 'see' => 'veja',
 'section' => 'Seção',
 'section' => 'Seção',
};
};
$T2H_WORDS =
$T2H_WORDS =
{
{
 'en' => $T2H_WORDS_EN,
 'en' => $T2H_WORDS_EN,
 'de' => $T2H_WORDS_DE,
 'de' => $T2H_WORDS_DE,
 'nl' => $T2H_WORDS_NL,
 'nl' => $T2H_WORDS_NL,
 'es' => $T2H_WORDS_ES,
 'es' => $T2H_WORDS_ES,
 'no' => $T2H_WORDS_NO,
 'no' => $T2H_WORDS_NO,
 'pt' => $T2H_WORDS_PT
 'pt' => $T2H_WORDS_PT
};
};
@MONTH_NAMES_EN =
@MONTH_NAMES_EN =
(
(
 'January', 'February', 'March', 'April', 'May',
 'January', 'February', 'March', 'April', 'May',
 'June', 'July', 'August', 'September', 'October',
 'June', 'July', 'August', 'September', 'October',
 'November', 'December'
 'November', 'December'
);
);
@MONTH_NAMES_DE =
@MONTH_NAMES_DE =
(
(
 'Januar', 'Februar', 'März', 'April', 'Mai',
 'Januar', 'Februar', 'März', 'April', 'Mai',
 'Juni', 'Juli', 'August', 'September', 'Oktober',
 'Juni', 'Juli', 'August', 'September', 'Oktober',
 'November', 'Dezember'
 'November', 'Dezember'
);
);
@MONTH_NAMES_NL =
@MONTH_NAMES_NL =
(
(
 'Januari', 'Februari', 'Maart', 'April', 'Mei',
 'Januari', 'Februari', 'Maart', 'April', 'Mei',
 'Juni', 'Juli', 'Augustus', 'September', 'Oktober',
 'Juni', 'Juli', 'Augustus', 'September', 'Oktober',
 'November', 'December'
 'November', 'December'
);
);
@MONTH_NAMES_ES =
@MONTH_NAMES_ES =
(
(
 'enero', 'febrero', 'marzo', 'abril', 'mayo',
 'enero', 'febrero', 'marzo', 'abril', 'mayo',
 'junio', 'julio', 'agosto', 'septiembre', 'octubre',
 'junio', 'julio', 'agosto', 'septiembre', 'octubre',
 'noviembre', 'diciembre'
 'noviembre', 'diciembre'
);
);
@MONTH_NAMES_NO =
@MONTH_NAMES_NO =
(
(
 'januar', 'februar', 'mars', 'april', 'mai',
 'januar', 'februar', 'mars', 'april', 'mai',
 'juni', 'juli', 'august', 'september', 'oktober',
 'juni', 'juli', 'august', 'september', 'oktober',
 'november', 'desember'
 'november', 'desember'
);
);
@MONTH_NAMES_PT =
@MONTH_NAMES_PT =
(
(
 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio',
 'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio',
 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro',
 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro',
 'Novembro', 'Dezembro'
 'Novembro', 'Dezembro'
);
);
$MONTH_NAMES =
$MONTH_NAMES =
{
{
    'en' => \@MONTH_NAMES_EN,
    'en' => \@MONTH_NAMES_EN,
    'de' => \@MONTH_NAMES_DE,
    'de' => \@MONTH_NAMES_DE,
    'es' => \@MONTH_NAMES_ES,
    'es' => \@MONTH_NAMES_ES,
    'nl' => \@MONTH_NAMES_NL,
    'nl' => \@MONTH_NAMES_NL,
    'no' => \@MONTH_NAMES_NO,
    'no' => \@MONTH_NAMES_NO,
    'pt' => \@MONTH_NAMES_PT
    'pt' => \@MONTH_NAMES_PT
};
};
########################################################################
########################################################################
# Control of Page layout:
# Control of Page layout:
# You can make changes of the Page layout at two levels:
# You can make changes of the Page layout at two levels:
# 1.) For small changes, it is often enough to change the value of
# 1.) For small changes, it is often enough to change the value of
#     some global string/hash/array variables
#     some global string/hash/array variables
# 2.) For larger changes, reimplement one of the T2H_DEFAULT_* routines,
# 2.) For larger changes, reimplement one of the T2H_DEFAULT_* routines,
#     give them another name, and assign them to the respective
#     give them another name, and assign them to the respective
#     $T2H_ variable.
#     $T2H_ variable.
# As a general interface, the hashes T2H_HREF, T2H_NAME, T2H_NODE hold
# As a general interface, the hashes T2H_HREF, T2H_NAME, T2H_NODE hold
# href, html-name, node-name of
# href, html-name, node-name of
# This     -- current section (resp. html page)
# This     -- current section (resp. html page)
# Top      -- top page ($T2H_TOP_FILE)
# Top      -- top page ($T2H_TOP_FILE)
# Contents -- Table of contents
# Contents -- Table of contents
# Overview -- Short table of contents
# Overview -- Short table of contents
# Index    -- Index page
# Index    -- Index page
# About    -- page which explain "navigation buttons"
# About    -- page which explain "navigation buttons"
# First    -- first node
# First    -- first node
# Last     -- last node
# Last     -- last node
#
#
# Whether or not the following hash values are set, depends on the context
# Whether or not the following hash values are set, depends on the context
# (all values are w.r.t. 'This' section)
# (all values are w.r.t. 'This' section)
# Next        -- next node of texinfo
# Next        -- next node of texinfo
# Prev        -- previous node of texinfo
# Prev        -- previous node of texinfo
# Up          -- up node of texinfo
# Up          -- up node of texinfo
# Forward     -- next node in reading order
# Forward     -- next node in reading order
# Back        -- previous node in reading order
# Back        -- previous node in reading order
# FastForward -- if leave node, up and next, else next node
# FastForward -- if leave node, up and next, else next node
# FastBackward-- if leave node, up and prev, else prev node
# FastBackward-- if leave node, up and prev, else prev node
#
#
# Furthermore, the following global variabels are set:
# Furthermore, the following global variabels are set:
# $T2H_THISDOC{title}     -- title as set by @setttile
# $T2H_THISDOC{title}     -- title as set by @setttile
# $T2H_THISDOC{fulltitle} -- full title as set by @title...
# $T2H_THISDOC{fulltitle} -- full title as set by @title...
# $T2H_THISDOC{subtitle}  -- subtitle as set by @subtitle
# $T2H_THISDOC{subtitle}  -- subtitle as set by @subtitle
# $T2H_THISDOC{author}    -- author as set by @author
# $T2H_THISDOC{author}    -- author as set by @author
#
#
# and pointer to arrays of lines which need to be printed by t2h_print_lines
# and pointer to arrays of lines which need to be printed by t2h_print_lines
# $T2H_OVERVIEW      -- lines of short table of contents
# $T2H_OVERVIEW      -- lines of short table of contents
# $T2H_TOC           -- lines of table of contents
# $T2H_TOC           -- lines of table of contents
# $T2H_TOP           -- lines of Top texinfo node
# $T2H_TOP           -- lines of Top texinfo node
# $T2H_THIS_SECTION  -- lines of 'This' section
# $T2H_THIS_SECTION  -- lines of 'This' section
#
#
# There are the following subs which control the layout:
# There are the following subs which control the layout:
#
#
$T2H_print_section            = \&T2H_DEFAULT_print_section;
$T2H_print_section            = \&T2H_DEFAULT_print_section;
$T2H_print_Top_header         = \&T2H_DEFAULT_print_Top_header;
$T2H_print_Top_header         = \&T2H_DEFAULT_print_Top_header;
$T2H_print_Top_footer         = \&T2H_DEFAULT_print_Top_footer;
$T2H_print_Top_footer         = \&T2H_DEFAULT_print_Top_footer;
$T2H_print_Top                = \&T2H_DEFAULT_print_Top;
$T2H_print_Top                = \&T2H_DEFAULT_print_Top;
$T2H_print_Toc                = \&T2H_DEFAULT_print_Toc;
$T2H_print_Toc                = \&T2H_DEFAULT_print_Toc;
$T2H_print_Overview           = \&T2H_DEFAULT_print_Overview;
$T2H_print_Overview           = \&T2H_DEFAULT_print_Overview;
$T2H_print_Footnotes          = \&T2H_DEFAULT_print_Footnotes;
$T2H_print_Footnotes          = \&T2H_DEFAULT_print_Footnotes;
$T2H_print_About              = \&T2H_DEFAULT_print_About;
$T2H_print_About              = \&T2H_DEFAULT_print_About;
$T2H_print_misc_header        = \&T2H_DEFAULT_print_misc_header;
$T2H_print_misc_header        = \&T2H_DEFAULT_print_misc_header;
$T2H_print_misc_footer        = \&T2H_DEFAULT_print_misc_footer;
$T2H_print_misc_footer        = \&T2H_DEFAULT_print_misc_footer;
$T2H_print_misc               = \&T2H_DEFAULT_print_misc;
$T2H_print_misc               = \&T2H_DEFAULT_print_misc;
$T2H_print_chapter_header     = \&T2H_DEFAULT_print_chapter_header;
$T2H_print_chapter_header     = \&T2H_DEFAULT_print_chapter_header;
$T2H_print_chapter_footer     = \&T2H_DEFAULT_print_chapter_footer;
$T2H_print_chapter_footer     = \&T2H_DEFAULT_print_chapter_footer;
$T2H_print_page_head          = \&T2H_DEFAULT_print_page_head;
$T2H_print_page_head          = \&T2H_DEFAULT_print_page_head;
$T2H_print_page_foot          = \&T2H_DEFAULT_print_page_foot;
$T2H_print_page_foot          = \&T2H_DEFAULT_print_page_foot;
$T2H_print_head_navigation    = \&T2H_DEFAULT_print_head_navigation;
$T2H_print_head_navigation    = \&T2H_DEFAULT_print_head_navigation;
$T2H_print_foot_navigation    = \&T2H_DEFAULT_print_foot_navigation;
$T2H_print_foot_navigation    = \&T2H_DEFAULT_print_foot_navigation;
$T2H_button_icon_img          = \&T2H_DEFAULT_button_icon_img;
$T2H_button_icon_img          = \&T2H_DEFAULT_button_icon_img;
$T2H_print_navigation         = \&T2H_DEFAULT_print_navigation;
$T2H_print_navigation         = \&T2H_DEFAULT_print_navigation;
$T2H_about_body               = \&T2H_DEFAULT_about_body;
$T2H_about_body               = \&T2H_DEFAULT_about_body;
$T2H_print_frame              = \&T2H_DEFAULT_print_frame;
$T2H_print_frame              = \&T2H_DEFAULT_print_frame;
$T2H_print_toc_frame          = \&T2H_DEFAULT_print_toc_frame;
$T2H_print_toc_frame          = \&T2H_DEFAULT_print_toc_frame;
########################################################################
########################################################################
# Layout for html for every sections
# Layout for html for every sections
#
#
sub T2H_DEFAULT_print_section
sub T2H_DEFAULT_print_section
{
{
  my $fh = shift;
  my $fh = shift;
  local $T2H_BUTTONS = \@T2H_SECTION_BUTTONS;
  local $T2H_BUTTONS = \@T2H_SECTION_BUTTONS;
  &$T2H_print_head_navigation($fh) if $T2H_SECTION_NAVIGATION;
  &$T2H_print_head_navigation($fh) if $T2H_SECTION_NAVIGATION;
  my $nw = t2h_print_lines($fh);
  my $nw = t2h_print_lines($fh);
  if ($T2H_SPLIT eq 'section' && $T2H_SECTION_NAVIGATION)
  if ($T2H_SPLIT eq 'section' && $T2H_SECTION_NAVIGATION)
  {
  {
    &$T2H_print_foot_navigation($fh, $nw);
    &$T2H_print_foot_navigation($fh, $nw);
  }
  }
  else
  else
  {
  {
    print $fh '
' . "\n";
    print $fh '
' . "\n";
  }
  }
}
}
###################################################################
###################################################################
# Layout of top-page I recommend that you use @ifnothtml, @ifhtml,
# Layout of top-page I recommend that you use @ifnothtml, @ifhtml,
# @html within the Top texinfo node to specify content of top-level
# @html within the Top texinfo node to specify content of top-level
# page.
# page.
#
#
# If you enclose everything in @ifnothtml, then title, subtitle,
# If you enclose everything in @ifnothtml, then title, subtitle,
# author and overview is printed
# author and overview is printed
# T2H_HREF of Next, Prev, Up, Forward, Back are not defined
# T2H_HREF of Next, Prev, Up, Forward, Back are not defined
# if $T2H_SPLIT then Top page is in its own html file
# if $T2H_SPLIT then Top page is in its own html file
sub T2H_DEFAULT_print_Top_header
sub T2H_DEFAULT_print_Top_header
{
{
  &$T2H_print_page_head(@_) if $T2H_SPLIT;
  &$T2H_print_page_head(@_) if $T2H_SPLIT;
  t2h_print_label(@_); # this needs to be called, otherwise no label set
  t2h_print_label(@_); # this needs to be called, otherwise no label set
  &$T2H_print_head_navigation(@_);
  &$T2H_print_head_navigation(@_);
}
}
sub T2H_DEFAULT_print_Top_footer
sub T2H_DEFAULT_print_Top_footer
{
{
  &$T2H_print_foot_navigation(@_);
  &$T2H_print_foot_navigation(@_);
  &$T2H_print_page_foot(@_) if $T2H_SPLIT;
  &$T2H_print_page_foot(@_) if $T2H_SPLIT;
}
}
sub T2H_DEFAULT_print_Top
sub T2H_DEFAULT_print_Top
{
{
  my $fh = shift;
  my $fh = shift;
  # for redefining navigation buttons use:
  # for redefining navigation buttons use:
  # local $T2H_BUTTONS = [...];
  # local $T2H_BUTTONS = [...];
  # as it is, 'Top', 'Contents', 'Index', 'About' are printed
  # as it is, 'Top', 'Contents', 'Index', 'About' are printed
  local $T2H_BUTTONS = \@T2H_MISC_BUTTONS;
  local $T2H_BUTTONS = \@T2H_MISC_BUTTONS;
  &$T2H_print_Top_header($fh);
  &$T2H_print_Top_header($fh);
  if ($T2H_THIS_SECTION)
  if ($T2H_THIS_SECTION)
  {
  {
    # if top-level node has content, then print it with extra header
    # if top-level node has content, then print it with extra header
    print $fh "

$T2H_NAME{Top}

"
    print $fh "

$T2H_NAME{Top}

"
      unless ($T2H_HAS_TOP_HEADING);
      unless ($T2H_HAS_TOP_HEADING);
    t2h_print_lines($fh, $T2H_THIS_SECTION)
    t2h_print_lines($fh, $T2H_THIS_SECTION)
  }
  }
  else
  else
  {
  {
    # top-level node is fully enclosed in @ifnothtml
    # top-level node is fully enclosed in @ifnothtml
    # print fulltitle, subtitle, author, Overview
    # print fulltitle, subtitle, author, Overview
    print $fh
    print $fh
      "
\n

" .

      "
\n

" .

      join("\n

", split(/\n/, $T2H_THISDOC{fulltitle})) .

      join("\n

", split(/\n/, $T2H_THISDOC{fulltitle})) .

      "\n";
      "\n";
    print $fh "

$T2H_THISDOC{subtitle}

\n" if $T2H_THISDOC{subtitle};
    print $fh "

$T2H_THISDOC{subtitle}

\n" if $T2H_THISDOC{subtitle};
    print $fh "$T2H_THISDOC{author}\n" if $T2H_THISDOC{author};
    print $fh "$T2H_THISDOC{author}\n" if $T2H_THISDOC{author};
    print $fh <
    print $fh <


Overview:

Overview:

EOT
EOT
    t2h_print_lines($fh, $T2H_OVERVIEW);
    t2h_print_lines($fh, $T2H_OVERVIEW);
    print $fh "\n";
    print $fh "\n";
  }
  }
  &$T2H_print_Top_footer($fh);
  &$T2H_print_Top_footer($fh);
}
}
###################################################################
###################################################################
# Layout of Toc, Overview, and Footnotes pages
# Layout of Toc, Overview, and Footnotes pages
# By default, we use "normal" layout
# By default, we use "normal" layout
# T2H_HREF of Next, Prev, Up, Forward, Back, etc are not defined
# T2H_HREF of Next, Prev, Up, Forward, Back, etc are not defined
# use: local $T2H_BUTTONS = [...] to redefine navigation buttons
# use: local $T2H_BUTTONS = [...] to redefine navigation buttons
sub T2H_DEFAULT_print_Toc
sub T2H_DEFAULT_print_Toc
{
{
  return &$T2H_print_misc(@_);
  return &$T2H_print_misc(@_);
}
}
sub T2H_DEFAULT_print_Overview
sub T2H_DEFAULT_print_Overview
{
{
  return &$T2H_print_misc(@_);
  return &$T2H_print_misc(@_);
}
}
sub T2H_DEFAULT_print_Footnotes
sub T2H_DEFAULT_print_Footnotes
{
{
  return &$T2H_print_misc(@_);
  return &$T2H_print_misc(@_);
}
}
sub T2H_DEFAULT_print_About
sub T2H_DEFAULT_print_About
{
{
  return &$T2H_print_misc(@_);
  return &$T2H_print_misc(@_);
}
}
sub T2H_DEFAULT_print_misc_header
sub T2H_DEFAULT_print_misc_header
{
{
  &$T2H_print_page_head(@_) if $T2H_SPLIT;
  &$T2H_print_page_head(@_) if $T2H_SPLIT;
  # this needs to be called, otherwise, no labels are set
  # this needs to be called, otherwise, no labels are set
  t2h_print_label(@_);
  t2h_print_label(@_);
  &$T2H_print_head_navigation(@_);
  &$T2H_print_head_navigation(@_);
}
}
sub T2H_DEFAULT_print_misc_footer
sub T2H_DEFAULT_print_misc_footer
{
{
  &$T2H_print_foot_navigation(@_);
  &$T2H_print_foot_navigation(@_);
  &$T2H_print_page_foot(@_) if $T2H_SPLIT;
  &$T2H_print_page_foot(@_) if $T2H_SPLIT;
}
}
sub T2H_DEFAULT_print_misc
sub T2H_DEFAULT_print_misc
{
{
  my $fh = shift;
  my $fh = shift;
  local $T2H_BUTTONS = \@T2H_MISC_BUTTONS;
  local $T2H_BUTTONS = \@T2H_MISC_BUTTONS;
  &$T2H_print_misc_header($fh);
  &$T2H_print_misc_header($fh);
  print $fh "

$T2H_NAME{This}

\n";
  print $fh "

$T2H_NAME{This}

\n";
  t2h_print_lines($fh);
  t2h_print_lines($fh);
  &$T2H_print_misc_footer($fh);
  &$T2H_print_misc_footer($fh);
}
}
###################################################################
###################################################################
# chapter_header and chapter_footer are only called if
# chapter_header and chapter_footer are only called if
# T2H_SPLIT eq 'chapter'
# T2H_SPLIT eq 'chapter'
# chapter_header: after print_page_header, before print_section
# chapter_header: after print_page_header, before print_section
# chapter_footer: after print_section of last section, before print_page_footer
# chapter_footer: after print_section of last section, before print_page_footer
#
#
# If you want to get rid of navigation stuff after each section,
# If you want to get rid of navigation stuff after each section,
# redefine print_section such that it does not call print_navigation,
# redefine print_section such that it does not call print_navigation,
# and put print_navigation into print_chapter_header
# and put print_navigation into print_chapter_header
@T2H_CHAPTER_BUTTONS =
@T2H_CHAPTER_BUTTONS =
  (
  (
   'FastBack', 'FastForward', ' ',
   'FastBack', 'FastForward', ' ',
   ' ', ' ', ' ', ' ',
   ' ', ' ', ' ', ' ',
   'Top', 'Contents', 'Index', 'About',
   'Top', 'Contents', 'Index', 'About',
  );
  );
sub T2H_DEFAULT_print_chapter_header
sub T2H_DEFAULT_print_chapter_header
{
{
  # nothing to do there, by default
  # nothing to do there, by default
  if (! $T2H_SECTION_NAVIGATION)
  if (! $T2H_SECTION_NAVIGATION)
  {
  {
    my $fh = shift;
    my $fh = shift;
    local $T2H_BUTTONS = \@T2H_CHAPTER_BUTTONS;
    local $T2H_BUTTONS = \@T2H_CHAPTER_BUTTONS;
    &$T2H_print_navigation($fh);
    &$T2H_print_navigation($fh);
    print $fh "\n
\n";
    print $fh "\n
\n";
  }
  }
}
}
sub T2H_DEFAULT_print_chapter_footer
sub T2H_DEFAULT_print_chapter_footer
{
{
  local $T2H_BUTTONS = \@T2H_CHAPTER_BUTTONS;
  local $T2H_BUTTONS = \@T2H_CHAPTER_BUTTONS;
  &$T2H_print_navigation(@_);
  &$T2H_print_navigation(@_);
}
}
###################################################################
###################################################################
$T2H_TODAY = &pretty_date;          # like "20 September 1993"
$T2H_TODAY = &pretty_date;          # like "20 September 1993"
sub pretty_date {
sub pretty_date {
    local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);
    local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);
    ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
    ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
    $year += ($year < 70) ? 2000 : 1900;
    $year += ($year < 70) ? 2000 : 1900;
    # obachman: Let's do it as the Americans do
    # obachman: Let's do it as the Americans do
    return($MONTH_NAMES->{$T2H_LANG}[$mon] . ", " . $mday . " " . $year);
    return($MONTH_NAMES->{$T2H_LANG}[$mon] . ", " . $mday . " " . $year);
}
}
###################################################################
###################################################################
# Layout of standard header and footer
# Layout of standard header and footer
#
#
# Set the default body text, inserted between 
# Set the default body text, inserted between 
###$T2H_BODYTEXT = 'LANG="EN" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"';
###$T2H_BODYTEXT = 'LANG="EN" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"';
$T2H_BODYTEXT = 'LANG="' . $T2H_LANG . '" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"';
$T2H_BODYTEXT = 'LANG="' . $T2H_LANG . '" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000"';
# text inserted after 
# text inserted after 
$T2H_AFTER_BODY_OPEN = '';
$T2H_AFTER_BODY_OPEN = '';
#text inserted before 
#text inserted before 
$T2H_PRE_BODY_CLOSE = '';
$T2H_PRE_BODY_CLOSE = '';
# this is used in footer
# this is used in footer
$T2H_ADDRESS = "by $T2H_USER " if $T2H_USER;
$T2H_ADDRESS = "by $T2H_USER " if $T2H_USER;
$T2H_ADDRESS .= "on $T2H_TODAY";
$T2H_ADDRESS .= "on $T2H_TODAY";
# this is added inside  after  and some META NAME stuff</code></pre></td>
        <td class="diff"><pre><code># this is added inside <HEAD></HEAD> after <TITLE> and some META NAME stuff</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code># can be used for <style> <script>, <meta> tags</code></pre></td>
        <td class="diff"><pre><code># can be used for <style> <script>, <meta> tags</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>$T2H_EXTRA_HEAD = '';</code></pre></td>
        <td class="diff"><pre><code>$T2H_EXTRA_HEAD = '';</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code></code></pre></td>
        <td class="diff"><pre><code></code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>sub T2H_DEFAULT_print_page_head</code></pre></td>
        <td class="diff"><pre><code>sub T2H_DEFAULT_print_page_head</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>{</code></pre></td>
        <td class="diff"><pre><code>{</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>  my $fh = shift;</code></pre></td>
        <td class="diff"><pre><code>  my $fh = shift;</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>  my $longtitle = "$T2H_THISDOC{title}: $T2H_NAME{This}";</code></pre></td>
        <td class="diff"><pre><code>  my $longtitle = "$T2H_THISDOC{title}: $T2H_NAME{This}";</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>  print $fh <<EOT;</code></pre></td>
        <td class="diff"><pre><code>  print $fh <<EOT;</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code><HTML></code></pre></td>
        <td class="diff"><pre><code><HTML></code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>$T2H_DOCTYPE</code></pre></td>
        <td class="diff"><pre><code>$T2H_DOCTYPE</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code><!-- Created on $T2H_TODAY by $THISPROG --></code></pre></td>
        <td class="diff"><pre><code><!-- Created on $T2H_TODAY by $THISPROG --></code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code><!--</code></pre></td>
        <td class="diff"><pre><code><!--</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>$T2H_AUTHORS</code></pre></td>
        <td class="diff"><pre><code>$T2H_AUTHORS</code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code>--></code></pre></td>
        <td class="diff"><pre><code>--></code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code><HEAD></code></pre></td>
        <td class="diff"><pre><code><HEAD></code></pre></td>
      </tr>
      <tr class="diffcode">
        <td class="diff"><pre><code><TITLE>$longtitle
$longtitle
$T2H_EXTRA_HEAD
$T2H_EXTRA_HEAD
$T2H_AFTER_BODY_OPEN
$T2H_AFTER_BODY_OPEN
EOT
EOT
}
}
sub T2H_DEFAULT_print_page_foot
sub T2H_DEFAULT_print_page_foot
{
{
  my $fh = shift;
  my $fh = shift;
  print $fh <
  print $fh <


This document was generated
This document was generated
$T2H_ADDRESS
$T2H_ADDRESS
using texi2html
using texi2html
$T2H_PRE_BODY_CLOSE
$T2H_PRE_BODY_CLOSE
EOT
EOT
}
}
###################################################################
###################################################################
# Layout of navigation panel
# Layout of navigation panel
# if this is set, then a vertical navigation panel is used
# if this is set, then a vertical navigation panel is used
$T2H_VERTICAL_HEAD_NAVIGATION = 0;
$T2H_VERTICAL_HEAD_NAVIGATION = 0;
sub T2H_DEFAULT_print_head_navigation
sub T2H_DEFAULT_print_head_navigation
{
{
  my $fh = shift;
  my $fh = shift;
  if ($T2H_VERTICAL_HEAD_NAVIGATION)
  if ($T2H_VERTICAL_HEAD_NAVIGATION)
  {
  {
    print $fh <
    print $fh <
EOT
EOT
  }
  }
  &$T2H_print_navigation($fh, $T2H_VERTICAL_HEAD_NAVIGATION);
  &$T2H_print_navigation($fh, $T2H_VERTICAL_HEAD_NAVIGATION);
  if ($T2H_VERTICAL_HEAD_NAVIGATION)
  if ($T2H_VERTICAL_HEAD_NAVIGATION)
  {
  {
    print $fh <
    print $fh <
EOT
EOT
  }
  }
  elsif ($T2H_SPLIT eq 'section')
  elsif ($T2H_SPLIT eq 'section')
  {
  {
    print $fh "
\n";
    print $fh "
\n";
  }
  }
}
}
# Specifies the minimum page length required before a navigation panel
# Specifies the minimum page length required before a navigation panel
# is placed at the bottom of a page (the default is that of latex2html)
# is placed at the bottom of a page (the default is that of latex2html)
# T2H_THIS_WORDS_IN_PAGE holds number of words of current page
# T2H_THIS_WORDS_IN_PAGE holds number of words of current page
$T2H_WORDS_IN_PAGE = 300;
$T2H_WORDS_IN_PAGE = 300;
sub T2H_DEFAULT_print_foot_navigation
sub T2H_DEFAULT_print_foot_navigation
{
{
  my $fh = shift;
  my $fh = shift;
  my $nwords = shift;
  my $nwords = shift;
  if ($T2H_VERTICAL_HEAD_NAVIGATION)
  if ($T2H_VERTICAL_HEAD_NAVIGATION)
  {
  {
    print $fh <
    print $fh <
EOT
EOT
  }
  }
  print $fh "
\n";
  print $fh "
\n";
  &$T2H_print_navigation($fh) if ($nwords >= $T2H_WORDS_IN_PAGE)
  &$T2H_print_navigation($fh) if ($nwords >= $T2H_WORDS_IN_PAGE)
}
}
######################################################################
######################################################################
# navigation panel
# navigation panel
#
#
# specify in this array which "buttons" should appear in which order
# specify in this array which "buttons" should appear in which order
# in the navigation panel for sections; use ' ' for empty buttons (space)
# in the navigation panel for sections; use ' ' for empty buttons (space)
@T2H_SECTION_BUTTONS =
@T2H_SECTION_BUTTONS =
  (
  (
   'Back', 'Forward', ' ', 'FastBack', 'Up', 'FastForward',
   'Back', 'Forward', ' ', 'FastBack', 'Up', 'FastForward',
   ' ', ' ', ' ', ' ',
   ' ', ' ', ' ', ' ',
   'Top', 'Contents', 'Index', 'About',
   'Top', 'Contents', 'Index', 'About',
  );
  );
# buttons for misc stuff
# buttons for misc stuff
@T2H_MISC_BUTTONS = ('Top', 'Contents', 'Index', 'About');
@T2H_MISC_BUTTONS = ('Top', 'Contents', 'Index', 'About');
# insert here name of icon images for buttons
# insert here name of icon images for buttons
# Icons are used, if $T2H_ICONS and resp. value are set
# Icons are used, if $T2H_ICONS and resp. value are set
%T2H_ACTIVE_ICONS =
%T2H_ACTIVE_ICONS =
  (
  (
   'Top',      '',
   'Top',      '',
   'Contents', '',
   'Contents', '',
   'Overview', '',
   'Overview', '',
   'Index',    '',
   'Index',    '',
   'Back',     '',
   'Back',     '',
   'FastBack', '',
   'FastBack', '',
   'Prev',     '',
   'Prev',     '',
   'Up',       '',
   'Up',       '',
   'Next',     '',
   'Next',     '',
   'Forward',  '',
   'Forward',  '',
   'FastForward', '',
   'FastForward', '',
   'About' ,    '',
   'About' ,    '',
   'First',    '',
   'First',    '',
   'Last',     '',
   'Last',     '',
   ' ',        ''
   ' ',        ''
  );
  );
# insert here name of icon images for these, if button is inactive
# insert here name of icon images for these, if button is inactive
%T2H_PASSIVE_ICONS =
%T2H_PASSIVE_ICONS =
  (
  (
   'Top',      '',
   'Top',      '',
   'Contents', '',
   'Contents', '',
   'Overview', '',
   'Overview', '',
   'Index',    '',
   'Index',    '',
   'Back',     '',
   'Back',     '',
   'FastBack', '',
   'FastBack', '',
   'Prev',     '',
   'Prev',     '',
   'Up',       '',
   'Up',       '',
   'Next',     '',
   'Next',     '',
   'Forward',  '',
   'Forward',  '',
   'FastForward', '',
   'FastForward', '',
   'About',     '',
   'About',     '',
   'First',    '',
   'First',    '',
   'Last',     '',
   'Last',     '',
  );
  );
# how to create IMG tag
# how to create IMG tag
sub T2H_DEFAULT_button_icon_img
sub T2H_DEFAULT_button_icon_img
{
{
  my $button = shift;
  my $button = shift;
  my $icon = shift;
  my $icon = shift;
  my $name = shift;
  my $name = shift;
  return qq{$button: $name};
  return qq{$button: $name};
}
}
# Names of text as alternative for icons
# Names of text as alternative for icons
%T2H_NAVIGATION_TEXT =
%T2H_NAVIGATION_TEXT =
  (
  (
   'Top',      'Top',
   'Top',      'Top',
   'Contents', 'Contents',
   'Contents', 'Contents',
   'Overview', 'Overview',
   'Overview', 'Overview',
   'Index',    'Index',
   'Index',    'Index',
   ' ',        '   ',
   ' ',        '   ',
   'Back',     ' < ',
   'Back',     ' < ',
   'FastBack', ' << ',
   'FastBack', ' << ',
   'Prev',     'Prev',
   'Prev',     'Prev',
   'Up',       ' Up ',
   'Up',       ' Up ',
   'Next',     'Next',
   'Next',     'Next',
   'Forward',  ' > ',
   'Forward',  ' > ',
   'FastForward',  ' >> ',
   'FastForward',  ' >> ',
   'About',     ' ? ',
   'About',     ' ? ',
   'First',    ' |< ',
   'First',    ' |< ',
   'Last',     ' >| '
   'Last',     ' >| '
  );
  );
sub T2H_DEFAULT_print_navigation
sub T2H_DEFAULT_print_navigation
{
{
  my $fh = shift;
  my $fh = shift;
  my $vertical = shift;
  my $vertical = shift;
  my $spacing = 1;
  my $spacing = 1;
  print $fh "\n";
  print $fh "\n";" unless $vertical;" unless $vertical;\n} if $vertical;\n} if $vertical;\n";\n";\n" if $vertical;\n" if $vertical;" unless $vertical;" unless $vertical;
  print $fh "
  print $fh "
  for $button (@$T2H_BUTTONS)
  for $button (@$T2H_BUTTONS)
  {
  {
    print $fh qq{
    print $fh qq{
    print $fh qq{
};
    print $fh qq{
};
    if (ref($button) eq 'CODE')
    if (ref($button) eq 'CODE')
    {
    {
      &$button($fh, $vertical);
      &$button($fh, $vertical);
    }
    }
    elsif ($button eq ' ')
    elsif ($button eq ' ')
    { # handle space button
    { # handle space button
      print $fh
      print $fh
        $T2H_ICONS && $T2H_ACTIVE_ICONS{' '} ?
        $T2H_ICONS && $T2H_ACTIVE_ICONS{' '} ?
         &$T2H_button_icon_img($button, $T2H_ACTIVE_ICONS{' '}) :
         &$T2H_button_icon_img($button, $T2H_ACTIVE_ICONS{' '}) :
         $T2H_NAVIGATION_TEXT{' '};
         $T2H_NAVIGATION_TEXT{' '};
      next;
      next;
    }
    }
    elsif ($T2H_HREF{$button})
    elsif ($T2H_HREF{$button})
    { # button is active
    { # button is active
      print $fh
      print $fh
         $T2H_ICONS && $T2H_ACTIVE_ICONS{$button} ? # use icon ?
         $T2H_ICONS && $T2H_ACTIVE_ICONS{$button} ? # use icon ?
           t2h_anchor('', $T2H_HREF{$button},  # yes
           t2h_anchor('', $T2H_HREF{$button},  # yes
                    &$T2H_button_icon_img($button,
                    &$T2H_button_icon_img($button,
                                        $T2H_ACTIVE_ICONS{$button},
                                        $T2H_ACTIVE_ICONS{$button},
                                        $T2H_NAME{$button}))
                                        $T2H_NAME{$button}))
         : # use text
         : # use text
         "[" .
         "[" .
         t2h_anchor('', $T2H_HREF{$button}, $T2H_NAVIGATION_TEXT{$button}) .
         t2h_anchor('', $T2H_HREF{$button}, $T2H_NAVIGATION_TEXT{$button}) .
         "]";
         "]";
    }
    }
    else
    else
    { # button is passive
    { # button is passive
      print $fh
      print $fh
        $T2H_ICONS && $T2H_PASSIVE_ICONS{$button} ?
        $T2H_ICONS && $T2H_PASSIVE_ICONS{$button} ?
         &$T2H_button_icon_img($button,
         &$T2H_button_icon_img($button,
                               $T2H_PASSIVE_ICONS{$button},
                               $T2H_PASSIVE_ICONS{$button},
                               $T2H_NAME{$button}) :
                               $T2H_NAME{$button}) :
         "[" . $T2H_NAVIGATION_TEXT{$button} . "]";
         "[" . $T2H_NAVIGATION_TEXT{$button} . "]";
    }
    }
    print $fh "
    print $fh "
    print $fh "
    print $fh "
  }
  }
  print $fh "
  print $fh "
  print $fh "
\n";
  print $fh "
\n";
}
}
######################################################################
######################################################################
# Frames: this is from "Richard Y. Kim" 
# Frames: this is from "Richard Y. Kim" 
# Should be improved to be more conforming to other _print* functions
# Should be improved to be more conforming to other _print* functions
sub T2H_DEFAULT_print_frame
sub T2H_DEFAULT_print_frame
{
{
  my $fh = shift;
  my $fh = shift;
  print $fh <
  print $fh <
$T2H_THISDOC{title}
$T2H_THISDOC{title}
  
  
  
  
EOT
EOT
}
}
sub T2H_DEFAULT_print_toc_frame
sub T2H_DEFAULT_print_toc_frame
{
{
  my $fh = shift;
  my $fh = shift;
  &$T2H_print_page_head($fh);
  &$T2H_print_page_head($fh);
  print $fh <
  print $fh <

Content

Content

EOT
EOT
  print $fh map {s/HREF=/target=\"main\" HREF=/; $_;} @stoc_lines;
  print $fh map {s/HREF=/target=\"main\" HREF=/; $_;} @stoc_lines;
  print $fh "\n";
  print $fh "\n";
}
}
######################################################################
######################################################################
# About page
# About page
#
#
# T2H_PRE_ABOUT might be a function
# T2H_PRE_ABOUT might be a function
$T2H_PRE_ABOUT = <
$T2H_PRE_ABOUT = <
This document was generated $T2H_ADDRESS
This document was generated $T2H_ADDRESS
using texi2html
using texi2html

EOT
EOT
$T2H_AFTER_ABOUT = '';
$T2H_AFTER_ABOUT = '';
sub T2H_DEFAULT_about_body
sub T2H_DEFAULT_about_body
{
{
  my $about;
  my $about;
  if (ref($T2H_PRE_ABOUT) eq 'CODE')
  if (ref($T2H_PRE_ABOUT) eq 'CODE')
  {
  {
    $about = &$T2H_PRE_ABOUT();
    $about = &$T2H_PRE_ABOUT();
  }
  }
  else
  else
  {
  {
    $about = $T2H_PRE_ABOUT;
    $about = $T2H_PRE_ABOUT;
  }
  }
  $about .= <
  $about .= <
The buttons in the navigation panels have the following meaning:
The buttons in the navigation panels have the following meaning:

Button
Button
Name
Name
Go to
Go to
From 1.2.3 go to
From 1.2.3 go to
EOT
EOT
  for $button (@T2H_SECTION_BUTTONS)
  for $button (@T2H_SECTION_BUTTONS)
  {
  {
    next if $button eq ' ' || ref($button) eq 'CODE';
    next if $button eq ' ' || ref($button) eq 'CODE';
    $about .= <
    $about .= <
EOT
EOT
    $about .=
    $about .=
      ($T2H_ICONS && $T2H_ACTIVE_ICONS{$button} ?
      ($T2H_ICONS && $T2H_ACTIVE_ICONS{$button} ?
       &$T2H_button_icon_img($button, $T2H_ACTIVE_ICONS{$button}) :
       &$T2H_button_icon_img($button, $T2H_ACTIVE_ICONS{$button}) :
       " [" . $T2H_NAVIGATION_TEXT{$button} . "] ");
       " [" . $T2H_NAVIGATION_TEXT{$button} . "] ");
    $about .= <
    $about .= <
$button
$button
$T2H_BUTTONS_GOTO{$button}
$T2H_BUTTONS_GOTO{$button}
$T2H_BUTTONS_EXAMPLE{$button}
$T2H_BUTTONS_EXAMPLE{$button}
EOT
EOT
  }
  }
  $about .= <
  $about .= <

where the  Example  assumes that the current position
where the  Example  assumes that the current position
is at  Subsubsection One-Two-Three  of a document of
is at  Subsubsection One-Two-Three  of a document of
the following structure:
the following structure:
  • 1. Section One
  • 1. Section One
  • 1.1 Subsection One-One
  • 1.1 Subsection One-One
  • ...
  • ...
  • 1.2 Subsection One-Two
  • 1.2 Subsection One-Two
  • 1.2.1 Subsubsection One-Two-One
  • 1.2.1 Subsubsection One-Two-One
  • 1.2.2 Subsubsection One-Two-Two
  • 1.2.2 Subsubsection One-Two-Two
  • 1.2.3 Subsubsection One-Two-Three    
  • 1.2.3 Subsubsection One-Two-Three    
  • <== Current Position 
    <== Current Position 
  • 1.2.4 Subsubsection One-Two-Four
  • 1.2.4 Subsubsection One-Two-Four
  • 1.3 Subsection One-Three
  • 1.3 Subsection One-Three
  • ...
  • ...
  • 1.4 Subsection One-Four
  • 1.4 Subsection One-Four
  • $T2H_AFTER_ABOUT
    $T2H_AFTER_ABOUT
    EOT
    EOT
      return $about;
      return $about;
    }
    }
    %T2H_BUTTONS_GOTO =
    %T2H_BUTTONS_GOTO =
      (
      (
       'Top',      'cover (top) of document',
       'Top',      'cover (top) of document',
       'Contents', 'table of contents',
       'Contents', 'table of contents',
       'Overview', 'short table of contents',
       'Overview', 'short table of contents',
       'Index',    'concept index',
       'Index',    'concept index',
       'Back',     'previous section in reading order',
       'Back',     'previous section in reading order',
       'FastBack', 'previous or up-and-previous section ',
       'FastBack', 'previous or up-and-previous section ',
       'Prev',     'previous section same level',
       'Prev',     'previous section same level',
       'Up',       'up section',
       'Up',       'up section',
       'Next',     'next section same level',
       'Next',     'next section same level',
       'Forward',  'next section in reading order',
       'Forward',  'next section in reading order',
       'FastForward', 'next or up-and-next section',
       'FastForward', 'next or up-and-next section',
       'About' ,    'this page',
       'About' ,    'this page',
       'First',    'first section in reading order',
       'First',    'first section in reading order',
       'Last',     'last section in reading order',
       'Last',     'last section in reading order',
      );
      );
    %T2H_BUTTONS_EXAMPLE =
    %T2H_BUTTONS_EXAMPLE =
    (
    (
       'Top',      '   ',
       'Top',      '   ',
       'Contents', '   ',
       'Contents', '   ',
       'Overview', '   ',
       'Overview', '   ',
       'Index',    '   ',
       'Index',    '   ',
       'Back',     '1.2.2',
       'Back',     '1.2.2',
       'FastBack', '1.1',
       'FastBack', '1.1',
       'Prev',     '1.2.2',
       'Prev',     '1.2.2',
       'Up',       '1.2',
       'Up',       '1.2',
       'Next',     '1.2.4',
       'Next',     '1.2.4',
       'Forward',  '1.2.4',
       'Forward',  '1.2.4',
       'FastForward', '1.3',
       'FastForward', '1.3',
       'About',     '   ',
       'About',     '   ',
       'First',    '1.',
       'First',    '1.',
       'Last',     '1.2.4',
       'Last',     '1.2.4',
    );
    );
    ######################################################################
    ######################################################################
    # from here on, its l2h init stuff
    # from here on, its l2h init stuff
    #
    #
    ## initialization for latex2html as for Singular manual generation
    ## initialization for latex2html as for Singular manual generation
    ## obachman 3/99
    ## obachman 3/99
    #
    #
    # Options controlling Titles, File-Names, Tracing and Sectioning
    # Options controlling Titles, File-Names, Tracing and Sectioning
    #
    #
    $TITLE = '';
    $TITLE = '';
    $SHORTEXTN = 0;
    $SHORTEXTN = 0;
    $LONG_TITLES = 0;
    $LONG_TITLES = 0;
    $DESTDIR = ''; # should be overwritten by cmd-line argument
    $DESTDIR = ''; # should be overwritten by cmd-line argument
    $NO_SUBDIR = 0;# should be overwritten by cmd-line argument
    $NO_SUBDIR = 0;# should be overwritten by cmd-line argument
    $PREFIX = '';  # should be overwritten by cmd-line argument
    $PREFIX = '';  # should be overwritten by cmd-line argument
    $AUTO_PREFIX = 0; # this is needed, so that prefix settings are used
    $AUTO_PREFIX = 0; # this is needed, so that prefix settings are used
    $AUTO_LINK = 0;
    $AUTO_LINK = 0;
    $SPLIT = 0;
    $SPLIT = 0;
    $MAX_LINK_DEPTH = 0;
    $MAX_LINK_DEPTH = 0;
    $TMP = ''; # should be overwritten by cmd-line argument
    $TMP = ''; # should be overwritten by cmd-line argument
    $DEBUG = 0;
    $DEBUG = 0;
    $VERBOSE = 1;
    $VERBOSE = 1;
    #
    #
    # Options controlling Extensions and Special Features
    # Options controlling Extensions and Special Features
    #
    #
    $HTML_VERSION = "3.2";
    $HTML_VERSION = "3.2";
    $TEXDEFS = 1; # we absolutely need that
    $TEXDEFS = 1; # we absolutely need that
    $EXTERNAL_FILE = '';
    $EXTERNAL_FILE = '';
    $SCALABLE_FONTS = 1;
    $SCALABLE_FONTS = 1;
    $NO_SIMPLE_MATH = 1;
    $NO_SIMPLE_MATH = 1;
    $LOCAL_ICONS = 1;
    $LOCAL_ICONS = 1;
    $SHORT_INDEX = 0;
    $SHORT_INDEX = 0;
    $NO_FOOTNODE = 1;
    $NO_FOOTNODE = 1;
    $ADDRESS = '';
    $ADDRESS = '';
    $INFO = '';
    $INFO = '';
    #
    #
    # Switches controlling Image Generation
    # Switches controlling Image Generation
    #
    #
    $ASCII_MODE = 0;
    $ASCII_MODE = 0;
    $NOLATEX = 0;
    $NOLATEX = 0;
    $EXTERNAL_IMAGES = 0;
    $EXTERNAL_IMAGES = 0;
    $PS_IMAGES = 0;
    $PS_IMAGES = 0;
    $NO_IMAGES = 0;
    $NO_IMAGES = 0;
    $IMAGES_ONLY = 0;
    $IMAGES_ONLY = 0;
    $REUSE = 2;
    $REUSE = 2;
    $ANTI_ALIAS = 1;
    $ANTI_ALIAS = 1;
    $ANTI_ALIAS_TEXT = 1;
    $ANTI_ALIAS_TEXT = 1;
    #
    #
    #Switches controlling Navigation Panels
    #Switches controlling Navigation Panels
    #
    #
    $NO_NAVIGATION = 1;
    $NO_NAVIGATION = 1;
    $ADDRESS = '';
    $ADDRESS = '';
    $INFO = 0;              # 0 = do not make a "About this document..." section
    $INFO = 0;              # 0 = do not make a "About this document..." section
    #
    #
    #Switches for Linking to other documents
    #Switches for Linking to other documents
    #
    #
    # actuall -- we don't care
    # actuall -- we don't care
    $MAX_SPLIT_DEPTH = 0;   # Stop making separate files at this depth
    $MAX_SPLIT_DEPTH = 0;   # Stop making separate files at this depth
    $MAX_LINK_DEPTH = 0;    # Stop showing child nodes at this depth
    $MAX_LINK_DEPTH = 0;    # Stop showing child nodes at this depth
    $NOLATEX = 0;           # 1 = do not pass unknown environments to Latex
    $NOLATEX = 0;           # 1 = do not pass unknown environments to Latex
    $EXTERNAL_IMAGES = 0;   # 1 = leave the images outside the document
    $EXTERNAL_IMAGES = 0;   # 1 = leave the images outside the document
    $ASCII_MODE = 0;        # 1 = do not use any icons or internal images
    $ASCII_MODE = 0;        # 1 = do not use any icons or internal images
    # 1 =  use links to external postscript images rather than inlined bitmap
    # 1 =  use links to external postscript images rather than inlined bitmap
    # images.
    # images.
    $PS_IMAGES = 0;
    $PS_IMAGES = 0;
    $SHOW_SECTION_NUMBERS = 0;
    $SHOW_SECTION_NUMBERS = 0;
    ### Other global variables ###############################################
    ### Other global variables ###############################################
    $CHILDLINE = "";
    $CHILDLINE = "";
    # This is the line width measured in pixels and it is used to right justify
    # This is the line width measured in pixels and it is used to right justify
    # equations and equation arrays;
    # equations and equation arrays;
    $LINE_WIDTH = 500;
    $LINE_WIDTH = 500;
    # Used in conjunction with AUTO_NAVIGATION
    # Used in conjunction with AUTO_NAVIGATION
    $WORDS_IN_PAGE = 300;
    $WORDS_IN_PAGE = 300;
    # Affects ONLY the way accents are processed
    # Affects ONLY the way accents are processed
    $default_language = 'english';
    $default_language = 'english';
    # The value of this variable determines how many words to use in each
    # The value of this variable determines how many words to use in each
    # title that is added to the navigation panel (see below)
    # title that is added to the navigation panel (see below)
    #
    #
    $WORDS_IN_NAVIGATION_PANEL_TITLES = 0;
    $WORDS_IN_NAVIGATION_PANEL_TITLES = 0;
    # This number will determine the size of the equations, special characters,
    # This number will determine the size of the equations, special characters,
    # and anything which will be converted into an inlined image
    # and anything which will be converted into an inlined image
    # *except* "image generating environments" such as "figure", "table"
    # *except* "image generating environments" such as "figure", "table"
    # or "minipage".
    # or "minipage".
    # Effective values are those greater than 0.
    # Effective values are those greater than 0.
    # Sensible values are between 0.1 - 4.
    # Sensible values are between 0.1 - 4.
    $MATH_SCALE_FACTOR = 1.5;
    $MATH_SCALE_FACTOR = 1.5;
    # This number will determine the size of
    # This number will determine the size of
    # image generating environments such as "figure", "table" or "minipage".
    # image generating environments such as "figure", "table" or "minipage".
    # Effective values are those greater than 0.
    # Effective values are those greater than 0.
    # Sensible values are between 0.1 - 4.
    # Sensible values are between 0.1 - 4.
    $FIGURE_SCALE_FACTOR = 1.6;
    $FIGURE_SCALE_FACTOR = 1.6;
    #  If both of the following two variables are set then the "Up" button
    #  If both of the following two variables are set then the "Up" button
    #  of the navigation panel in the first node/page of a converted document
    #  of the navigation panel in the first node/page of a converted document
    #  will point to $EXTERNAL_UP_LINK. $EXTERNAL_UP_TITLE should be set
    #  will point to $EXTERNAL_UP_LINK. $EXTERNAL_UP_TITLE should be set
    #  to some text which describes this external link.
    #  to some text which describes this external link.
    $EXTERNAL_UP_LINK = "";
    $EXTERNAL_UP_LINK = "";
    $EXTERNAL_UP_TITLE = "";
    $EXTERNAL_UP_TITLE = "";
    # If this is set then the resulting HTML will look marginally better if viewed
    # If this is set then the resulting HTML will look marginally better if viewed
    # with Netscape.
    # with Netscape.
    $NETSCAPE_HTML = 1;
    $NETSCAPE_HTML = 1;
    # Valid paper sizes are "letter", "legal", "a4","a3","a2" and "a0"
    # Valid paper sizes are "letter", "legal", "a4","a3","a2" and "a0"
    # Paper sizes has no effect other than in the time it takes to create inlined
    # Paper sizes has no effect other than in the time it takes to create inlined
    # images and in whether large images can be created at all ie
    # images and in whether large images can be created at all ie
    #  - larger paper sizes *MAY* help with large image problems
    #  - larger paper sizes *MAY* help with large image problems
    #  - smaller paper sizes are quicker to handle
    #  - smaller paper sizes are quicker to handle
    $PAPERSIZE = "a4";
    $PAPERSIZE = "a4";
    # Replace "english" with another language in order to tell LaTeX2HTML that you
    # Replace "english" with another language in order to tell LaTeX2HTML that you
    # want some generated section titles (eg "Table of Contents" or "References")
    # want some generated section titles (eg "Table of Contents" or "References")
    # to appear in a different language. Currently only "english" and "french"
    # to appear in a different language. Currently only "english" and "french"
    # is supported but it is very easy to add your own. See the example in the
    # is supported but it is very easy to add your own. See the example in the
    # file "latex2html.config"
    # file "latex2html.config"
    $TITLES_LANGUAGE = "english";
    $TITLES_LANGUAGE = "english";
    1;      # This must be the last non-comment line
    1;      # This must be the last non-comment line
    # End File texi2html.init
    # End File texi2html.init
    ######################################################################
    ######################################################################
    require "$ENV{T2H_HOME}/texi2html.init"
    require "$ENV{T2H_HOME}/texi2html.init"
      if ($0 =~ /\.pl$/ &&
      if ($0 =~ /\.pl$/ &&
          -e "$ENV{T2H_HOME}/texi2html.init" && -r "$ENV{T2H_HOME}/texi2html.init");
          -e "$ENV{T2H_HOME}/texi2html.init" && -r "$ENV{T2H_HOME}/texi2html.init");
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # Initialization                                                               #
    # Initialization                                                               #
    # Pasted content of File $(srcdir)/MySimple.pm: Command-line processing        #
    # Pasted content of File $(srcdir)/MySimple.pm: Command-line processing        #
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    # leave this within comments, and keep the require statement
    # leave this within comments, and keep the require statement
    # This way, you can directly run texi2html.pl, if $ENV{T2H_HOME}/texi2html.init
    # This way, you can directly run texi2html.pl, if $ENV{T2H_HOME}/texi2html.init
    # exists.
    # exists.
    #
    #
    package Getopt::MySimple;
    package Getopt::MySimple;
    # Name:
    # Name:
    #       Getopt::MySimple.
    #       Getopt::MySimple.
    #
    #
    # Documentation:
    # Documentation:
    #       POD-style (incomplete) documentation is in file MySimple.pod
    #       POD-style (incomplete) documentation is in file MySimple.pod
    #
    #
    # Tabs:
    # Tabs:
    #       4 spaces || die.
    #       4 spaces || die.
    #
    #
    # Author:
    # Author:
    #       Ron Savage      rpsavage@ozemail.com.au.
    #       Ron Savage      rpsavage@ozemail.com.au.
    #       1.00    19-Aug-97       Initial version.
    #       1.00    19-Aug-97       Initial version.
    #       1.10    13-Oct-97       Add arrays of switches (eg '=s@').
    #       1.10    13-Oct-97       Add arrays of switches (eg '=s@').
    #       1.20     3-Dec-97       Add 'Help' on a per-switch basis.
    #       1.20     3-Dec-97       Add 'Help' on a per-switch basis.
    #       1.30    11-Dec-97       Change 'Help' to 'verbose'. Make all hash keys lowercase.
    #       1.30    11-Dec-97       Change 'Help' to 'verbose'. Make all hash keys lowercase.
    #       1.40    10-Nov-98       Change width of help report. Restructure tests.
    #       1.40    10-Nov-98       Change width of help report. Restructure tests.
    #               1-Jul-00        Modifications for Texi2html
    #               1-Jul-00        Modifications for Texi2html
    # --------------------------------------------------------------------------
    # --------------------------------------------------------------------------
    # Locally modified by obachman (Display type instead of env, order by cmp)
    # Locally modified by obachman (Display type instead of env, order by cmp)
    # $Id: MySimple.pm,v 1.1 2000/07/03 08:44:13 obachman Exp $
    # $Id: MySimple.pm,v 1.1 2000/07/03 08:44:13 obachman Exp $
    # use strict;
    # use strict;
    # no strict 'refs';
    # no strict 'refs';
    use vars qw(@EXPORT @EXPORT_OK @ISA);
    use vars qw(@EXPORT @EXPORT_OK @ISA);
    use vars qw($fieldWidth $opt $VERSION);
    use vars qw($fieldWidth $opt $VERSION);
    use Exporter();
    use Exporter();
    use Getopt::Long;
    use Getopt::Long;
    @ISA            = qw(Exporter);
    @ISA            = qw(Exporter);
    @EXPORT         = qw();
    @EXPORT         = qw();
    @EXPORT_OK      = qw($opt);     # An alias for $self -> {'opt'}.
    @EXPORT_OK      = qw($opt);     # An alias for $self -> {'opt'}.
    # --------------------------------------------------------------------------
    # --------------------------------------------------------------------------
    $fieldWidth     = 20;
    $fieldWidth     = 20;
    $VERSION        = '1.41';
    $VERSION        = '1.41';
    # --------------------------------------------------------------------------
    # --------------------------------------------------------------------------
    sub byOrder
    sub byOrder
    {
    {
            my($self) = @_;
            my($self) = @_;
            return uc($a) cmp (uc($b));
            return uc($a) cmp (uc($b));
    }
    }
    # --------------------------------------------------------------------------
    # --------------------------------------------------------------------------
    sub dumpOptions
    sub dumpOptions
    {
    {
            my($self) = @_;
            my($self) = @_;
            print 'Option', ' ' x ($fieldWidth - length('Option') ), "Value\n";
            print 'Option', ' ' x ($fieldWidth - length('Option') ), "Value\n";
            for (sort byOrder keys(%{$self -> {'opt'} }) )
            for (sort byOrder keys(%{$self -> {'opt'} }) )
            {
            {
              print "-$_", ' ' x ($fieldWidth - (1 + length) ), "${$self->{'opt'} }{$_}\n";
              print "-$_", ' ' x ($fieldWidth - (1 + length) ), "${$self->{'opt'} }{$_}\n";
            }
            }
            print "\n";
            print "\n";
    }       # End of dumpOptions.
    }       # End of dumpOptions.
    # --------------------------------------------------------------------------
    # --------------------------------------------------------------------------
    # Return:
    # Return:
    #       0 -> Error.
    #       0 -> Error.
    #       1 -> Ok.
    #       1 -> Ok.
    sub getOptions
    sub getOptions
    {
    {
            push(@_, 0) if ($#_ == 2);      # Default for $ignoreCase is 0.
            push(@_, 0) if ($#_ == 2);      # Default for $ignoreCase is 0.
            push(@_, 1) if ($#_ == 3);      # Default for $helpThenExit is 1.
            push(@_, 1) if ($#_ == 3);      # Default for $helpThenExit is 1.
            my($self, $default, $helpText, $versionText,
            my($self, $default, $helpText, $versionText,
               $helpThenExit, $versionThenExit, $ignoreCase) = @_;
               $helpThenExit, $versionThenExit, $ignoreCase) = @_;
            $helpThenExit = 1 unless (defined($helpThenExit));
            $helpThenExit = 1 unless (defined($helpThenExit));
            $versionThenExit = 1 unless (defined($versionThenExit));
            $versionThenExit = 1 unless (defined($versionThenExit));
            $ignoreCase = 0 unless (defined($ignoreCase));
            $ignoreCase = 0 unless (defined($ignoreCase));
            $self -> {'default'}            = $default;
            $self -> {'default'}            = $default;
            $self -> {'helpText'}           = $helpText;
            $self -> {'helpText'}           = $helpText;
            $self -> {'versionText'}        = $versionText;
            $self -> {'versionText'}        = $versionText;
            $Getopt::Long::ignorecase       = $ignoreCase;
            $Getopt::Long::ignorecase       = $ignoreCase;
            unless (defined($self -> {'default'}{'help'}))
            unless (defined($self -> {'default'}{'help'}))
            {
            {
              $self -> {'default'}{'help'} =
              $self -> {'default'}{'help'} =
              {
              {
               type => ':i',
               type => ':i',
               default => '',
               default => '',
               linkage => sub {$self->helpOptions($_[1]); exit (0) if $helpThenExit;},
               linkage => sub {$self->helpOptions($_[1]); exit (0) if $helpThenExit;},
               verbose => "print help and exit"
               verbose => "print help and exit"
              };
              };
            }
            }
            unless (defined($self -> {'default'}{'version'}))
            unless (defined($self -> {'default'}{'version'}))
            {
            {
              $self -> {'default'}{'version'} =
              $self -> {'default'}{'version'} =
              {
              {
               type => '',
               type => '',
               default => '',
               default => '',
               linkage => sub {print $self->{'versionText'};  exit (0) if versionTheExit;},
               linkage => sub {print $self->{'versionText'};  exit (0) if versionTheExit;},
               verbose => "print version and exit"
               verbose => "print version and exit"
              };
              };
            }
            }
            for (keys(%{$self -> {'default'} }) )
            for (keys(%{$self -> {'default'} }) )
            {
            {
              my $type = ${$self -> {'default'} }{$_}{'type'};
              my $type = ${$self -> {'default'} }{$_}{'type'};
              push(@{$self -> {'type'} }, "$_$type");
              push(@{$self -> {'type'} }, "$_$type");
              $self->{'opt'}->{$_} =  ${$self -> {'default'} }{$_}{'linkage'}
              $self->{'opt'}->{$_} =  ${$self -> {'default'} }{$_}{'linkage'}
                if ${$self -> {'default'} }{$_}{'linkage'};
                if ${$self -> {'default'} }{$_}{'linkage'};
            }
            }
            my($result) = &GetOptions($self -> {'opt'}, @{$self -> {'type'} });
            my($result) = &GetOptions($self -> {'opt'}, @{$self -> {'type'} });
            return $result unless $result;
            return $result unless $result;
            for (keys(%{$self -> {'default'} }) )
            for (keys(%{$self -> {'default'} }) )
            {
            {
               if (! defined(${$self -> {'opt'} }{$_})) #{
               if (! defined(${$self -> {'opt'} }{$_})) #{
                {
                {
                 ${$self -> {'opt'} }{$_} = ${$self -> {'default'} }{$_}{'default'};
                 ${$self -> {'opt'} }{$_} = ${$self -> {'default'} }{$_}{'default'};
                }
                }
            }
            }
            $result;
            $result;
    }       # End of getOptions.
    }       # End of getOptions.
    # --------------------------------------------------------------------------
    # --------------------------------------------------------------------------
    sub helpOptions
    sub helpOptions
    {
    {
            my($self) = shift;
            my($self) = shift;
            my($noHelp) = shift;
            my($noHelp) = shift;
            $noHelp = 0 unless $noHelp;
            $noHelp = 0 unless $noHelp;
            my($optwidth, $typewidth, $defaultwidth, $maxlinewidth, $valind, $valwidth)
            my($optwidth, $typewidth, $defaultwidth, $maxlinewidth, $valind, $valwidth)
              = (10, 5, 9, 78, 4, 11);
              = (10, 5, 9, 78, 4, 11);
            print "$self->{'helpText'}" if ($self -> {'helpText'});
            print "$self->{'helpText'}" if ($self -> {'helpText'});
            print ' Option', ' ' x ($optwidth - length('Option') -1 ),
            print ' Option', ' ' x ($optwidth - length('Option') -1 ),
                    'Type', ' ' x ($typewidth - length('Type') + 1),
                    'Type', ' ' x ($typewidth - length('Type') + 1),
                    'Default', ' ' x ($defaultwidth - length('Default') ),
                    'Default', ' ' x ($defaultwidth - length('Default') ),
                    "Description\n";
                    "Description\n";
            for (sort byOrder keys(%{$self -> {'default'} }) )
            for (sort byOrder keys(%{$self -> {'default'} }) )
            {
            {
              my($line, $help, $option, $val);
              my($line, $help, $option, $val);
              $option = $_;
              $option = $_;
              next if ${$self->{'default'} }{$_}{'noHelp'} && ${$self->{'default'} }{$_}{'noHelp'} > $noHelp;
              next if ${$self->{'default'} }{$_}{'noHelp'} && ${$self->{'default'} }{$_}{'noHelp'} > $noHelp;
                    $line = " -$_ " . ' ' x ($optwidth - (2 + length) ) .
                    $line = " -$_ " . ' ' x ($optwidth - (2 + length) ) .
                            "${$self->{'default'} }{$_}{'type'} ".
                            "${$self->{'default'} }{$_}{'type'} ".
                            ' ' x ($typewidth - (1+length(${$self -> {'default'} }{$_}{'type'}) ));
                            ' ' x ($typewidth - (1+length(${$self -> {'default'} }{$_}{'type'}) ));
                     $val = ${$self->{'default'} }{$_}{'linkage'};
                     $val = ${$self->{'default'} }{$_}{'linkage'};
                    if ($val)
                    if ($val)
                    {
                    {
                      if (ref($val) eq 'SCALAR')
                      if (ref($val) eq 'SCALAR')
                      {
                      {
                        $val = $$val;
                        $val = $$val;
                      }
                      }
                      else
                      else
                      {
                      {
                        $val = '';
                        $val = '';
                      }
                      }
                    }
                    }
                    else
                    else
                    {
                    {
                      $val = ${$self->{'default'} }{$_}{'default'};
                      $val = ${$self->{'default'} }{$_}{'default'};
                    }
                    }
                    $line .= "$val  ";
                    $line .= "$val  ";
                    $line .= ' ' x ($optwidth + $typewidth + $defaultwidth + 1 - length($line));
                    $line .= ' ' x ($optwidth + $typewidth + $defaultwidth + 1 - length($line));
                    if (defined(${$self -> {'default'} }{$_}{'verbose'}) &&
                    if (defined(${$self -> {'default'} }{$_}{'verbose'}) &&
                      ${$self -> {'default'} }{$_}{'verbose'} ne '')
                      ${$self -> {'default'} }{$_}{'verbose'} ne '')
                  {
                  {
                    $help = "${$self->{'default'} }{$_}{'verbose'}";
                    $help = "${$self->{'default'} }{$_}{'verbose'}";
                  }
                  }
                  else
                  else
                  {
                  {
                    $help = ' ';
                    $help = ' ';
                  }
                  }
                  if ((length("$line") + length($help)) < $maxlinewidth)
                  if ((length("$line") + length($help)) < $maxlinewidth)
                  {
                  {
                    print $line , $help, "\n";
                    print $line , $help, "\n";
                  }
                  }
                  else
                  else
                  {
                  {
                    print $line, "\n", ' ' x $valind, $help, "\n";
                    print $line, "\n", ' ' x $valind, $help, "\n";
                  }
                  }
                  for $val (sort byOrder keys(%{${$self->{'default'}}{$option}{'values'}}))
                  for $val (sort byOrder keys(%{${$self->{'default'}}{$option}{'values'}}))
                  {
                  {
                    print ' ' x ($valind + 2);
                    print ' ' x ($valind + 2);
                    print $val, '  ', ' ' x ($valwidth - length($val) - 2);
                    print $val, '  ', ' ' x ($valwidth - length($val) - 2);
                    print ${$self->{'default'}}{$option}{'values'}{$val}, "\n";
                    print ${$self->{'default'}}{$option}{'values'}{$val}, "\n";
                  }
                  }
            }
            }
            print <
            print <
    Note: 'Options' may be abbreviated. 'Type' specifications mean:
    Note: 'Options' may be abbreviated. 'Type' specifications mean:
     | !    no argument: variable is set to 1 on -foo (or, to 0 on -nofoo)
     | !    no argument: variable is set to 1 on -foo (or, to 0 on -nofoo)
        =s | :s   mandatory (or, optional)  string argument
        =s | :s   mandatory (or, optional)  string argument
        =i | :i   mandatory (or, optional)  integer argument
        =i | :i   mandatory (or, optional)  integer argument
    EOT
    EOT
    }       # End of helpOptions.
    }       # End of helpOptions.
    #-------------------------------------------------------------------
    #-------------------------------------------------------------------
    sub new
    sub new
    {
    {
            my($class)                              = @_;
            my($class)                              = @_;
            my($self)                               = {};
            my($self)                               = {};
            $self -> {'default'}    = {};
            $self -> {'default'}    = {};
            $self -> {'helpText'}   = '';
            $self -> {'helpText'}   = '';
            $self -> {'opt'}                = {};
            $self -> {'opt'}                = {};
            $opt                                    = $self -> {'opt'};      # An alias for $self -> {'opt'}.
            $opt                                    = $self -> {'opt'};      # An alias for $self -> {'opt'}.
            $self -> {'type'}               = ();
            $self -> {'type'}               = ();
            return bless $self, $class;
            return bless $self, $class;
    }       # End of new.
    }       # End of new.
    # --------------------------------------------------------------------------
    # --------------------------------------------------------------------------
    1;
    1;
    # End MySimple.pm
    # End MySimple.pm
    require "$ENV{T2H_HOME}/MySimple.pm"
    require "$ENV{T2H_HOME}/MySimple.pm"
      if ($0 =~ /\.pl$/ &&
      if ($0 =~ /\.pl$/ &&
          -e "$ENV{T2H_HOME}/texi2html.init" && -r "$ENV{T2H_HOME}/texi2html.init");
          -e "$ENV{T2H_HOME}/texi2html.init" && -r "$ENV{T2H_HOME}/texi2html.init");
    package main;
    package main;
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # Constants                                                                    #
    # Constants                                                                    #
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    $DEBUG_TOC   =  1;
    $DEBUG_TOC   =  1;
    $DEBUG_INDEX =  2;
    $DEBUG_INDEX =  2;
    $DEBUG_BIB   =  4;
    $DEBUG_BIB   =  4;
    $DEBUG_GLOSS =  8;
    $DEBUG_GLOSS =  8;
    $DEBUG_DEF   = 16;
    $DEBUG_DEF   = 16;
    $DEBUG_HTML  = 32;
    $DEBUG_HTML  = 32;
    $DEBUG_USER  = 64;
    $DEBUG_USER  = 64;
    $DEBUG_L2H   = 128;
    $DEBUG_L2H   = 128;
    $BIBRE = '\[[\w\/-]+\]';                # RE for a bibliography reference
    $BIBRE = '\[[\w\/-]+\]';                # RE for a bibliography reference
    $FILERE = '[\/\w.+-]+';                 # RE for a file name
    $FILERE = '[\/\w.+-]+';                 # RE for a file name
    $VARRE = '[^\s\{\}]+';                  # RE for a variable name
    $VARRE = '[^\s\{\}]+';                  # RE for a variable name
    $NODERE = '[^,:]+';                     # RE for a node name
    $NODERE = '[^,:]+';                     # RE for a node name
    $NODESRE = '[^:]+';                     # RE for a list of node names
    $NODESRE = '[^:]+';                     # RE for a list of node names
    $ERROR = "***";                         # prefix for errors
    $ERROR = "***";                         # prefix for errors
    $WARN  = "**";                          # prefix for warnings
    $WARN  = "**";                          # prefix for warnings
                                            # program home page
                                            # program home page
    $PROTECTTAG = "_ThisIsProtected_";      # tag to recognize protected sections
    $PROTECTTAG = "_ThisIsProtected_";      # tag to recognize protected sections
    $CHAPTEREND = "\n"; # to know where a chpater ends
    $CHAPTEREND = "\n"; # to know where a chpater ends
    $SECTIONEND = "\n"; # to know where section ends
    $SECTIONEND = "\n"; # to know where section ends
    $TOPEND     = "\n"; # to know where top ends
    $TOPEND     = "\n"; # to know where top ends
    #
    #
    # pre-defined indices
    # pre-defined indices
    #
    #
    $index_properties =
    $index_properties =
    {
    {
     'c' => { name => 'cp'},
     'c' => { name => 'cp'},
     'f' => { name => 'fn', code => 1},
     'f' => { name => 'fn', code => 1},
     'v' => { name => 'vr', code => 1},
     'v' => { name => 'vr', code => 1},
     'k' => { name => 'ky', code => 1},
     'k' => { name => 'ky', code => 1},
     'p' => { name => 'pg', code => 1},
     'p' => { name => 'pg', code => 1},
     't' => { name => 'tp', code => 1}
     't' => { name => 'tp', code => 1}
    };
    };
    %predefined_index = (
    %predefined_index = (
                        'cp', 'c',
                        'cp', 'c',
                        'fn', 'f',
                        'fn', 'f',
                        'vr', 'v',
                        'vr', 'v',
                        'ky', 'k',
                        'ky', 'k',
                        'pg', 'p',
                        'pg', 'p',
                        'tp', 't',
                        'tp', 't',
                        );
                        );
    #
    #
    # valid indices
    # valid indices
    #
    #
    %valid_index = (
    %valid_index = (
                        'c', 1,
                        'c', 1,
                        'f', 1,
                        'f', 1,
                        'v', 1,
                        'v', 1,
                        'k', 1,
                        'k', 1,
                        'p', 1,
                        'p', 1,
                        't', 1,
                        't', 1,
                    );
                    );
    #
    #
    # texinfo section names to level
    # texinfo section names to level
    #
    #
    %sec2level = (
    %sec2level = (
                  'top', 0,
                  'top', 0,
                  'chapter', 1,
                  'chapter', 1,
                  'unnumbered', 1,
                  'unnumbered', 1,
                  'majorheading', 1,
                  'majorheading', 1,
                  'chapheading', 1,
                  'chapheading', 1,
                  'appendix', 1,
                  'appendix', 1,
                  'section', 2,
                  'section', 2,
                  'unnumberedsec', 2,
                  'unnumberedsec', 2,
                  'heading', 2,
                  'heading', 2,
                  'appendixsec', 2,
                  'appendixsec', 2,
                  'appendixsection', 2,
                  'appendixsection', 2,
                  'subsection', 3,
                  'subsection', 3,
                  'unnumberedsubsec', 3,
                  'unnumberedsubsec', 3,
                  'subheading', 3,
                  'subheading', 3,
                  'appendixsubsec', 3,
                  'appendixsubsec', 3,
                  'subsubsection', 4,
                  'subsubsection', 4,
                  'unnumberedsubsubsec', 4,
                  'unnumberedsubsubsec', 4,
                  'subsubheading', 4,
                  'subsubheading', 4,
                  'appendixsubsubsec', 4,
                  'appendixsubsubsec', 4,
                  );
                  );
    #
    #
    # accent map, TeX command to ISO name
    # accent map, TeX command to ISO name
    #
    #
    %accent_map = (
    %accent_map = (
                   '"',  'uml',
                   '"',  'uml',
                   '~',  'tilde',
                   '~',  'tilde',
                   '^',  'circ',
                   '^',  'circ',
                   '`',  'grave',
                   '`',  'grave',
                   '\'', 'acute',
                   '\'', 'acute',
                   );
                   );
    #
    #
    # texinfo "simple things" (@foo) to HTML ones
    # texinfo "simple things" (@foo) to HTML ones
    #
    #
    %simple_map = (
    %simple_map = (
                   # cf. makeinfo.c
                   # cf. makeinfo.c
                   "*", "
    ", # HTML+
                   "*", "
    ", # HTML+
                   " ", " ",
                   " ", " ",
                   "\t", " ",
                   "\t", " ",
                   "-", "­",        # soft hyphen
                   "-", "­",        # soft hyphen
                   "\n", "\n",
                   "\n", "\n",
                   "|", "",
                   "|", "",
                   'tab', '<\/TD>
    ',
                   'tab', '<\/TD>
    ',
                   # spacing commands
                   # spacing commands
                   ":", "",
                   ":", "",
                   "!", "!",
                   "!", "!",
                   "?", "?",
                   "?", "?",
                   ".", ".",
                   ".", ".",
                   "-", "",
                   "-", "",
                   );
                   );
    #
    #
    # texinfo "things" (@foo{}) to HTML ones
    # texinfo "things" (@foo{}) to HTML ones
    #
    #
    %things_map = (
    %things_map = (
                   'TeX', 'TeX',
                   'TeX', 'TeX',
                   'br', '

    ', # paragraph break

                   'br', '

    ', # paragraph break

                   'bullet', '*',
                   'bullet', '*',
                   'copyright', '(C)',
                   'copyright', '(C)',
                   'dots', '...<\/small>',
                   'dots', '...<\/small>',
                   'enddots', '....<\/small>',
                   'enddots', '....<\/small>',
                   'equiv', '==',
                   'equiv', '==',
                   'error', 'error-->',
                   'error', 'error-->',
                   'expansion', '==>',
                   'expansion', '==>',
                   'minus', '-',
                   'minus', '-',
                   'point', '-!-',
                   'point', '-!-',
                   'print', '-|',
                   'print', '-|',
                   'result', '=>',
                   'result', '=>',
                   'today', $T2H_TODAY,
                   'today', $T2H_TODAY,
                   'aa', 'å',
                   'aa', 'å',
                   'AA', 'Å',
                   'AA', 'Å',
                   'ae', 'æ',
                   'ae', 'æ',
                   'oe', 'œ',
                   'oe', 'œ',
                   'AE', 'Æ',
                   'AE', 'Æ',
                   'OE', 'Œ',
                   'OE', 'Œ',
                   'o',  'ø',
                   'o',  'ø',
                   'O',  'Ø',
                   'O',  'Ø',
                   'ss', 'ß',
                   'ss', 'ß',
                   'l', '\/l',
                   'l', '\/l',
                   'L', '\/L',
                   'L', '\/L',
                   'exclamdown', '¡',
                   'exclamdown', '¡',
                   'questiondown', '¿',
                   'questiondown', '¿',
                   'pounds', '£'
                   'pounds', '£'
                   );
                   );
    #
    #
    # texinfo styles (@foo{bar}) to HTML ones
    # texinfo styles (@foo{bar}) to HTML ones
    #
    #
    %style_map = (
    %style_map = (
                  'acronym', '&do_acronym',
                  'acronym', '&do_acronym',
                  'asis', '',
                  'asis', '',
                  'b', 'B',
                  'b', 'B',
                  'cite', 'CITE',
                  'cite', 'CITE',
                  'code', 'CODE',
                  'code', 'CODE',
                  'command', 'CODE',
                  'command', 'CODE',
                  'ctrl', '&do_ctrl',       # special case
                  'ctrl', '&do_ctrl',       # special case
                  'dfn', 'EM',              # DFN tag is illegal in the standard
                  'dfn', 'EM',              # DFN tag is illegal in the standard
                  'dmn', '',                # useless
                  'dmn', '',                # useless
                  'email', '&do_email',     # insert a clickable email address
                  'email', '&do_email',     # insert a clickable email address
                  'emph', 'EM',
                  'emph', 'EM',
                  'env', 'CODE',
                  'env', 'CODE',
                  'file', '"TT',            # will put quotes, cf. &apply_style
                  'file', '"TT',            # will put quotes, cf. &apply_style
                  'i', 'I',
                  'i', 'I',
                  'kbd', 'KBD',
                  'kbd', 'KBD',
                  'key', 'KBD',
                  'key', 'KBD',
                  'math', '&do_math',
                  'math', '&do_math',
                  'option', '"SAMP',        # will put quotes, cf. &apply_style
                  'option', '"SAMP',        # will put quotes, cf. &apply_style
                  'r', '',                  # unsupported
                  'r', '',                  # unsupported
                  'samp', '"SAMP',          # will put quotes, cf. &apply_style
                  'samp', '"SAMP',          # will put quotes, cf. &apply_style
                  'sc', '&do_sc',           # special case
                  'sc', '&do_sc',           # special case
                  'strong', 'STRONG',
                  'strong', 'STRONG',
                  't', 'TT',
                  't', 'TT',
                  'titlefont', '',          # useless
                  'titlefont', '',          # useless
                  'uref', '&do_uref',       # insert a clickable URL
                  'uref', '&do_uref',       # insert a clickable URL
                  'url', '&do_url',         # insert a clickable URL
                  'url', '&do_url',         # insert a clickable URL
                  'var', 'VAR',
                  'var', 'VAR',
                  'w', '',                  # unsupported
                  'w', '',                  # unsupported
                  'H', '&do_accent',
                  'H', '&do_accent',
                  'dotaccent', '&do_accent',
                  'dotaccent', '&do_accent',
                  'ringaccent','&do_accent',
                  'ringaccent','&do_accent',
                  'tieaccent', '&do_accent',
                  'tieaccent', '&do_accent',
                  'u','&do_accent',
                  'u','&do_accent',
                  'ubaraccent','&do_accent',
                  'ubaraccent','&do_accent',
                  'udotaccent','&do_accent',
                  'udotaccent','&do_accent',
                  'v', '&do_accent',
                  'v', '&do_accent',
                  ',', '&do_accent',
                  ',', '&do_accent',
                  'dotless', '&do_accent'
                  'dotless', '&do_accent'
                  );
                  );
    #
    #
    # texinfo format (@foo/@end foo) to HTML ones
    # texinfo format (@foo/@end foo) to HTML ones
    #
    #
    %format_map = (
    %format_map = (
                   'quotation', 'BLOCKQUOTE',
                   'quotation', 'BLOCKQUOTE',
                   # lists
                   # lists
                   'itemize', 'UL',
                   'itemize', 'UL',
                   'enumerate', 'OL',
                   'enumerate', 'OL',
                   # poorly supported
                   # poorly supported
                   'flushleft', 'PRE',
                   'flushleft', 'PRE',
                   'flushright', 'PRE',
                   'flushright', 'PRE',
                   );
                   );
    #
    #
    # an eval of these $complex_format_map->{what}->[0] yields beginning
    # an eval of these $complex_format_map->{what}->[0] yields beginning
    # an eval of these $complex_format_map->{what}->[1] yieleds end
    # an eval of these $complex_format_map->{what}->[1] yieleds end
    $complex_format_map =
    $complex_format_map =
    {
    {
     example =>
     example =>
     [
     [
      q{"$T2H_EXAMPLE_INDENT_CELL
    "},
      q{"$T2H_EXAMPLE_INDENT_CELL
    "},
      q{'
    '}
      q{'
    '}
     ],
     ],
     smallexample =>
     smallexample =>
     [
     [
      q{"$T2H_SMALL_EXAMPLE_INDENT_CELL
    "},
      q{"$T2H_SMALL_EXAMPLE_INDENT_CELL
    "},
      q{'
    '}
      q{'
    '}
     ],
     ],
     display =>
     display =>
     [
     [
      q{"$T2H_EXAMPLE_INDENT_CELL
    '},
      q{"$T2H_EXAMPLE_INDENT_CELL
    '},
      q{'
    '}
      q{'
    '}
     ],
     ],
     smalldisplay =>
     smalldisplay =>
     [
     [
      q{"$T2H_SMALL_EXAMPLE_INDENT_CELL
    '},
      q{"$T2H_SMALL_EXAMPLE_INDENT_CELL
    '},
      q{'
    '}
      q{'
    '}
     ]
     ]
    };
    };
    $complex_format_map->{lisp} = $complex_format_map->{example};
    $complex_format_map->{lisp} = $complex_format_map->{example};
    $complex_format_map->{smalllisp} = $complex_format_map->{smallexample};
    $complex_format_map->{smalllisp} = $complex_format_map->{smallexample};
    $complex_format_map->{format} = $complex_format_map->{display};
    $complex_format_map->{format} = $complex_format_map->{display};
    $complex_format_map->{smallformat} = $complex_format_map->{smalldisplay};
    $complex_format_map->{smallformat} = $complex_format_map->{smalldisplay};
    #
    #
    # texinfo definition shortcuts to real ones
    # texinfo definition shortcuts to real ones
    #
    #
    %def_map = (
    %def_map = (
                # basic commands
                # basic commands
                'deffn', 0,
                'deffn', 0,
                'defvr', 0,
                'defvr', 0,
                'deftypefn', 0,
                'deftypefn', 0,
                'deftypevr', 0,
                'deftypevr', 0,
                'defcv', 0,
                'defcv', 0,
                'defop', 0,
                'defop', 0,
                'deftp', 0,
                'deftp', 0,
                # basic x commands
                # basic x commands
                'deffnx', 0,
                'deffnx', 0,
                'defvrx', 0,
                'defvrx', 0,
                'deftypefnx', 0,
                'deftypefnx', 0,
                'deftypevrx', 0,
                'deftypevrx', 0,
                'defcvx', 0,
                'defcvx', 0,
                'defopx', 0,
                'defopx', 0,
                'deftpx', 0,
                'deftpx', 0,
                # shortcuts
                # shortcuts
                'defun', 'deffn Function',
                'defun', 'deffn Function',
                'defmac', 'deffn Macro',
                'defmac', 'deffn Macro',
                'defspec', 'deffn {Special Form}',
                'defspec', 'deffn {Special Form}',
                'defvar', 'defvr Variable',
                'defvar', 'defvr Variable',
                'defopt', 'defvr {User Option}',
                'defopt', 'defvr {User Option}',
                'deftypefun', 'deftypefn Function',
                'deftypefun', 'deftypefn Function',
                'deftypevar', 'deftypevr Variable',
                'deftypevar', 'deftypevr Variable',
                'defivar', 'defcv {Instance Variable}',
                'defivar', 'defcv {Instance Variable}',
                'deftypeivar', 'defcv {Instance Variable}', # NEW: FIXME
                'deftypeivar', 'defcv {Instance Variable}', # NEW: FIXME
                'defmethod', 'defop Method',
                'defmethod', 'defop Method',
                'deftypemethod', 'defop Method', # NEW:FIXME
                'deftypemethod', 'defop Method', # NEW:FIXME
                # x shortcuts
                # x shortcuts
                'defunx', 'deffnx Function',
                'defunx', 'deffnx Function',
                'defmacx', 'deffnx Macro',
                'defmacx', 'deffnx Macro',
                'defspecx', 'deffnx {Special Form}',
                'defspecx', 'deffnx {Special Form}',
                'defvarx', 'defvrx Variable',
                'defvarx', 'defvrx Variable',
                'defoptx', 'defvrx {User Option}',
                'defoptx', 'defvrx {User Option}',
                'deftypefunx', 'deftypefnx Function',
                'deftypefunx', 'deftypefnx Function',
                'deftypevarx', 'deftypevrx Variable',
                'deftypevarx', 'deftypevrx Variable',
                'defivarx', 'defcvx {Instance Variable}',
                'defivarx', 'defcvx {Instance Variable}',
                'defmethodx', 'defopx Method',
                'defmethodx', 'defopx Method',
                );
                );
    #
    #
    # things to skip
    # things to skip
    #
    #
    %to_skip = (
    %to_skip = (
                # comments
                # comments
                'c', 1,
                'c', 1,
                'comment', 1,
                'comment', 1,
                'ifnotinfo', 1,
                'ifnotinfo', 1,
                'ifnottex', 1,
                'ifnottex', 1,
                'ifhtml', 1,
                'ifhtml', 1,
                'end ifhtml', 1,
                'end ifhtml', 1,
                'end ifnotinfo', 1,
                'end ifnotinfo', 1,
                'end ifnottex', 1,
                'end ifnottex', 1,
                # useless
                # useless
                'detailmenu', 1,
                'detailmenu', 1,
                'direntry', 1,
                'direntry', 1,
                'contents', 1,
                'contents', 1,
                'shortcontents', 1,
                'shortcontents', 1,
                'summarycontents', 1,
                'summarycontents', 1,
                'footnotestyle', 1,
                'footnotestyle', 1,
                'end ifclear', 1,
                'end ifclear', 1,
                'end ifset', 1,
                'end ifset', 1,
                'titlepage', 1,
                'titlepage', 1,
                'end titlepage', 1,
                'end titlepage', 1,
                # unsupported commands (formatting)
                # unsupported commands (formatting)
                'afourpaper', 1,
                'afourpaper', 1,
                'cropmarks', 1,
                'cropmarks', 1,
                'finalout', 1,
                'finalout', 1,
                'headings', 1,
                'headings', 1,
                'sp', 1,
                'sp', 1,
                'need', 1,
                'need', 1,
                'page', 1,
                'page', 1,
                'setchapternewpage', 1,
                'setchapternewpage', 1,
                'everyheading', 1,
                'everyheading', 1,
                'everyfooting', 1,
                'everyfooting', 1,
                'evenheading', 1,
                'evenheading', 1,
                'evenfooting', 1,
                'evenfooting', 1,
                'oddheading', 1,
                'oddheading', 1,
                'oddfooting', 1,
                'oddfooting', 1,
                'smallbook', 1,
                'smallbook', 1,
                'vskip', 1,
                'vskip', 1,
                'filbreak', 1,
                'filbreak', 1,
                'paragraphindent', 1,
                'paragraphindent', 1,
                # unsupported formats
                # unsupported formats
                'cartouche', 1,
                'cartouche', 1,
                'end cartouche', 1,
                'end cartouche', 1,
                'group', 1,
                'group', 1,
                'end group', 1,
                'end group', 1,
                );
                );
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # Argument parsing, initialisation                                             #
    # Argument parsing, initialisation                                             #
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    #
    #
    # flush stdout and stderr after every write
    # flush stdout and stderr after every write
    #
    #
    select(STDERR);
    select(STDERR);
    $| = 1;
    $| = 1;
    select(STDOUT);
    select(STDOUT);
    $| = 1;
    $| = 1;
    %value = ();                            # hold texinfo variables, see also -D
    %value = ();                            # hold texinfo variables, see also -D
    $use_bibliography = 1;
    $use_bibliography = 1;
    $use_acc = 1;
    $use_acc = 1;
    #
    #
    # called on -init-file
    # called on -init-file
    sub LoadInitFile
    sub LoadInitFile
    {
    {
      my $init_file = shift;
      my $init_file = shift;
      # second argument is value of options
      # second argument is value of options
      $init_file = shift;
      $init_file = shift;
      if (-f $init_file)
      if (-f $init_file)
      {
      {
        print "# reading initialization file from $init_file\n"
        print "# reading initialization file from $init_file\n"
          if ($T2H_VERBOSE);
          if ($T2H_VERBOSE);
        require($init_file);
        require($init_file);
      }
      }
      else
      else
      {
      {
        print "$ERROR Error: can't read init file $int_file\n";
        print "$ERROR Error: can't read init file $int_file\n";
        $init_file = '';
        $init_file = '';
      }
      }
    }
    }
    #
    #
    # called on -lang
    # called on -lang
    sub SetDocumentLanguage
    sub SetDocumentLanguage
    {
    {
      my $lang = shift;
      my $lang = shift;
      if (! exists($T2H_WORDS->{$lang}))
      if (! exists($T2H_WORDS->{$lang}))
      {
      {
        warn "$ERROR: Language specs for '$lang' do not exists. Reverting to '" .
        warn "$ERROR: Language specs for '$lang' do not exists. Reverting to '" .
          ($T2H_LANG ? T2H_LANG : "en") . "'\n";
          ($T2H_LANG ? T2H_LANG : "en") . "'\n";
      }
      }
      else
      else
      {
      {
        print "# using '$lang' as document language\n" if ($T2H_VERBOSE);
        print "# using '$lang' as document language\n" if ($T2H_VERBOSE);
        $T2H_LANG = $lang;
        $T2H_LANG = $lang;
      }
      }
    }
    }
    ##
    ##
    ## obsolete cmd line options
    ## obsolete cmd line options
    ##
    ##
    $T2H_OBSOLETE_OPTIONS -> {'no-section_navigation'} =
    $T2H_OBSOLETE_OPTIONS -> {'no-section_navigation'} =
    {
    {
     type => '!',
     type => '!',
     linkage => sub {$main::T2H_SECTION_NAVIGATION = 0;},
     linkage => sub {$main::T2H_SECTION_NAVIGATION = 0;},
     verbose => 'obsolete, use -nosec_nav',
     verbose => 'obsolete, use -nosec_nav',
     noHelp => 2,
     noHelp => 2,
    };
    };
    $T2H_OBSOLETE_OPTIONS -> {use_acc} =
    $T2H_OBSOLETE_OPTIONS -> {use_acc} =
    {
    {
     type => '!',
     type => '!',
     linkage => \$use_acc,
     linkage => \$use_acc,
     verbose => 'obsolete',
     verbose => 'obsolete',
     noHelp => 2
     noHelp => 2
    };
    };
    $T2H_OBSOLETE_OPTIONS -> {expandinfo} =
    $T2H_OBSOLETE_OPTIONS -> {expandinfo} =
    {
    {
     type => '!',
     type => '!',
     linkage => sub {$main::T2H_EXPAND = 'info';},
     linkage => sub {$main::T2H_EXPAND = 'info';},
     verbose => 'obsolete, use "-expand info" instead',
     verbose => 'obsolete, use "-expand info" instead',
     noHelp => 2,
     noHelp => 2,
    };
    };
    $T2H_OBSOLETE_OPTIONS -> {expandtex} =
    $T2H_OBSOLETE_OPTIONS -> {expandtex} =
    {
    {
     type => '!',
     type => '!',
     linkage => sub {$main::T2H_EXPAND = 'tex';},
     linkage => sub {$main::T2H_EXPAND = 'tex';},
     verbose => 'obsolete, use "-expand tex" instead',
     verbose => 'obsolete, use "-expand tex" instead',
     noHelp => 2,
     noHelp => 2,
    };
    };
    $T2H_OBSOLETE_OPTIONS -> {monolithic} =
    $T2H_OBSOLETE_OPTIONS -> {monolithic} =
    {
    {
     type => '!',
     type => '!',
     linkage => sub {$main::T2H_SPLIT = '';},
     linkage => sub {$main::T2H_SPLIT = '';},
     verbose => 'obsolete, use "-split no" instead',
     verbose => 'obsolete, use "-split no" instead',
     noHelp => 2
     noHelp => 2
    };
    };
    $T2H_OBSOLETE_OPTIONS -> {split_node} =
    $T2H_OBSOLETE_OPTIONS -> {split_node} =
    {
    {
     type => '!',
     type => '!',
     linkage => sub{$main::T2H_SPLIT = 'section';},
     linkage => sub{$main::T2H_SPLIT = 'section';},
     verbose => 'obsolete, use "-split section" instead',
     verbose => 'obsolete, use "-split section" instead',
     noHelp => 2,
     noHelp => 2,
    };
    };
    $T2H_OBSOLETE_OPTIONS -> {split_chapter} =
    $T2H_OBSOLETE_OPTIONS -> {split_chapter} =
    {
    {
     type => '!',
     type => '!',
     linkage => sub{$main::T2H_SPLIT = 'chapter';},
     linkage => sub{$main::T2H_SPLIT = 'chapter';},
     verbose => 'obsolete, use "-split chapter" instead',
     verbose => 'obsolete, use "-split chapter" instead',
     noHelp => 2,
     noHelp => 2,
    };
    };
    $T2H_OBSOLETE_OPTIONS -> {no_verbose} =
    $T2H_OBSOLETE_OPTIONS -> {no_verbose} =
    {
    {
     type => '!',
     type => '!',
     linkage => sub {$main::T2H_VERBOSE = 0;},
     linkage => sub {$main::T2H_VERBOSE = 0;},
     verbose => 'obsolete, use -noverbose instead',
     verbose => 'obsolete, use -noverbose instead',
     noHelp => 2,
     noHelp => 2,
    };
    };
    $T2H_OBSOLETE_OPTIONS -> {output_file} =
    $T2H_OBSOLETE_OPTIONS -> {output_file} =
    {
    {
     type => '=s',
     type => '=s',
     linkage => sub {$main::T2H_OUT = @_[1]; $T2H_SPLIT = '';},
     linkage => sub {$main::T2H_OUT = @_[1]; $T2H_SPLIT = '';},
     verbose => 'obsolete, use -out_file instead',
     verbose => 'obsolete, use -out_file instead',
     noHelp => 2
     noHelp => 2
    };
    };
    $T2H_OBSOLETE_OPTIONS -> {section_navigation} =
    $T2H_OBSOLETE_OPTIONS -> {section_navigation} =
    {
    {
     type => '!',
     type => '!',
     linkage => \$T2H_SECTION_NAVIGATION,
     linkage => \$T2H_SECTION_NAVIGATION,
     verbose => 'obsolete, use -sec_nav instead',
     verbose => 'obsolete, use -sec_nav instead',
     noHelp => 2,
     noHelp => 2,
    };
    };
    $T2H_OBSOLETE_OPTIONS -> {verbose} =
    $T2H_OBSOLETE_OPTIONS -> {verbose} =
    {
    {
     type => '!',
     type => '!',
     linkage => \$T2H_VERBOSE,
     linkage => \$T2H_VERBOSE,
     verbose => 'obsolete, use -Verbose instead',
     verbose => 'obsolete, use -Verbose instead',
     noHelp => 2
     noHelp => 2
    };
    };
    # read initialzation from $sysconfdir/texi2htmlrc or $HOME/.texi2htmlrc
    # read initialzation from $sysconfdir/texi2htmlrc or $HOME/.texi2htmlrc
    my $home = $ENV{HOME};
    my $home = $ENV{HOME};
    defined($home) or $home = '';
    defined($home) or $home = '';
    foreach $i ('/usr/local/etc/texi2htmlrc', "$home/.texi2htmlrc") {
    foreach $i ('/usr/local/etc/texi2htmlrc', "$home/.texi2htmlrc") {
        if (-f $i) {
        if (-f $i) {
            print "# reading initialization file from $i\n"
            print "# reading initialization file from $i\n"
                if ($T2H_VERBOSE);
                if ($T2H_VERBOSE);
            require($i);
            require($i);
        }
        }
    }
    }
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # parse command-line options
    # parse command-line options
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    $T2H_USAGE_TEXT = <
    $T2H_USAGE_TEXT = <
    Usage: texi2html  [OPTIONS] TEXINFO-FILE
    Usage: texi2html  [OPTIONS] TEXINFO-FILE
    Translates Texinfo source documentation to HTML.
    Translates Texinfo source documentation to HTML.
    EOT
    EOT
    $T2H_FAILURE_TEXT = <
    $T2H_FAILURE_TEXT = <
    Try 'texi2html -help' for usage instructions.
    Try 'texi2html -help' for usage instructions.
    EOT
    EOT
    $options = new Getopt::MySimple;
    $options = new Getopt::MySimple;
    # some older version of GetOpt::Long don't have
    # some older version of GetOpt::Long don't have
    # Getopt::Long::Configure("pass_through")
    # Getopt::Long::Configure("pass_through")
    eval {Getopt::Long::Configure("pass_through");};
    eval {Getopt::Long::Configure("pass_through");};
    $Configure_failed = $@ && <
    $Configure_failed = $@ && <
    **WARNING: Parsing of obsolete command-line options could have failed.
    **WARNING: Parsing of obsolete command-line options could have failed.
               Consider to use only documented command-line options (run
               Consider to use only documented command-line options (run
               'texi2html -help 2' for a complete list) or upgrade to perl
               'texi2html -help 2' for a complete list) or upgrade to perl
               version 5.005 or higher.
               version 5.005 or higher.
    EOT
    EOT
    if (! $options->getOptions($T2H_OPTIONS, $T2H_USAGE_TEXT, "$THISVERSION\n"))
    if (! $options->getOptions($T2H_OPTIONS, $T2H_USAGE_TEXT, "$THISVERSION\n"))
    {
    {
      print $Configure_failed if $Configure_failed;
      print $Configure_failed if $Configure_failed;
      die $T2H_FAILURE_TEXT;
      die $T2H_FAILURE_TEXT;
    }
    }
    if (@ARGV > 1)
    if (@ARGV > 1)
    {
    {
      eval {Getopt::Long::Configure("no_pass_through");};
      eval {Getopt::Long::Configure("no_pass_through");};
      if (! $options->getOptions($T2H_OBSOLETE_OPTIONS, $T2H_USAGE_TEXT, "$THISVERSION\n"))
      if (! $options->getOptions($T2H_OBSOLETE_OPTIONS, $T2H_USAGE_TEXT, "$THISVERSION\n"))
      {
      {
        print $Configure_failed if $Configure_failed;
        print $Configure_failed if $Configure_failed;
        die $T2H_FAILURE_TEXT;
        die $T2H_FAILURE_TEXT;
      }
      }
    }
    }
    if ($T2H_CHECK) {
    if ($T2H_CHECK) {
        die "Need file to check\n$T2H_FAILURE_TEXT" unless @ARGV > 0;
        die "Need file to check\n$T2H_FAILURE_TEXT" unless @ARGV > 0;
        exit;
        exit;
    }
    }
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # evaluation of cmd line options
    # evaluation of cmd line options
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    if ($T2H_EXPAND eq 'info')
    if ($T2H_EXPAND eq 'info')
    {
    {
      $to_skip{'ifinfo'} = 1;
      $to_skip{'ifinfo'} = 1;
      $to_skip{'end ifinfo'} = 1;
      $to_skip{'end ifinfo'} = 1;
    }
    }
    elsif ($T2H_EXPAND eq 'tex')
    elsif ($T2H_EXPAND eq 'tex')
    {
    {
      $to_skip{'iftex'} = 1;
      $to_skip{'iftex'} = 1;
      $to_skip{'end iftex'} = 1;
      $to_skip{'end iftex'} = 1;
    }
    }
    $T2H_INVISIBLE_MARK = '' if $T2H_INVISIBLE_MARK eq 'xbm';
    $T2H_INVISIBLE_MARK = '' if $T2H_INVISIBLE_MARK eq 'xbm';
    #
    #
    # file name buisness
    # file name buisness
    #
    #
    die "Need exactly one file to translate\n$T2H_FAILURE_TEXT" unless @ARGV == 1;
    die "Need exactly one file to translate\n$T2H_FAILURE_TEXT" unless @ARGV == 1;
    $docu = shift(@ARGV);
    $docu = shift(@ARGV);
    if ($docu =~ /.*\//) {
    if ($docu =~ /.*\//) {
        chop($docu_dir = $&);
        chop($docu_dir = $&);
        $docu_name = $';
        $docu_name = $';
    } else {
    } else {
        $docu_dir = '.';
        $docu_dir = '.';
        $docu_name = $docu;
        $docu_name = $docu;
    }
    }
    unshift(@T2H_INCLUDE_DIRS, $docu_dir);
    unshift(@T2H_INCLUDE_DIRS, $docu_dir);
    $docu_name =~ s/\.te?x(i|info)?$//;     # basename of the document
    $docu_name =~ s/\.te?x(i|info)?$//;     # basename of the document
    $docu_name = $T2H_PREFIX if ($T2H_PREFIX);
    $docu_name = $T2H_PREFIX if ($T2H_PREFIX);
    # subdir
    # subdir
    if ($T2H_SUBDIR && ! $T2H_OUT)
    if ($T2H_SUBDIR && ! $T2H_OUT)
    {
    {
      $T2H_SUBDIR =~ s|/*$||;
      $T2H_SUBDIR =~ s|/*$||;
      unless (-d "$T2H_SUBDIR" && -w "$T2H_SUBDIR")
      unless (-d "$T2H_SUBDIR" && -w "$T2H_SUBDIR")
      {
      {
        if ( mkdir($T2H_SUBDIR, oct(755)))
        if ( mkdir($T2H_SUBDIR, oct(755)))
        {
        {
          print "# created directory $T2H_SUBDIR\n" if ($T2H_VERBOSE);
          print "# created directory $T2H_SUBDIR\n" if ($T2H_VERBOSE);
        }
        }
        else
        else
        {
        {
          warn "$ERROR can't create directory $T2H_SUBDIR. Put results into current directory\n";
          warn "$ERROR can't create directory $T2H_SUBDIR. Put results into current directory\n";
          $T2H_SUBDIR = '';
          $T2H_SUBDIR = '';
        }
        }
      }
      }
    }
    }
    if ($T2H_SUBDIR && ! $T2H_OUT)
    if ($T2H_SUBDIR && ! $T2H_OUT)
    {
    {
      $docu_rdir = "$T2H_SUBDIR/";
      $docu_rdir = "$T2H_SUBDIR/";
      print "# putting result files into directory $docu_rdir\n" if ($T2H_VERBOSE);
      print "# putting result files into directory $docu_rdir\n" if ($T2H_VERBOSE);
    }
    }
    else
    else
    {
    {
      if ($T2H_OUT && $T2H_OUT =~ m|(.*)/|)
      if ($T2H_OUT && $T2H_OUT =~ m|(.*)/|)
      {
      {
        $docu_rdir = "$1/";
        $docu_rdir = "$1/";
        print "# putting result files into directory $docu_rdir\n" if ($T2H_VERBOSE);
        print "# putting result files into directory $docu_rdir\n" if ($T2H_VERBOSE);
      }
      }
      else
      else
      {
      {
        print "# putting result files into current directory \n" if ($T2H_VERBOSE);
        print "# putting result files into current directory \n" if ($T2H_VERBOSE);
        $docu_rdir = '';
        $docu_rdir = '';
      }
      }
    }
    }
    # extension
    # extension
    if ($T2H_SHORTEXTN)
    if ($T2H_SHORTEXTN)
    {
    {
      $docu_ext = "htm";
      $docu_ext = "htm";
    }
    }
    else
    else
    {
    {
      $docu_ext = "html";
      $docu_ext = "html";
    }
    }
    if ($T2H_TOP_FILE =~ /\..*$/)
    if ($T2H_TOP_FILE =~ /\..*$/)
    {
    {
      $T2H_TOP_FILE = $`.".$docu_ext";
      $T2H_TOP_FILE = $`.".$docu_ext";
    }
    }
    # result files
    # result files
    if (! $T2H_OUT && ($T2H_SPLIT =~ /section/i || $T2H_SPLIT =~ /node/i))
    if (! $T2H_OUT && ($T2H_SPLIT =~ /section/i || $T2H_SPLIT =~ /node/i))
    {
    {
      $T2H_SPLIT = 'section';
      $T2H_SPLIT = 'section';
    }
    }
    elsif (! $T2H_OUT && $T2H_SPLIT =~ /chapter/i)
    elsif (! $T2H_OUT && $T2H_SPLIT =~ /chapter/i)
    {
    {
      $T2H_SPLIT = 'chapter'
      $T2H_SPLIT = 'chapter'
    }
    }
    else
    else
    {
    {
      undef $T2H_SPLIT;
      undef $T2H_SPLIT;
    }
    }
    $docu_doc = "$docu_name.$docu_ext";             # document's contents
    $docu_doc = "$docu_name.$docu_ext";             # document's contents
    $docu_doc_file = "$docu_rdir$docu_doc";
    $docu_doc_file = "$docu_rdir$docu_doc";
    if ($T2H_SPLIT)
    if ($T2H_SPLIT)
    {
    {
      $docu_toc  = $T2H_TOC_FILE || "${docu_name}_toc.$docu_ext"; # document's table of contents
      $docu_toc  = $T2H_TOC_FILE || "${docu_name}_toc.$docu_ext"; # document's table of contents
      $docu_stoc = "${docu_name}_ovr.$docu_ext"; # document's short toc
      $docu_stoc = "${docu_name}_ovr.$docu_ext"; # document's short toc
      $docu_foot = "${docu_name}_fot.$docu_ext"; # document's footnotes
      $docu_foot = "${docu_name}_fot.$docu_ext"; # document's footnotes
      $docu_about = "${docu_name}_abt.$docu_ext"; # about this document
      $docu_about = "${docu_name}_abt.$docu_ext"; # about this document
      $docu_top  = $T2H_TOP_FILE || $docu_doc;
      $docu_top  = $T2H_TOP_FILE || $docu_doc;
    }
    }
    else
    else
    {
    {
      if ($T2H_OUT)
      if ($T2H_OUT)
      {
      {
        $docu_doc = $T2H_OUT;
        $docu_doc = $T2H_OUT;
        $docu_doc =~ s|.*/||;
        $docu_doc =~ s|.*/||;
      }
      }
      $docu_toc = $docu_foot = $docu_stoc = $docu_about = $docu_top = $docu_doc;
      $docu_toc = $docu_foot = $docu_stoc = $docu_about = $docu_top = $docu_doc;
    }
    }
    $docu_toc_file  = "$docu_rdir$docu_toc";
    $docu_toc_file  = "$docu_rdir$docu_toc";
    $docu_stoc_file = "$docu_rdir$docu_stoc";
    $docu_stoc_file = "$docu_rdir$docu_stoc";
    $docu_foot_file = "$docu_rdir$docu_foot";
    $docu_foot_file = "$docu_rdir$docu_foot";
    $docu_about_file = "$docu_rdir$docu_about";
    $docu_about_file = "$docu_rdir$docu_about";
    $docu_top_file  = "$docu_rdir$docu_top";
    $docu_top_file  = "$docu_rdir$docu_top";
    $docu_frame_file =     "$docu_rdir${docu_name}_frame.$docu_ext";
    $docu_frame_file =     "$docu_rdir${docu_name}_frame.$docu_ext";
    $docu_toc_frame_file = "$docu_rdir${docu_name}_toc_frame.$docu_ext";
    $docu_toc_frame_file = "$docu_rdir${docu_name}_toc_frame.$docu_ext";
    #
    #
    # variables
    # variables
    #
    #
    $value{'html'} = 1;                     # predefine html (the output format)
    $value{'html'} = 1;                     # predefine html (the output format)
    $value{'texi2html'} = $THISVERSION;     # predefine texi2html (the translator)
    $value{'texi2html'} = $THISVERSION;     # predefine texi2html (the translator)
    # _foo: internal to track @foo
    # _foo: internal to track @foo
    foreach ('_author', '_title', '_subtitle',
    foreach ('_author', '_title', '_subtitle',
             '_settitle', '_setfilename', '_shorttitle') {
             '_settitle', '_setfilename', '_shorttitle') {
        $value{$_} = '';                    # prevent -w warnings
        $value{$_} = '';                    # prevent -w warnings
    }
    }
    %node2sec = ();                         # node to section name
    %node2sec = ();                         # node to section name
    %sec2node = ();                         # section to node name
    %sec2node = ();                         # section to node name
    %sec2number = ();                       # section to number
    %sec2number = ();                       # section to number
    %number2sec = ();                       # number to section
    %number2sec = ();                       # number to section
    %idx2node = ();                         # index keys to node
    %idx2node = ();                         # index keys to node
    %node2href = ();                        # node to HREF
    %node2href = ();                        # node to HREF
    %node2next = ();                        # node to next
    %node2next = ();                        # node to next
    %node2prev = ();                        # node to prev
    %node2prev = ();                        # node to prev
    %node2up   = ();                        # node to up
    %node2up   = ();                        # node to up
    %bib2href = ();                         # bibliography reference to HREF
    %bib2href = ();                         # bibliography reference to HREF
    %gloss2href = ();                       # glossary term to HREF
    %gloss2href = ();                       # glossary term to HREF
    @sections = ();                         # list of sections
    @sections = ();                         # list of sections
    %tag2pro = ();                          # protected sections
    %tag2pro = ();                          # protected sections
    #
    #
    # initial indexes
    # initial indexes
    #
    #
    $bib_num = 0;
    $bib_num = 0;
    $foot_num = 0;
    $foot_num = 0;
    $gloss_num = 0;
    $gloss_num = 0;
    $idx_num = 0;
    $idx_num = 0;
    $sec_num = 0;
    $sec_num = 0;
    $doc_num = 0;
    $doc_num = 0;
    $html_num = 0;
    $html_num = 0;
    #
    #
    # can I use ISO8879 characters? (HTML+)
    # can I use ISO8879 characters? (HTML+)
    #
    #
    if ($T2H_USE_ISO) {
    if ($T2H_USE_ISO) {
        $things_map{'bullet'} = "•";
        $things_map{'bullet'} = "•";
        $things_map{'copyright'} = "©";
        $things_map{'copyright'} = "©";
        $things_map{'dots'} = "…";
        $things_map{'dots'} = "…";
        $things_map{'equiv'} = "≡";
        $things_map{'equiv'} = "≡";
        $things_map{'expansion'} = "→";
        $things_map{'expansion'} = "→";
        $things_map{'point'} = "∗";
        $things_map{'point'} = "∗";
        $things_map{'result'} = "⇒";
        $things_map{'result'} = "⇒";
    }
    }
    #
    #
    # read texi2html extensions (if any)
    # read texi2html extensions (if any)
    #
    #
    $extensions = 'texi2html.ext'; # extensions in working directory
    $extensions = 'texi2html.ext'; # extensions in working directory
    if (-f $extensions) {
    if (-f $extensions) {
        print "# reading extensions from $extensions\n" if $T2H_VERBOSE;
        print "# reading extensions from $extensions\n" if $T2H_VERBOSE;
        require($extensions);
        require($extensions);
    }
    }
    ($progdir = $0) =~ s/[^\/]+$//;
    ($progdir = $0) =~ s/[^\/]+$//;
    if ($progdir && ($progdir ne './')) {
    if ($progdir && ($progdir ne './')) {
        $extensions = "${progdir}texi2html.ext"; # extensions in texi2html directory
        $extensions = "${progdir}texi2html.ext"; # extensions in texi2html directory
        if (-f $extensions) {
        if (-f $extensions) {
            print "# reading extensions from $extensions\n" if $T2H_VERBOSE;
            print "# reading extensions from $extensions\n" if $T2H_VERBOSE;
            require($extensions);
            require($extensions);
        }
        }
    }
    }
    print "# reading from $docu\n" if $T2H_VERBOSE;
    print "# reading from $docu\n" if $T2H_VERBOSE;
    #########################################################################
    #########################################################################
    #
    #
    # latex2html stuff
    # latex2html stuff
    #
    #
    # latex2html conversions consist of three stages:
    # latex2html conversions consist of three stages:
    # 1) ToLatex: Put "latex" code into a latex file
    # 1) ToLatex: Put "latex" code into a latex file
    # 2) ToHtml: Use latex2html to generate corresponding html code and images
    # 2) ToHtml: Use latex2html to generate corresponding html code and images
    # 3) FromHtml: Extract generated code and images from latex2html run
    # 3) FromHtml: Extract generated code and images from latex2html run
    #
    #
    ##########################
    ##########################
    # default settings
    # default settings
    #
    #
    # defaults for files and names
    # defaults for files and names
    sub l2h_Init
    sub l2h_Init
    {
    {
      local($root) = @_;
      local($root) = @_;
      return 0 unless ($root);
      return 0 unless ($root);
      $l2h_name =  "${root}_l2h";
      $l2h_name =  "${root}_l2h";
      $l2h_latex_file = "$docu_rdir${l2h_name}.tex";
      $l2h_latex_file = "$docu_rdir${l2h_name}.tex";
      $l2h_cache_file = "${docu_rdir}l2h_cache.pm";
      $l2h_cache_file = "${docu_rdir}l2h_cache.pm";
      $T2H_L2H_L2H = "latex2html" unless ($T2H_L2H_L2H);
      $T2H_L2H_L2H = "latex2html" unless ($T2H_L2H_L2H);
      # destination dir -- generated images are put there, should be the same
      # destination dir -- generated images are put there, should be the same
      # as dir of enclosing html document --
      # as dir of enclosing html document --
      $l2h_html_file = "$docu_rdir${l2h_name}.html";
      $l2h_html_file = "$docu_rdir${l2h_name}.html";
      $l2h_prefix = "${l2h_name}_";
      $l2h_prefix = "${l2h_name}_";
      return 1;
      return 1;
    }
    }
    ##########################
    ##########################
    #
    #
    # First stage: Generation of Latex file
    # First stage: Generation of Latex file
    # Initialize with: l2h_InitToLatex
    # Initialize with: l2h_InitToLatex
    # Add content with: l2h_ToLatex($text) --> HTML placeholder comment
    # Add content with: l2h_ToLatex($text) --> HTML placeholder comment
    # Finish with: l2h_FinishToLatex
    # Finish with: l2h_FinishToLatex
    #
    #
    $l2h_latex_preample = <
    $l2h_latex_preample = <
    % This document was automatically generated by the l2h extenstion of texi2html
    % This document was automatically generated by the l2h extenstion of texi2html
    % DO NOT EDIT !!!
    % DO NOT EDIT !!!
    \\documentclass{article}
    \\documentclass{article}
    \\usepackage{html}
    \\usepackage{html}
    \\begin{document}
    \\begin{document}
    EOT
    EOT
    $l2h_latex_closing = <
    $l2h_latex_closing = <
    \\end{document}
    \\end{document}
    EOT
    EOT
    # return used latex 1, if l2h could be initalized properly, 0 otherwise
    # return used latex 1, if l2h could be initalized properly, 0 otherwise
    sub l2h_InitToLatex
    sub l2h_InitToLatex
    {
    {
      %l2h_to_latex = ();
      %l2h_to_latex = ();
      unless ($T2H_L2H_SKIP)
      unless ($T2H_L2H_SKIP)
      {
      {
        unless (open(L2H_LATEX, ">$l2h_latex_file"))
        unless (open(L2H_LATEX, ">$l2h_latex_file"))
        {
        {
          warn "$ERROR Error l2h: Can't open latex file '$latex_file' for writing\n";
          warn "$ERROR Error l2h: Can't open latex file '$latex_file' for writing\n";
          return 0;
          return 0;
        }
        }
        print "# l2h: use ${l2h_latex_file} as latex file\n" if ($T2H_VERBOSE);
        print "# l2h: use ${l2h_latex_file} as latex file\n" if ($T2H_VERBOSE);
        print L2H_LATEX $l2h_latex_preample;
        print L2H_LATEX $l2h_latex_preample;
      }
      }
      # open database for caching
      # open database for caching
      l2h_InitCache();
      l2h_InitCache();
      $l2h_latex_count = 0;
      $l2h_latex_count = 0;
      $l2h_to_latex_count = 0;
      $l2h_to_latex_count = 0;
      $l2h_cached_count = 0;
      $l2h_cached_count = 0;
      return  1;
      return  1;
    }
    }
    # print text (1st arg) into latex file (if not already there), return
    # print text (1st arg) into latex file (if not already there), return
    # HTML commentary which can be later on replaced by the latex2html
    # HTML commentary which can be later on replaced by the latex2html
    # generated text
    # generated text
    sub l2h_ToLatex
    sub l2h_ToLatex
    {
    {
      my($text) = @_;
      my($text) = @_;
      my($count);
      my($count);
      $l2h_to_latex_count++;
      $l2h_to_latex_count++;
      $text =~ s/(\s*)$//;
      $text =~ s/(\s*)$//;
      # try whether we can cache it
      # try whether we can cache it
      my $cached_text = l2h_FromCache($text);
      my $cached_text = l2h_FromCache($text);
      if ($cached_text)
      if ($cached_text)
      {
      {
        $l2h_cached_count++;
        $l2h_cached_count++;
        return $cached_text;
        return $cached_text;
      }
      }
      # try whether we have text already on things to do
      # try whether we have text already on things to do
      unless ($count = $l2h_to_latex{$text})
      unless ($count = $l2h_to_latex{$text})
      {
      {
        $count = $l2h_latex_count;
        $count = $l2h_latex_count;
        $l2h_latex_count++;
        $l2h_latex_count++;
        $l2h_to_latex{$text} = $count;
        $l2h_to_latex{$text} = $count;
        $l2h_to_latex[$count] = $text;
        $l2h_to_latex[$count] = $text;
        unless ($T2H_L2H_SKIP)
        unless ($T2H_L2H_SKIP)
        {
        {
          print L2H_LATEX "\\begin{rawhtml}\n";
          print L2H_LATEX "\\begin{rawhtml}\n";
          print L2H_LATEX "\n";
          print L2H_LATEX "\n";
          print L2H_LATEX "\\end{rawhtml}\n";
          print L2H_LATEX "\\end{rawhtml}\n";
          print L2H_LATEX "$text\n";
          print L2H_LATEX "$text\n";
          print L2H_LATEX "\\begin{rawhtml}\n";
          print L2H_LATEX "\\begin{rawhtml}\n";
          print L2H_LATEX "\n";
          print L2H_LATEX "\n";
          print L2H_LATEX "\\end{rawhtml}\n";
          print L2H_LATEX "\\end{rawhtml}\n";
        }
        }
      }
      }
      return "";
      return "";
    }
    }
    # print closing into latex file and close it
    # print closing into latex file and close it
    sub l2h_FinishToLatex
    sub l2h_FinishToLatex
    {
    {
      local ($reused);
      local ($reused);
      $reused = $l2h_to_latex_count - $l2h_latex_count - $l2h_cached_count;
      $reused = $l2h_to_latex_count - $l2h_latex_count - $l2h_cached_count;
      unless ($T2H_L2H_SKIP)
      unless ($T2H_L2H_SKIP)
      {
      {
        print L2H_LATEX $l2h_latex_closing;
        print L2H_LATEX $l2h_latex_closing;
        close(L2H_LATEX);
        close(L2H_LATEX);
      }
      }
      print "# l2h: finished to latex ($l2h_cached_count cached, $reused reused, $l2h_latex_count contents)\n" if ($T2H_VERBOSE);
      print "# l2h: finished to latex ($l2h_cached_count cached, $reused reused, $l2h_latex_count contents)\n" if ($T2H_VERBOSE);
      unless ($l2h_latex_count)
      unless ($l2h_latex_count)
      {
      {
        l2h_Finish();
        l2h_Finish();
        return 0;
        return 0;
      }
      }
      return 1;
      return 1;
    }
    }
    ###################################
    ###################################
    # Second stage: Use latex2html to generate corresponding html code and images
    # Second stage: Use latex2html to generate corresponding html code and images
    #
    #
    # l2h_ToHtml([$l2h_latex_file, [$l2h_html_dir]]):
    # l2h_ToHtml([$l2h_latex_file, [$l2h_html_dir]]):
    #   Call latex2html on $l2h_latex_file
    #   Call latex2html on $l2h_latex_file
    #   Put images (prefixed with $l2h_name."_") and html file(s) in $l2h_html_dir
    #   Put images (prefixed with $l2h_name."_") and html file(s) in $l2h_html_dir
    #   Return 1, on success
    #   Return 1, on success
    #          0, otherwise
    #          0, otherwise
    #
    #
    sub l2h_ToHtml
    sub l2h_ToHtml
    {
    {
      local($call, $ext, $root, $dotbug);
      local($call, $ext, $root, $dotbug);
      if ($T2H_L2H_SKIP)
      if ($T2H_L2H_SKIP)
      {
      {
        print "# l2h: skipping latex2html run\n" if ($T2H_VERBOSE);
        print "# l2h: skipping latex2html run\n" if ($T2H_VERBOSE);
        return 1;
        return 1;
      }
      }
      # Check for dot in directory where dvips will work
      # Check for dot in directory where dvips will work
      if ($T2H_L2H_TMP)
      if ($T2H_L2H_TMP)
      {
      {
        if ($T2H_L2H_TMP =~ /\./)
        if ($T2H_L2H_TMP =~ /\./)
        {
        {
          warn "$ERROR Warning l2h: l2h_tmp dir contains a dot. Use /tmp, instead\n";
          warn "$ERROR Warning l2h: l2h_tmp dir contains a dot. Use /tmp, instead\n";
          $dotbug = 1;
          $dotbug = 1;
        }
        }
      }
      }
      else
      else
      {
      {
        if (&getcwd =~ /\./)
        if (&getcwd =~ /\./)
        {
        {
         warn "$ERROR Warning l2h: current dir contains a dot. Use /tmp as l2h_tmp dir \n";
         warn "$ERROR Warning l2h: current dir contains a dot. Use /tmp as l2h_tmp dir \n";
         $dotbug = 1;
         $dotbug = 1;
       }
       }
      }
      }
      # fix it, if necessary and hope that it works
      # fix it, if necessary and hope that it works
      $T2H_L2H_TMP = "/tmp" if ($dotbug);
      $T2H_L2H_TMP = "/tmp" if ($dotbug);
      $call = $T2H_L2H_L2H;
      $call = $T2H_L2H_L2H;
      # use init file, if specified
      # use init file, if specified
      $call = $call . " -init_file " . $init_file if ($init_file && -f $init_file);
      $call = $call . " -init_file " . $init_file if ($init_file && -f $init_file);
      # set output dir
      # set output dir
      $call .=  ($docu_rdir ? " -dir $docu_rdir" : " -no_subdir");
      $call .=  ($docu_rdir ? " -dir $docu_rdir" : " -no_subdir");
      # use l2h_tmp, if specified
      # use l2h_tmp, if specified
      $call = $call . " -tmp $T2H_L2H_TMP" if ($T2H_L2H_TMP);
      $call = $call . " -tmp $T2H_L2H_TMP" if ($T2H_L2H_TMP);
      # options we want to be sure of
      # options we want to be sure of
      $call = $call ." -address 0 -info 0 -split 0 -no_navigation -no_auto_link";
      $call = $call ." -address 0 -info 0 -split 0 -no_navigation -no_auto_link";
      $call = $call ." -prefix ${l2h_prefix} $l2h_latex_file";
      $call = $call ." -prefix ${l2h_prefix} $l2h_latex_file";
      print "# l2h: executing '$call'\n" if ($T2H_VERBOSE);
      print "# l2h: executing '$call'\n" if ($T2H_VERBOSE);
      if (system($call))
      if (system($call))
      {
      {
        warn "l2h ***Error: '${call}' did not succeed\n";
        warn "l2h ***Error: '${call}' did not succeed\n";
        return 0;
        return 0;
      }
      }
      else
      else
      {
      {
        print "# l2h: latex2html finished successfully\n" if ($T2H_VERBOSE);
        print "# l2h: latex2html finished successfully\n" if ($T2H_VERBOSE);
        return 1;
        return 1;
      }
      }
    }
    }
    # this is directly pasted over from latex2html
    # this is directly pasted over from latex2html
    sub getcwd {
    sub getcwd {
        local($_) = `pwd`;
        local($_) = `pwd`;
        die "'pwd' failed (out of memory?)\n"
        die "'pwd' failed (out of memory?)\n"
            unless length;
            unless length;
        chop;
        chop;
        $_;
        $_;
    }
    }
    ##########################
    ##########################
    # Third stage: Extract generated contents from latex2html run
    # Third stage: Extract generated contents from latex2html run
    # Initialize with: l2h_InitFromHtml
    # Initialize with: l2h_InitFromHtml
    #   open $l2h_html_file for reading
    #   open $l2h_html_file for reading
    #   reads in contents into array indexed by numbers
    #   reads in contents into array indexed by numbers
    #   return 1,  on success -- 0, otherwise
    #   return 1,  on success -- 0, otherwise
    # Extract Html code with: l2h_FromHtml($text)
    # Extract Html code with: l2h_FromHtml($text)
    #   replaces in $text all previosuly inserted comments by generated html code
    #   replaces in $text all previosuly inserted comments by generated html code
    #   returns (possibly changed) $text
    #   returns (possibly changed) $text
    # Finish with: l2h_FinishFromHtml
    # Finish with: l2h_FinishFromHtml
    #   closes $l2h_html_dir/$l2h_name.".$docu_ext"
    #   closes $l2h_html_dir/$l2h_name.".$docu_ext"
    sub l2h_InitFromHtml
    sub l2h_InitFromHtml
    {
    {
      local($h_line, $h_content, $count, %l2h_img);
      local($h_line, $h_content, $count, %l2h_img);
      if (! open(L2H_HTML, "<${l2h_html_file}"))
      if (! open(L2H_HTML, "<${l2h_html_file}"))
      {
      {
        print "$ERROR Error l2h: Can't open ${l2h_html_file} for reading\n";
        print "$ERROR Error l2h: Can't open ${l2h_html_file} for reading\n";
        return 0;
        return 0;
      }
      }
      print "# l2h: use ${l2h_html_file} as html file\n" if ($T2H_VERBOSE);
      print "# l2h: use ${l2h_html_file} as html file\n" if ($T2H_VERBOSE);
      $l2h_html_count = 0;
      $l2h_html_count = 0;
      while ($h_line = )
      while ($h_line = )
      {
      {
        if ($h_line =~ /^/)
        if ($h_line =~ /^/)
        {
        {
          $count = $1;
          $count = $1;
          $h_content = "";
          $h_content = "";
          while ($h_line = )
          while ($h_line = )
          {
          {
            if ($h_line =~ /^/)
            if ($h_line =~ /^/)
            {
            {
              chomp $h_content;
              chomp $h_content;
              chomp $h_content;
              chomp $h_content;
              $l2h_html_count++;
              $l2h_html_count++;
              $h_content = l2h_ToCache($count, $h_content);
              $h_content = l2h_ToCache($count, $h_content);
              $l2h_from_html[$count] = $h_content;
              $l2h_from_html[$count] = $h_content;
              $h_content = '';
              $h_content = '';
              last;
              last;
            }
            }
            $h_content = $h_content.$h_line;
            $h_content = $h_content.$h_line;
          }
          }
          if ($hcontent)
          if ($hcontent)
          {
          {
            print "$ERROR Warning l2h: l2h_end $l2h_name $count not found\n"
            print "$ERROR Warning l2h: l2h_end $l2h_name $count not found\n"
              if ($T2H_VERBOSE);
              if ($T2H_VERBOSE);
            close(L2H_HTML);
            close(L2H_HTML);
            return 0;
            return 0;
          }
          }
        }
        }
      }
      }
      print "# l2h: Got $l2h_html_count of $l2h_latex_count html contents\n"
      print "# l2h: Got $l2h_html_count of $l2h_latex_count html contents\n"
        if ($T2H_VERBOSE);
        if ($T2H_VERBOSE);
      close(L2H_HTML);
      close(L2H_HTML);
      return 1;
      return 1;
    }
    }
    sub l2h_FromHtml
    sub l2h_FromHtml
    {
    {
      local($text) = @_;
      local($text) = @_;
      local($done, $to_do, $count);
      local($done, $to_do, $count);
      $to_do = $text;
      $to_do = $text;
      while ($to_do =~ /([^\000]*)([^\000]*)/)
      while ($to_do =~ /([^\000]*)([^\000]*)/)
      {
      {
        $to_do = $1;
        $to_do = $1;
        $count = $2;
        $count = $2;
        $done = $3.$done;
        $done = $3.$done;
        $done = "".$done
        $done = "".$done
          if ($T2H_DEBUG & $DEBUG_L2H);
          if ($T2H_DEBUG & $DEBUG_L2H);
        $done = &l2h_ExtractFromHtml($count) . $done;
        $done = &l2h_ExtractFromHtml($count) . $done;
        $done = "".$done
        $done = "".$done
          if ($T2H_DEBUG & $DEBUG_L2H);
          if ($T2H_DEBUG & $DEBUG_L2H);
      }
      }
      return $to_do.$done;
      return $to_do.$done;
    }
    }
    sub l2h_ExtractFromHtml
    sub l2h_ExtractFromHtml
    {
    {
      local($count) = @_;
      local($count) = @_;
      return $l2h_from_html[$count] if ($l2h_from_html[$count]);
      return $l2h_from_html[$count] if ($l2h_from_html[$count]);
      if ($count >= 0 && $count < $l2h_latex_count)
      if ($count >= 0 && $count < $l2h_latex_count)
      {
      {
        # now we are in trouble
        # now we are in trouble
        local($l_l2h, $_);
        local($l_l2h, $_);
        $l2h_extract_error++;
        $l2h_extract_error++;
        print "$ERROR l2h: can't extract content $count from html\n"
        print "$ERROR l2h: can't extract content $count from html\n"
          if ($T2H_VERBOSE);
          if ($T2H_VERBOSE);
        # try simple (ordinary) substition (without l2h)
        # try simple (ordinary) substition (without l2h)
        $l_l2h = $T2H_L2H;
        $l_l2h = $T2H_L2H;
        $T2H_L2H = 0;
        $T2H_L2H = 0;
        $_ = $l2h_to_latex{$count};
        $_ = $l2h_to_latex{$count};
        $_ = &substitute_style($_);
        $_ = &substitute_style($_);
        &unprotect_texi;
        &unprotect_texi;
        $_ = "" . $_
        $_ = "" . $_
          if ($T2H_DEBUG & $DEBUG_L2H);
          if ($T2H_DEBUG & $DEBUG_L2H);
        $T2H_L2H = $l_l2h;
        $T2H_L2H = $l_l2h;
        return $_;
        return $_;
      }
      }
      else
      else
      {
      {
        # now we have been incorrectly called
        # now we have been incorrectly called
        $l2h_range_error++;
        $l2h_range_error++;
        print "$ERROR l2h: Request of $count content which is out of valide range [0,$l2h_latex_count)\n";
        print "$ERROR l2h: Request of $count content which is out of valide range [0,$l2h_latex_count)\n";
        return ""
        return ""
          if ($T2H_DEBUG & $DEBUG_L2H);
          if ($T2H_DEBUG & $DEBUG_L2H);
        return "";
        return "";
      }
      }
    }
    }
    sub l2h_FinishFromHtml
    sub l2h_FinishFromHtml
    {
    {
      if ($T2H_VERBOSE)
      if ($T2H_VERBOSE)
      {
      {
        if ($l2h_extract_error + $l2h_range_error)
        if ($l2h_extract_error + $l2h_range_error)
        {
        {
          print "# l2h: finished from html ($l2h_extract_error extract and $l2h_range_error errors)\n";
          print "# l2h: finished from html ($l2h_extract_error extract and $l2h_range_error errors)\n";
        }
        }
        else
        else
        {
        {
          print "# l2h: finished from html (no errors)\n";
          print "# l2h: finished from html (no errors)\n";
        }
        }
      }
      }
    }
    }
    sub l2h_Finish
    sub l2h_Finish
    {
    {
      l2h_StoreCache();
      l2h_StoreCache();
      if ($T2H_L2H_CLEAN)
      if ($T2H_L2H_CLEAN)
      {
      {
        print "# l2h: removing temporary files generated by l2h extension\n"
        print "# l2h: removing temporary files generated by l2h extension\n"
          if $T2H_VERBOSE;
          if $T2H_VERBOSE;
        while (<"$docu_rdir$l2h_name"*>)
        while (<"$docu_rdir$l2h_name"*>)
        {
        {
          unlink $_;
          unlink $_;
        }
        }
      }
      }
      print "# l2h: Finished\n" if $T2H_VERBOSE;
      print "# l2h: Finished\n" if $T2H_VERBOSE;
      return 1;
      return 1;
    }
    }
    ##############################
    ##############################
    # stuff for l2h caching
    # stuff for l2h caching
    #
    #
    # I tried doing this with a dbm data base, but it did not store all
    # I tried doing this with a dbm data base, but it did not store all
    # keys/values. Hence, I did as latex2html does it
    # keys/values. Hence, I did as latex2html does it
    sub l2h_InitCache
    sub l2h_InitCache
    {
    {
      if (-r "$l2h_cache_file")
      if (-r "$l2h_cache_file")
      {
      {
        my $rdo = do "$l2h_cache_file";
        my $rdo = do "$l2h_cache_file";
        warn("$ERROR l2h Error: could not load $docu_rdir$l2h_cache_file: $@\n")
        warn("$ERROR l2h Error: could not load $docu_rdir$l2h_cache_file: $@\n")
          unless ($rdo);
          unless ($rdo);
      }
      }
    }
    }
    sub l2h_StoreCache
    sub l2h_StoreCache
    {
    {
      return unless $l2h_latex_count;
      return unless $l2h_latex_count;
      my ($key, $value);
      my ($key, $value);
      open(FH, ">$l2h_cache_file") || return warn"$ERROR l2h Error: could not open $docu_rdir$l2h_cache_file for writing: $!\n";
      open(FH, ">$l2h_cache_file") || return warn"$ERROR l2h Error: could not open $docu_rdir$l2h_cache_file for writing: $!\n";
      while (($key, $value) = each %l2h_cache)
      while (($key, $value) = each %l2h_cache)
      {
      {
        # escape stuff
        # escape stuff
        $key =~ s|/|\\/|g;
        $key =~ s|/|\\/|g;
        $key =~ s|\\\\/|\\/|g;
        $key =~ s|\\\\/|\\/|g;
        # weird, a \ at the end of the key results in an error
        # weird, a \ at the end of the key results in an error
        # maybe this also broke the dbm database stuff
        # maybe this also broke the dbm database stuff
        $key =~ s|\\$|\\\\|;
        $key =~ s|\\$|\\\\|;
        $value =~ s/\|/\\\|/g;
        $value =~ s/\|/\\\|/g;
        $value =~ s/\\\\\|/\\\|/g;
        $value =~ s/\\\\\|/\\\|/g;
        $value =~ s|\\\\|\\\\\\\\|g;
        $value =~ s|\\\\|\\\\\\\\|g;
        print FH "\n\$l2h_cache_key = q/$key/;\n";
        print FH "\n\$l2h_cache_key = q/$key/;\n";
        print FH "\$l2h_cache{\$l2h_cache_key} = q|$value|;\n";
        print FH "\$l2h_cache{\$l2h_cache_key} = q|$value|;\n";
      }
      }
      print FH "1;";
      print FH "1;";
      close(FH);
      close(FH);
    }
    }
    # return cached html, if it exists for text, and if all pictures
    # return cached html, if it exists for text, and if all pictures
    # are there, as well
    # are there, as well
    sub l2h_FromCache
    sub l2h_FromCache
    {
    {
      my $text = shift;
      my $text = shift;
      my $cached = $l2h_cache{$text};
      my $cached = $l2h_cache{$text};
      if ($cached)
      if ($cached)
      {
      {
        while ($cached =~ m/SRC="(.*?)"/g)
        while ($cached =~ m/SRC="(.*?)"/g)
        {
        {
          unless (-e "$docu_rdir$1")
          unless (-e "$docu_rdir$1")
          {
          {
            return undef;
            return undef;
          }
          }
        }
        }
        return $cached;
        return $cached;
      }
      }
      return undef;
      return undef;
    }
    }
    # insert generated html into cache, move away images,
    # insert generated html into cache, move away images,
    # return transformed html
    # return transformed html
    $maximage = 1;
    $maximage = 1;
    sub l2h_ToCache
    sub l2h_ToCache
    {
    {
      my $count = shift;
      my $count = shift;
      my $content = shift;
      my $content = shift;
      my @images = ($content =~ /SRC="(.*?)"/g);
      my @images = ($content =~ /SRC="(.*?)"/g);
      my ($src, $dest);
      my ($src, $dest);
      for $src (@images)
      for $src (@images)
      {
      {
        $dest = $l2h_img{$src};
        $dest = $l2h_img{$src};
        unless ($dest)
        unless ($dest)
        {
        {
          my $ext;
          my $ext;
          if ($src =~ /.*\.(.*)$/ && $1 ne $docu_ext)
          if ($src =~ /.*\.(.*)$/ && $1 ne $docu_ext)
          {
          {
            $ext = $1;
            $ext = $1;
          }
          }
          else
          else
          {
          {
            warn "$ERROR: L2h image $src has invalid extension\n";
            warn "$ERROR: L2h image $src has invalid extension\n";
            next;
            next;
          }
          }
          while (-e "$docu_rdir${docu_name}_$maximage.$ext") { $maximage++;}
          while (-e "$docu_rdir${docu_name}_$maximage.$ext") { $maximage++;}
          $dest = "${docu_name}_$maximage.$ext";
          $dest = "${docu_name}_$maximage.$ext";
          system("cp -f $docu_rdir$src $docu_rdir$dest");
          system("cp -f $docu_rdir$src $docu_rdir$dest");
          $l2h_img{$src} = $dest;
          $l2h_img{$src} = $dest;
          unlink "$docu_rdir$src" unless ($DEBUG & DEBUG_L2H);
          unlink "$docu_rdir$src" unless ($DEBUG & DEBUG_L2H);
        }
        }
        $content =~ s/$src/$dest/g;
        $content =~ s/$src/$dest/g;
      }
      }
      $l2h_cache{$l2h_to_latex[$count]} = $content;
      $l2h_cache{$l2h_to_latex[$count]} = $content;
      return $content;
      return $content;
    }
    }
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # Pass 1: read source, handle command, variable, simple substitution           #
    # Pass 1: read source, handle command, variable, simple substitution           #
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    @lines = ();                            # whole document
    @lines = ();                            # whole document
    @toc_lines = ();                        # table of contents
    @toc_lines = ();                        # table of contents
    @stoc_lines = ();                       # table of contents
    @stoc_lines = ();                       # table of contents
    $curlevel = 0;                          # current level in TOC
    $curlevel = 0;                          # current level in TOC
    $node = '';                             # current node name
    $node = '';                             # current node name
    $node_next = '';                        # current node next name
    $node_next = '';                        # current node next name
    $node_prev = '';                        # current node prev name
    $node_prev = '';                        # current node prev name
    $node_up = '';                          # current node up name
    $node_up = '';                          # current node up name
    $in_table = 0;                          # am I inside a table
    $in_table = 0;                          # am I inside a table
    $table_type = '';                       # type of table ('', 'f', 'v', 'multi')
    $table_type = '';                       # type of table ('', 'f', 'v', 'multi')
    @tables = ();                           # nested table support
    @tables = ();                           # nested table support
    $in_bibliography = 0;                   # am I inside a bibliography
    $in_bibliography = 0;                   # am I inside a bibliography
    $in_glossary = 0;                       # am I inside a glossary
    $in_glossary = 0;                       # am I inside a glossary
    $in_top = 0;                            # am I inside the top node
    $in_top = 0;                            # am I inside the top node
    $has_top = 0;                           # did I see a top node?
    $has_top = 0;                           # did I see a top node?
    $has_top_command = 0;                   # did I see @top for automatic pointers?
    $has_top_command = 0;                   # did I see @top for automatic pointers?
    $in_pre = 0;                            # am I inside a preformatted section
    $in_pre = 0;                            # am I inside a preformatted section
    $in_list = 0;                           # am I inside a list
    $in_list = 0;                           # am I inside a list
    $in_html = 0;                           # am I inside an HTML section
    $in_html = 0;                           # am I inside an HTML section
    $first_line = 1;                        # is it the first line
    $first_line = 1;                        # is it the first line
    $dont_html = 0;                         # don't protect HTML on this line
    $dont_html = 0;                         # don't protect HTML on this line
    $deferred_ref = '';                     # deferred reference for indexes
    $deferred_ref = '';                     # deferred reference for indexes
    @html_stack = ();                       # HTML elements stack
    @html_stack = ();                       # HTML elements stack
    $html_element = '';                     # current HTML element
    $html_element = '';                     # current HTML element
    &html_reset;
    &html_reset;
    %macros = ();                           # macros
    %macros = ();                           # macros
    # init l2h
    # init l2h
    $T2H_L2H = &l2h_Init($docu_name) if ($T2H_L2H);
    $T2H_L2H = &l2h_Init($docu_name) if ($T2H_L2H);
    $T2H_L2H = &l2h_InitToLatex      if ($T2H_L2H);
    $T2H_L2H = &l2h_InitToLatex      if ($T2H_L2H);
    # build code for simple substitutions
    # build code for simple substitutions
    # the maps used (%simple_map and %things_map) MUST be aware of this
    # the maps used (%simple_map and %things_map) MUST be aware of this
    # watch out for regexps, / and escaped characters!
    # watch out for regexps, / and escaped characters!
    $subst_code = '';
    $subst_code = '';
    foreach (keys(%simple_map)) {
    foreach (keys(%simple_map)) {
        ($re = $_) =~ s/(\W)/\\$1/g; # protect regexp chars
        ($re = $_) =~ s/(\W)/\\$1/g; # protect regexp chars
        $subst_code .= "s/\\\@$re/$simple_map{$_}/g;\n";
        $subst_code .= "s/\\\@$re/$simple_map{$_}/g;\n";
    }
    }
    foreach (keys(%things_map)) {
    foreach (keys(%things_map)) {
        $subst_code .= "s/\\\@$_\\{\\}/$things_map{$_}/g;\n";
        $subst_code .= "s/\\\@$_\\{\\}/$things_map{$_}/g;\n";
    }
    }
    if ($use_acc) {
    if ($use_acc) {
        # accentuated characters
        # accentuated characters
        foreach (keys(%accent_map)) {
        foreach (keys(%accent_map)) {
            if ($_ eq "`") {
            if ($_ eq "`") {
                $subst_code .= "s/$;3";
                $subst_code .= "s/$;3";
            } elsif ($_ eq "'") {
            } elsif ($_ eq "'") {
                $subst_code .= "s/$;4";
                $subst_code .= "s/$;4";
            } else {
            } else {
                $subst_code .= "s/\\\@\\$_";
                $subst_code .= "s/\\\@\\$_";
            }
            }
            $subst_code .= "([a-z])/&\${1}$accent_map{$_};/gi;\n";
            $subst_code .= "([a-z])/&\${1}$accent_map{$_};/gi;\n";
        }
        }
    }
    }
    eval("sub simple_substitutions { $subst_code }");
    eval("sub simple_substitutions { $subst_code }");
    &init_input;
    &init_input;
    INPUT_LINE: while ($_ = &next_line) {
    INPUT_LINE: while ($_ = &next_line) {
        #
        #
        # remove \input on the first lines only
        # remove \input on the first lines only
        #
        #
        if ($first_line) {
        if ($first_line) {
            next if /^\\input/;
            next if /^\\input/;
            $first_line = 0;
            $first_line = 0;
        }
        }
        # non-@ substitutions cf. texinfmt.el
        # non-@ substitutions cf. texinfmt.el
        #
        #
        # parse texinfo tags
        # parse texinfo tags
        #
        #
        $tag = '';
        $tag = '';
        $end_tag = '';
        $end_tag = '';
        if (/^\s*\@end\s+(\w+)\b/) {
        if (/^\s*\@end\s+(\w+)\b/) {
            $end_tag = $1;
            $end_tag = $1;
        } elsif (/^\s*\@(\w+)\b/) {
        } elsif (/^\s*\@(\w+)\b/) {
            $tag = $1;
            $tag = $1;
        }
        }
        #
        #
        # handle @html / @end html
        # handle @html / @end html
        #
        #
        if ($in_html) {
        if ($in_html) {
            if ($end_tag eq 'html') {
            if ($end_tag eq 'html') {
                $in_html = 0;
                $in_html = 0;
            } else {
            } else {
                $tag2pro{$in_html} .= $_;
                $tag2pro{$in_html} .= $_;
            }
            }
            next;
            next;
        } elsif ($tag eq 'html') {
        } elsif ($tag eq 'html') {
            $in_html = $PROTECTTAG . ++$html_num;
            $in_html = $PROTECTTAG . ++$html_num;
            push(@lines, $in_html);
            push(@lines, $in_html);
            next;
            next;
        }
        }
        #
        #
        # try to remove inlined comments
        # try to remove inlined comments
        # syntax from tex-mode.el comment-start-skip
        # syntax from tex-mode.el comment-start-skip
        #
        #
        s/((^|[^\@])(\@\@)*)\@c(omment | |\{|$).*/$1/;
        s/((^|[^\@])(\@\@)*)\@c(omment | |\{|$).*/$1/;
    # Sometimes I use @c right at the end of  a line ( to suppress the line feed )
    # Sometimes I use @c right at the end of  a line ( to suppress the line feed )
    #    s/((^|[^\@])(\@\@)*)\@c(omment)?$/$1/;
    #    s/((^|[^\@])(\@\@)*)\@c(omment)?$/$1/;
    #     s/((^|[^\@])(\@\@)*)\@c(omment)? .*/$1/;
    #     s/((^|[^\@])(\@\@)*)\@c(omment)? .*/$1/;
    #     s/(.*)\@c{.*?}(.*)/$1$2/;
    #     s/(.*)\@c{.*?}(.*)/$1$2/;
    #     s/(.*)\@comment{.*?}(.*)/$1$2/;
    #     s/(.*)\@comment{.*?}(.*)/$1$2/;
    #     s/^(.*)\@c /$1/;
    #     s/^(.*)\@c /$1/;
    #     s/^(.*)\@comment /$1/;
    #     s/^(.*)\@comment /$1/;
        #############################################################
        #############################################################
        # value substitution before macro expansion, so that
        # value substitution before macro expansion, so that
        # it works in macro arguments
        # it works in macro arguments
        s/\@value{($VARRE)}/$value{$1}/eg;
        s/\@value{($VARRE)}/$value{$1}/eg;
        #############################################################
        #############################################################
        # macro substitution
        # macro substitution
        while (/\@(\w+)/g)
        while (/\@(\w+)/g)
        {
        {
          if (exists($macros->{$1}))
          if (exists($macros->{$1}))
          {
          {
            my $before = $`;
            my $before = $`;
            my $name = $1;
            my $name = $1;
            my $after = $';
            my $after = $';
            my @args;
            my @args;
            my $args;
            my $args;
            if ($after =~ /^\s*{(.*?[^\\])}(.*)/)
            if ($after =~ /^\s*{(.*?[^\\])}(.*)/)
            {
            {
              $args = $1;
              $args = $1;
              $after = $2;
              $after = $2;
            }
            }
            elsif (@{$macros->{$name}->{Args}} == 1)
            elsif (@{$macros->{$name}->{Args}} == 1)
            {
            {
              $args = $after;
              $args = $after;
              $args =~ s/^\s*//;
              $args =~ s/^\s*//;
              $args =~ s/\s*$//;
              $args =~ s/\s*$//;
              $after = '';
              $after = '';
            }
            }
            $args =~ s|\\\\|\\|g;
            $args =~ s|\\\\|\\|g;
            $args =~ s|\\{|{|g;
            $args =~ s|\\{|{|g;
            $args =~ s|\\}|}|g;
            $args =~ s|\\}|}|g;
            if (@{$macros->{$name}->{Args}} > 1)
            if (@{$macros->{$name}->{Args}} > 1)
            {
            {
              $args =~ s/(^|[^\\]),/$1$;/g ;
              $args =~ s/(^|[^\\]),/$1$;/g ;
              $args =~ s|\\,|,|g;
              $args =~ s|\\,|,|g;
              @args = split(/$;\s*/, $args) if (@{$macros->{$name}->{Args}} > 1);
              @args = split(/$;\s*/, $args) if (@{$macros->{$name}->{Args}} > 1);
            }
            }
            else
            else
            {
            {
              $args =~ s|\\,|,|g;
              $args =~ s|\\,|,|g;
              @args = ($args);
              @args = ($args);
            }
            }
            my $macrobody = $macros->{$name}->{Body};
            my $macrobody = $macros->{$name}->{Body};
            for ($i=0; $i<=$#args; $i++)
            for ($i=0; $i<=$#args; $i++)
            {
            {
              $macrobody =~ s|\\$macros->{$name}->{Args}->[$i]\\|$args[$i]|g;
              $macrobody =~ s|\\$macros->{$name}->{Args}->[$i]\\|$args[$i]|g;
            }
            }
            $macrobody =~ s|\\\\|\\|g;
            $macrobody =~ s|\\\\|\\|g;
            $_ = $before . $macrobody . $after;
            $_ = $before . $macrobody . $after;
            unshift @input_spool, map {$_ = $_."\n"} split(/\n/, $_);
            unshift @input_spool, map {$_ = $_."\n"} split(/\n/, $_);
            next INPUT_LINE;
            next INPUT_LINE;
          }
          }
        }                           #
        }                           #
        #
        #
        # try to skip the line
        # try to skip the line
        #
        #
        if ($end_tag) {
        if ($end_tag) {
            $in_titlepage = 0 if $end_tag eq 'titlepage';
            $in_titlepage = 0 if $end_tag eq 'titlepage';
            next if $to_skip{"end $end_tag"};
            next if $to_skip{"end $end_tag"};
        } elsif ($tag) {
        } elsif ($tag) {
          $in_titlepage = 1 if $tag eq 'titlepage';
          $in_titlepage = 1 if $tag eq 'titlepage';
          next if $to_skip{$tag};
          next if $to_skip{$tag};
          last if $tag eq 'bye';
          last if $tag eq 'bye';
        }
        }
        if ($in_top) {
        if ($in_top) {
            # parsing the top node
            # parsing the top node
            if ($tag eq 'node' ||
            if ($tag eq 'node' ||
                ($sec2level{$tag} && $tag !~ /unnumbered/ && $tag !~ /heading/))
                ($sec2level{$tag} && $tag !~ /unnumbered/ && $tag !~ /heading/))
            {
            {
                # no more in top
                # no more in top
                $in_top = 0;
                $in_top = 0;
                push(@lines, $TOPEND);
                push(@lines, $TOPEND);
            }
            }
        }
        }
        unless ($in_pre) {
        unless ($in_pre) {
            s/``/\"/g;
            s/``/\"/g;
            s/''/\"/g;
            s/''/\"/g;
            s/([\w ])---([\w ])/$1--$2/g;
            s/([\w ])---([\w ])/$1--$2/g;
        }
        }
        #
        #
        # analyze the tag
        # analyze the tag
        #
        #
        if ($tag) {
        if ($tag) {
            # skip lines
            # skip lines
            &skip_until($tag), next if $tag eq 'ignore';
            &skip_until($tag), next if $tag eq 'ignore';
            &skip_until($tag), next if $tag eq 'ifnothtml';
            &skip_until($tag), next if $tag eq 'ifnothtml';
            if ($tag eq 'ifinfo')
            if ($tag eq 'ifinfo')
            {
            {
              &skip_until($tag), next unless $T2H_EXPAND eq 'info';
              &skip_until($tag), next unless $T2H_EXPAND eq 'info';
            }
            }
            if ($tag eq 'iftex')
            if ($tag eq 'iftex')
            {
            {
              &skip_until($tag), next unless $T2H_EXPAND eq 'tex';
              &skip_until($tag), next unless $T2H_EXPAND eq 'tex';
            }
            }
            if ($tag eq 'tex')
            if ($tag eq 'tex')
            {
            {
              # add to latex2html file
              # add to latex2html file
              if ($T2H_EXPAND eq 'tex' && $T2H_L2H && ! $in_pre)
              if ($T2H_EXPAND eq 'tex' && $T2H_L2H && ! $in_pre)
              {
              {
                # add space to the end -- tex(i2dvi) does this, as well
                # add space to the end -- tex(i2dvi) does this, as well
                push(@lines, &l2h_ToLatex(&string_until($tag) . " "));
                push(@lines, &l2h_ToLatex(&string_until($tag) . " "));
              }
              }
              else
              else
              {
              {
                &skip_until($tag);
                &skip_until($tag);
              }
              }
              next;
              next;
            }
            }
            if ($tag eq 'titlepage')
            if ($tag eq 'titlepage')
            {
            {
              next;
              next;
            }
            }
            # handle special tables
            # handle special tables
            if ($tag =~ /^(|f|v|multi)table$/) {
            if ($tag =~ /^(|f|v|multi)table$/) {
                $table_type = $1;
                $table_type = $1;
                $tag = 'table';
                $tag = 'table';
            }
            }
            # special cases
            # special cases
            if ($tag eq 'top' || ($tag eq 'node' && /^\@node\s+top\s*,/i)) {
            if ($tag eq 'top' || ($tag eq 'node' && /^\@node\s+top\s*,/i)) {
                $in_top = 1;
                $in_top = 1;
                $has_top = 1;
                $has_top = 1;
                $has_top_command = 1 if $tag eq 'top';
                $has_top_command = 1 if $tag eq 'top';
                @lines = (); # ignore all lines before top (title page garbage)
                @lines = (); # ignore all lines before top (title page garbage)
                next;
                next;
            } elsif ($tag eq 'node') {
            } elsif ($tag eq 'node') {
              if ($in_top)
              if ($in_top)
              {
              {
                $in_top = 0;
                $in_top = 0;
                push(@lines, $TOPEND);
                push(@lines, $TOPEND);
              }
              }
              warn "$ERROR Bad node line: $_" unless $_ =~ /^\@node\s$NODESRE$/o;
              warn "$ERROR Bad node line: $_" unless $_ =~ /^\@node\s$NODESRE$/o;
              # request of "Richard Y. Kim" 
              # request of "Richard Y. Kim" 
              s/^\@node\s+//;
              s/^\@node\s+//;
              $_ = &protect_html($_); # if node contains '&' for instance
              $_ = &protect_html($_); # if node contains '&' for instance
              ($node, $node_next, $node_prev, $node_up) = split(/,/);
              ($node, $node_next, $node_prev, $node_up) = split(/,/);
              &normalise_node($node);
              &normalise_node($node);
              &normalise_node($node_next);
              &normalise_node($node_next);
              &normalise_node($node_prev);
              &normalise_node($node_prev);
              &normalise_node($node_up);
              &normalise_node($node_up);
              $node =~ /\"/ ?
              $node =~ /\"/ ?
                push @lines, &html_debug("\n", __LINE__) :
                push @lines, &html_debug("\n", __LINE__) :
                push @lines, &html_debug("\n", __LINE__);
                push @lines, &html_debug("\n", __LINE__);
              next;
              next;
            } elsif ($tag eq 'include') {
            } elsif ($tag eq 'include') {
                if (/^\@include\s+($FILERE)\s*$/o) {
                if (/^\@include\s+($FILERE)\s*$/o) {
                    $file = LocateIncludeFile($1);
                    $file = LocateIncludeFile($1);
                    if ($file && -e $file) {
                    if ($file && -e $file) {
                        &open($file);
                        &open($file);
                        print "# including $file\n" if $T2H_VERBOSE;
                        print "# including $file\n" if $T2H_VERBOSE;
                    } else {
                    } else {
                        warn "$ERROR Can't find $1, skipping";
                        warn "$ERROR Can't find $1, skipping";
                    }
                    }
                } else {
                } else {
                    warn "$ERROR Bad include line: $_";
                    warn "$ERROR Bad include line: $_";
                }
                }
                next;
                next;
            } elsif ($tag eq 'ifclear') {
            } elsif ($tag eq 'ifclear') {
                if (/^\@ifclear\s+($VARRE)\s*$/o) {
                if (/^\@ifclear\s+($VARRE)\s*$/o) {
                    next unless defined($value{$1});
                    next unless defined($value{$1});
                    &skip_until($tag);
                    &skip_until($tag);
                } else {
                } else {
                    warn "$ERROR Bad ifclear line: $_";
                    warn "$ERROR Bad ifclear line: $_";
                }
                }
                next;
                next;
            } elsif ($tag eq 'ifset') {
            } elsif ($tag eq 'ifset') {
                if (/^\@ifset\s+($VARRE)\s*$/o) {
                if (/^\@ifset\s+($VARRE)\s*$/o) {
                    next if defined($value{$1});
                    next if defined($value{$1});
                    &skip_until($tag);
                    &skip_until($tag);
                } else {
                } else {
                    warn "$ERROR Bad ifset line: $_";
                    warn "$ERROR Bad ifset line: $_";
                }
                }
                next;
                next;
            } elsif ($tag eq 'menu') {
            } elsif ($tag eq 'menu') {
                unless ($T2H_SHOW_MENU) {
                unless ($T2H_SHOW_MENU) {
                    &skip_until($tag);
                    &skip_until($tag);
                    next;
                    next;
                }
                }
                &html_push_if($tag);
                &html_push_if($tag);
                push(@lines, &html_debug('', __LINE__));
                push(@lines, &html_debug('', __LINE__));
            } elsif ($format_map{$tag}) {
            } elsif ($format_map{$tag}) {
                $in_pre = 1 if $format_map{$tag} eq 'PRE';
                $in_pre = 1 if $format_map{$tag} eq 'PRE';
                &html_push_if($format_map{$tag});
                &html_push_if($format_map{$tag});
                push(@lines, &html_debug('', __LINE__));
                push(@lines, &html_debug('', __LINE__));
                $in_list++ if $format_map{$tag} eq 'UL' || $format_map{$tag} eq 'OL' ;
                $in_list++ if $format_map{$tag} eq 'UL' || $format_map{$tag} eq 'OL' ;
    #           push(@lines, &debug("
    \n", __LINE__))
    #           push(@lines, &debug("
    \n", __LINE__))
    #             if $tag =~ /example/i;
    #             if $tag =~ /example/i;
                # sunshine@sunshineco.com: 
    bla
    looks better than
                # sunshine@sunshineco.com: 
    bla
    looks better than
                # 
    \nbla
    (at least on NeXTstep browser
                # 
    \nbla
    (at least on NeXTstep browser
                push(@lines, &debug("<$format_map{$tag}>" .
                push(@lines, &debug("<$format_map{$tag}>" .
                                    ($in_pre ? '' : "\n"), __LINE__));
                                    ($in_pre ? '' : "\n"), __LINE__));
                next;
                next;
            }
            }
            elsif (exists $complex_format_map->{$tag})
            elsif (exists $complex_format_map->{$tag})
            {
            {
              my $start = eval $complex_format_map->{$tag}->[0];
              my $start = eval $complex_format_map->{$tag}->[0];
              if ($@)
              if ($@)
              {
              {
                print "$ERROR: eval of complex_format_map->{$tag}->[0] $complex_format_map->{$tag}->[0]: $@";
                print "$ERROR: eval of complex_format_map->{$tag}->[0] $complex_format_map->{$tag}->[0]: $@";
                $start = '
    '
                $start = '
    '
              }
              }
              $in_pre = 1 if $start =~ /
              $in_pre = 1 if $start =~ /
              push(@lines, html_debug($start. ($in_pre ? '' : "\n"), __LINE__));
              push(@lines, html_debug($start. ($in_pre ? '' : "\n"), __LINE__));
              next;
              next;
            } elsif ($tag eq 'table') {
            } elsif ($tag eq 'table') {
              # anorland@hem2.passagen.se
              # anorland@hem2.passagen.se
              # if (/^\s*\@(|f|v|multi)table\s+\@(\w+)/) {
              # if (/^\s*\@(|f|v|multi)table\s+\@(\w+)/) {
                 if (/^\s*\@(|f|v|multi)table\s+\@(\w+)|(\{[^\}]*\})/) {
                 if (/^\s*\@(|f|v|multi)table\s+\@(\w+)|(\{[^\}]*\})/) {
                    $in_table = $2;
                    $in_table = $2;
                    unshift(@tables, join($;, $table_type, $in_table));
                    unshift(@tables, join($;, $table_type, $in_table));
                    if ($table_type eq "multi") {
                    if ($table_type eq "multi") {
                        # don't use borders -- gets confused by empty cells
                        # don't use borders -- gets confused by empty cells
                        push(@lines, &debug("\n", __LINE__));
                        push(@lines, &debug("\n", __LINE__));
                        &html_push_if('TABLE');
                        &html_push_if('TABLE');
                    } else {
                    } else {
                        push(@lines, &debug("
    \n", __LINE__));
                        push(@lines, &debug("
    \n", __LINE__));
                        &html_push_if('DL');
                        &html_push_if('DL');
                    }
                    }
                    push(@lines, &html_debug('', __LINE__));
                    push(@lines, &html_debug('', __LINE__));
                } else {
                } else {
                    warn "$ERROR Bad table line: $_";
                    warn "$ERROR Bad table line: $_";
                }
                }
                next;
                next;
            }
            }
            elsif ($tag eq 'synindex' || $tag eq 'syncodeindex')
            elsif ($tag eq 'synindex' || $tag eq 'syncodeindex')
            {
            {
              if (/^\@$tag\s+(\w+)\s+(\w+)\s*$/)
              if (/^\@$tag\s+(\w+)\s+(\w+)\s*$/)
              {
              {
                my $from = $1;
                my $from = $1;
                my $to = $2;
                my $to = $2;
                my $prefix_from = IndexName2Prefix($from);
                my $prefix_from = IndexName2Prefix($from);
                my $prefix_to = IndexName2Prefix($to);
                my $prefix_to = IndexName2Prefix($to);
                warn("$ERROR unknown from index name $from ind syn*index line: $_"), next
                warn("$ERROR unknown from index name $from ind syn*index line: $_"), next
                  unless $prefix_from;
                  unless $prefix_from;
                warn("$ERROR unknown to index name $to ind syn*index line: $_"), next
                warn("$ERROR unknown to index name $to ind syn*index line: $_"), next
                  unless $prefix_to;
                  unless $prefix_to;
                if ($tag eq 'syncodeindex')
                if ($tag eq 'syncodeindex')
                {
                {
                  $index_properties->{$prefix_to}->{'from_code'}->{$prefix_from} = 1;
                  $index_properties->{$prefix_to}->{'from_code'}->{$prefix_from} = 1;
                }
                }
                else
                else
                {
                {
                   $index_properties->{$prefix_to}->{'from'}->{$prefix_from} = 1;
                   $index_properties->{$prefix_to}->{'from'}->{$prefix_from} = 1;
                }
                }
              }
              }
              else
              else
              {
              {
                warn "$ERROR Bad syn*index line: $_";
                warn "$ERROR Bad syn*index line: $_";
              }
              }
              next;
              next;
            }
            }
            elsif ($tag eq 'defindex' || $tag eq 'defcodeindex')
            elsif ($tag eq 'defindex' || $tag eq 'defcodeindex')
            {
            {
              if (/^\@$tag\s+(\w+)\s*$/)
              if (/^\@$tag\s+(\w+)\s*$/)
              {
              {
                my $name = $1;
                my $name = $1;
                $index_properties->{$name}->{name} = $name;
                $index_properties->{$name}->{name} = $name;
                $index_properties->{$name}->{code} = 1 if $tag eq 'defcodeindex';
                $index_properties->{$name}->{code} = 1 if $tag eq 'defcodeindex';
              }
              }
              else
              else
              {
              {
                warn "$ERROR Bad defindex line: $_";
                warn "$ERROR Bad defindex line: $_";
              }
              }
              next;
              next;
            }
            }
            elsif (/^\@printindex/)
            elsif (/^\@printindex/)
            {
            {
              push (@lines, "$_");
              push (@lines, "$_");
              next;
              next;
            }
            }
            elsif ($tag eq 'sp') {
            elsif ($tag eq 'sp') {
                push(@lines, &debug("

    \n", __LINE__));

                push(@lines, &debug("

    \n", __LINE__));

                next;
                next;
            } elsif ($tag eq 'center') {
            } elsif ($tag eq 'center') {
                push(@lines, &debug("
    \n", __LINE__));
                push(@lines, &debug("
    \n", __LINE__));
                s/\@center//;
                s/\@center//;
            } elsif ($tag eq 'setref') {
            } elsif ($tag eq 'setref') {
                &protect_html; # if setref contains '&' for instance
                &protect_html; # if setref contains '&' for instance
                if (/^\@$tag\s*{($NODERE)}\s*$/) {
                if (/^\@$tag\s*{($NODERE)}\s*$/) {
                    $setref = $1;
                    $setref = $1;
                    $setref =~ s/\s+/ /g; # normalize
                    $setref =~ s/\s+/ /g; # normalize
                    $setref =~ s/ $//;
                    $setref =~ s/ $//;
                    $node2sec{$setref} = $name;
                    $node2sec{$setref} = $name;
                    $sec2node{$name} = $setref;
                    $sec2node{$name} = $setref;
                    $node2href{$setref} = "$docu_doc#$docid";
                    $node2href{$setref} = "$docu_doc#$docid";
                } else {
                } else {
                    warn "$ERROR Bad setref line: $_";
                    warn "$ERROR Bad setref line: $_";
                }
                }
                next;
                next;
            } elsif ($tag eq 'lowersections') {
            } elsif ($tag eq 'lowersections') {
                local ($sec, $level);
                local ($sec, $level);
                while (($sec, $level) = each %sec2level) {
                while (($sec, $level) = each %sec2level) {
                    $sec2level{$sec} = $level + 1;
                    $sec2level{$sec} = $level + 1;
                }
                }
                next;
                next;
            } elsif ($tag eq 'raisesections') {
            } elsif ($tag eq 'raisesections') {
                local ($sec, $level);
                local ($sec, $level);
                while (($sec, $level) = each %sec2level) {
                while (($sec, $level) = each %sec2level) {
                    $sec2level{$sec} = $level - 1;
                    $sec2level{$sec} = $level - 1;
                }
                }
                next;
                next;
            }
            }
            elsif ($tag eq 'macro' || $tag eq 'rmacro')
            elsif ($tag eq 'macro' || $tag eq 'rmacro')
            {
            {
              if (/^\@$tag\s*(\w+)\s*(.*)/)
              if (/^\@$tag\s*(\w+)\s*(.*)/)
              {
              {
                my $name = $1;
                my $name = $1;
                my @args;
                my @args;
                @args = split(/\s*,\s*/ , $1)
                @args = split(/\s*,\s*/ , $1)
                  if ($2 =~ /^\s*{(.*)}\s*/);
                  if ($2 =~ /^\s*{(.*)}\s*/);
                $macros->{$name}->{Args} = \@args;
                $macros->{$name}->{Args} = \@args;
                $macros->{$name}->{Body} = '';
                $macros->{$name}->{Body} = '';
                while (($_ = &next_line) && $_ !~ /\@end $tag/)
                while (($_ = &next_line) && $_ !~ /\@end $tag/)
                {
                {
                  $macros->{$name}->{Body} .= $_;
                  $macros->{$name}->{Body} .= $_;
                }
                }
                die "ERROR: No closing '\@end $tag' found for macro definition of '$name'\n"
                die "ERROR: No closing '\@end $tag' found for macro definition of '$name'\n"
                  unless (/\@end $tag/);
                  unless (/\@end $tag/);
                chomp $macros->{$name}->{Body};
                chomp $macros->{$name}->{Body};
              }
              }
              else
              else
              {
              {
                warn "$ERROR: Bad macro defintion $_"
                warn "$ERROR: Bad macro defintion $_"
              }
              }
              next;
              next;
            }
            }
            elsif ($tag eq 'unmacro')
            elsif ($tag eq 'unmacro')
            {
            {
              delete $macros->{$1} if (/^\@unmacro\s*(\w+)/);
              delete $macros->{$1} if (/^\@unmacro\s*(\w+)/);
              next;
              next;
            }
            }
            elsif ($tag eq 'documentlanguage')
            elsif ($tag eq 'documentlanguage')
            {
            {
              SetDocumentLanguage($1) if (!$T2H_LANG && /documentlanguage\s*(\w+)/);
              SetDocumentLanguage($1) if (!$T2H_LANG && /documentlanguage\s*(\w+)/);
            }
            }
            elsif (defined($def_map{$tag})) {
            elsif (defined($def_map{$tag})) {
                if ($def_map{$tag}) {
                if ($def_map{$tag}) {
                    s/^\@$tag\s+//;
                    s/^\@$tag\s+//;
                    $tag = $def_map{$tag};
                    $tag = $def_map{$tag};
                    $_ = "\@$tag $_";
                    $_ = "\@$tag $_";
                    $tag =~ s/\s.*//;
                    $tag =~ s/\s.*//;
                }
                }
            } elsif (defined($user_sub{$tag})) {
            } elsif (defined($user_sub{$tag})) {
                s/^\@$tag\s+//;
                s/^\@$tag\s+//;
                $sub = $user_sub{$tag};
                $sub = $user_sub{$tag};
                print "# user $tag = $sub, arg: $_" if $T2H_DEBUG & $DEBUG_USER;
                print "# user $tag = $sub, arg: $_" if $T2H_DEBUG & $DEBUG_USER;
                if (defined(&$sub)) {
                if (defined(&$sub)) {
                    chop($_);
                    chop($_);
                    &$sub($_);
                    &$sub($_);
                } else {
                } else {
                    warn "$ERROR Bad user sub for $tag: $sub\n";
                    warn "$ERROR Bad user sub for $tag: $sub\n";
                }
                }
                next;
                next;
              }
              }
            if (defined($def_map{$tag})) {
            if (defined($def_map{$tag})) {
                s/^\@$tag\s+//;
                s/^\@$tag\s+//;
                if ($tag =~ /x$/) {
                if ($tag =~ /x$/) {
                    # extra definition line
                    # extra definition line
                    $tag = $`;
                    $tag = $`;
                    $is_extra = 1;
                    $is_extra = 1;
                } else {
                } else {
                    $is_extra = 0;
                    $is_extra = 0;
                }
                }
                while (/\{([^\{\}]*)\}/) {
                while (/\{([^\{\}]*)\}/) {
                    # this is a {} construct
                    # this is a {} construct
                    ($before, $contents, $after) = ($`, $1, $');
                    ($before, $contents, $after) = ($`, $1, $');
                    # protect spaces
                    # protect spaces
                    $contents =~ s/\s+/$;9/g;
                    $contents =~ s/\s+/$;9/g;
                    # restore $_ protecting {}
                    # restore $_ protecting {}
                    $_ = "$before$;7$contents$;8$after";
                    $_ = "$before$;7$contents$;8$after";
                }
                }
                @args = split(/\s+/, &protect_html($_));
                @args = split(/\s+/, &protect_html($_));
                foreach (@args) {
                foreach (@args) {
                    s/$;9/ /g;      # unprotect spaces
                    s/$;9/ /g;      # unprotect spaces
                    s/$;7/\{/g;     # ... {
                    s/$;7/\{/g;     # ... {
                    s/$;8/\}/g;     # ... }
                    s/$;8/\}/g;     # ... }
                }
                }
                $type = shift(@args);
                $type = shift(@args);
                $type =~ s/^\{(.*)\}$/$1/;
                $type =~ s/^\{(.*)\}$/$1/;
                print "# def ($tag): {$type} ", join(', ', @args), "\n"
                print "# def ($tag): {$type} ", join(', ', @args), "\n"
                    if $T2H_DEBUG & $DEBUG_DEF;
                    if $T2H_DEBUG & $DEBUG_DEF;
                $type .= ':'; # it's nicer like this
                $type .= ':'; # it's nicer like this
                my $name = shift(@args);
                my $name = shift(@args);
                $name =~ s/^\{(.*)\}$/$1/;
                $name =~ s/^\{(.*)\}$/$1/;
                if ($is_extra) {
                if ($is_extra) {
                    $_ = &debug("
    ", __LINE__);
                    $_ = &debug("
    ", __LINE__);
                } else {
                } else {
                    $_ = &debug("
    \n
    ", __LINE__);
                    $_ = &debug("
    \n
    ", __LINE__);
                }
                }
                if ($tag eq 'deffn' || $tag eq 'defvr' || $tag eq 'deftp') {
                if ($tag eq 'deffn' || $tag eq 'defvr' || $tag eq 'deftp') {
                    $_ .= "$type $name";
                    $_ .= "$type $name";
                    $_ .= " @args" if @args;
                    $_ .= " @args" if @args;
                } elsif ($tag eq 'deftypefn' || $tag eq 'deftypevr'
                } elsif ($tag eq 'deftypefn' || $tag eq 'deftypevr'
                         || $tag eq 'defcv' || $tag eq 'defop') {
                         || $tag eq 'defcv' || $tag eq 'defop') {
                    $ftype = $name;
                    $ftype = $name;
                    $name = shift(@args);
                    $name = shift(@args);
                    $name =~ s/^\{(.*)\}$/$1/;
                    $name =~ s/^\{(.*)\}$/$1/;
                    $_ .= "$type $ftype $name";
                    $_ .= "$type $ftype $name";
                    $_ .= " @args" if @args;
                    $_ .= " @args" if @args;
                } else {
                } else {
                    warn "$ERROR Unknown definition type: $tag\n";
                    warn "$ERROR Unknown definition type: $tag\n";
                    $_ .= "$type $name";
                    $_ .= "$type $name";
                    $_ .= " @args" if @args;
                    $_ .= " @args" if @args;
                }
                }
                $_ .= &debug("\n
    ", __LINE__);
                $_ .= &debug("\n
    ", __LINE__);
                $name = &unprotect_html($name);
                $name = &unprotect_html($name);
                if ($tag eq 'deffn' || $tag eq 'deftypefn') {
                if ($tag eq 'deffn' || $tag eq 'deftypefn') {
                  EnterIndexEntry('f', $name, $docu_doc, $section, \@lines);
                  EnterIndexEntry('f', $name, $docu_doc, $section, \@lines);
    #               unshift(@input_spool, "\@findex $name\n");
    #               unshift(@input_spool, "\@findex $name\n");
                } elsif ($tag eq 'defop') {
                } elsif ($tag eq 'defop') {
                  EnterIndexEntry('f', "$name on $ftype", $docu_doc, $section, \@lines);
                  EnterIndexEntry('f', "$name on $ftype", $docu_doc, $section, \@lines);
    #               unshift(@input_spool, "\@findex $name on $ftype\n");
    #               unshift(@input_spool, "\@findex $name on $ftype\n");
                } elsif ($tag eq 'defvr' || $tag eq 'deftypevr' || $tag eq 'defcv') {
                } elsif ($tag eq 'defvr' || $tag eq 'deftypevr' || $tag eq 'defcv') {
                  EnterIndexEntry('v', $name, $docu_doc, $section, \@lines);
                  EnterIndexEntry('v', $name, $docu_doc, $section, \@lines);
    #               unshift(@input_spool, "\@vindex $name\n");
    #               unshift(@input_spool, "\@vindex $name\n");
                } else {
                } else {
                  EnterIndexEntry('t', $name, $docu_doc, $section, \@lines);
                  EnterIndexEntry('t', $name, $docu_doc, $section, \@lines);
    #               unshift(@input_spool, "\@tindex $name\n");
    #               unshift(@input_spool, "\@tindex $name\n");
                }
                }
                $dont_html = 1;
                $dont_html = 1;
            }
            }
        } elsif ($end_tag) {
        } elsif ($end_tag) {
            if ($format_map{$end_tag}) {
            if ($format_map{$end_tag}) {
                $in_pre = 0 if $format_map{$end_tag} eq 'PRE';
                $in_pre = 0 if $format_map{$end_tag} eq 'PRE';
                $in_list-- if $format_map{$end_tag} eq 'UL' || $format_map{$end_tag} eq 'OL' ;
                $in_list-- if $format_map{$end_tag} eq 'UL' || $format_map{$end_tag} eq 'OL' ;
                &html_pop_if('P');
                &html_pop_if('P');
                &html_pop_if('LI');
                &html_pop_if('LI');
                &html_pop_if();
                &html_pop_if();
                push(@lines, &debug("\n", __LINE__));
                push(@lines, &debug("\n", __LINE__));
                push(@lines, &html_debug('', __LINE__));
                push(@lines, &html_debug('', __LINE__));
            }
            }
            elsif (exists $complex_format_map->{$end_tag})
            elsif (exists $complex_format_map->{$end_tag})
            {
            {
              my $end = eval $complex_format_map->{$end_tag}->[1];
              my $end = eval $complex_format_map->{$end_tag}->[1];
              if ($@)
              if ($@)
              {
              {
                print "$ERROR: eval of complex_format_map->{$end_tag}->[1] $complex_format_map->{$end_tag}->[0]: $@";
                print "$ERROR: eval of complex_format_map->{$end_tag}->[1] $complex_format_map->{$end_tag}->[0]: $@";
                $end = '
    '
                $end = '
    '
              }
              }
              $in_pre = 0 if $end =~ m|
    |;
              $in_pre = 0 if $end =~ m|
    |;
              push(@lines, html_debug($end, __LINE__));
              push(@lines, html_debug($end, __LINE__));
            } elsif ($end_tag =~ /^(|f|v|multi)table$/) {
            } elsif ($end_tag =~ /^(|f|v|multi)table$/) {
                unless (@tables) {
                unless (@tables) {
                    warn "$ERROR \@end $end_tag without \@*table\n";
                    warn "$ERROR \@end $end_tag without \@*table\n";
                    next;
                    next;
                }
                }
                &html_pop_if('P');
                &html_pop_if('P');
                ($table_type, $in_table) = split($;, shift(@tables));
                ($table_type, $in_table) = split($;, shift(@tables));
                unless ($1 eq $table_type) {
                unless ($1 eq $table_type) {
                    warn "$ERROR \@end $end_tag without matching \@$end_tag\n";
                    warn "$ERROR \@end $end_tag without matching \@$end_tag\n";
                    next;
                    next;
                }
                }
                if ($table_type eq "multi") {
                if ($table_type eq "multi") {
                    push(@lines, "
    \n");
                    push(@lines, "
    \n");
                    &html_pop_if('TR');
                    &html_pop_if('TR');
                } else {
                } else {
                    push(@lines, "\n");
                    push(@lines, "\n");
                    &html_pop_if('DD');
                    &html_pop_if('DD');
                }
                }
                &html_pop_if();
                &html_pop_if();
                if (@tables) {
                if (@tables) {
                    ($table_type, $in_table) = split($;, $tables[0]);
                    ($table_type, $in_table) = split($;, $tables[0]);
                } else {
                } else {
                    $in_table = 0;
                    $in_table = 0;
                }
                }
            } elsif (defined($def_map{$end_tag})) {
            } elsif (defined($def_map{$end_tag})) {
                push(@lines, &debug("\n", __LINE__));
                push(@lines, &debug("\n", __LINE__));
            } elsif ($end_tag eq 'menu') {
            } elsif ($end_tag eq 'menu') {
                &html_pop_if();
                &html_pop_if();
                push(@lines, $_); # must keep it for pass 2
                push(@lines, $_); # must keep it for pass 2
            }
            }
            next;
            next;
        }
        }
        #############################################################
        #############################################################
        # anchor insertion
        # anchor insertion
        while (/\@anchor\s*\{(.*?)\}/)
        while (/\@anchor\s*\{(.*?)\}/)
        {
        {
          $_ = $`.$';
          $_ = $`.$';
          my $anchor = $1;
          my $anchor = $1;
          $anchor = &normalise_node($anchor);
          $anchor = &normalise_node($anchor);
          push @lines, &html_debug("\n");
          push @lines, &html_debug("\n");
          $node2href{$anchor} = "$docu_doc#$anchor";
          $node2href{$anchor} = "$docu_doc#$anchor";
          next INPUT_LINE if $_ =~ /^\s*$/;
          next INPUT_LINE if $_ =~ /^\s*$/;
        }
        }
        #############################################################
        #############################################################
        # index entry generation, after value substitutions
        # index entry generation, after value substitutions
        if (/^\@(\w+?)index\s+/)
        if (/^\@(\w+?)index\s+/)
        {
        {
          EnterIndexEntry($1, $', $docu_doc, $section, \@lines);
          EnterIndexEntry($1, $', $docu_doc, $section, \@lines);
          next;
          next;
        }
        }
        #
        #
        # protect texi and HTML things
        # protect texi and HTML things
        &protect_texi;
        &protect_texi;
        $_ = &protect_html($_) unless $dont_html;
        $_ = &protect_html($_) unless $dont_html;
        $dont_html = 0;
        $dont_html = 0;
        # substitution (unsupported things)
        # substitution (unsupported things)
        s/^\@exdent\s+//g;
        s/^\@exdent\s+//g;
        s/\@noindent\s+//g;
        s/\@noindent\s+//g;
        s/\@refill\s+//g;
        s/\@refill\s+//g;
        # other substitutions
        # other substitutions
        &simple_substitutions;
        &simple_substitutions;
        s/\@footnote\{/\@footnote$docu_doc\{/g; # mark footnotes, cf. pass 4
        s/\@footnote\{/\@footnote$docu_doc\{/g; # mark footnotes, cf. pass 4
        #
        #
        # analyze the tag again
        # analyze the tag again
        #
        #
        if ($tag) {
        if ($tag) {
          if (defined($sec2level{$tag}) && $sec2level{$tag} > 0) {
          if (defined($sec2level{$tag}) && $sec2level{$tag} > 0) {
                if (/^\@$tag\s+(.+)$/) {
                if (/^\@$tag\s+(.+)$/) {
                    $name = $1;
                    $name = $1;
                    $name = &normalise_node($name);
                    $name = &normalise_node($name);
                    $level = $sec2level{$tag};
                    $level = $sec2level{$tag};
                    # check for index
                    # check for index
                    $first_index_chapter = $name
                    $first_index_chapter = $name
                      if ($level == 1 && !$first_index_chapter &&
                      if ($level == 1 && !$first_index_chapter &&
                          $name =~ /index/i);
                          $name =~ /index/i);
                    if ($in_top && /heading/){
                    if ($in_top && /heading/){
                        $T2H_HAS_TOP_HEADING = 1;
                        $T2H_HAS_TOP_HEADING = 1;
                        $_ = &debug("$name\n", __LINE__);
                        $_ = &debug("$name\n", __LINE__);
                        &html_push_if('body');
                        &html_push_if('body');
                        print "# top heading, section $name, level $level\n"
                        print "# top heading, section $name, level $level\n"
                            if $T2H_DEBUG & $DEBUG_TOC;
                            if $T2H_DEBUG & $DEBUG_TOC;
                    }
                    }
                    else
                    else
                    {
                    {
                      unless (/^\@\w*heading/)
                      unless (/^\@\w*heading/)
                      {
                      {
                        unless (/^\@unnumbered/)
                        unless (/^\@unnumbered/)
                        {
                        {
                          my $number = &update_sec_num($tag, $level);
                          my $number = &update_sec_num($tag, $level);
                          $name = $number. ' ' . $name if $T2H_NUMBER_SECTIONS;
                          $name = $number. ' ' . $name if $T2H_NUMBER_SECTIONS;
                          $sec2number{$name} = $number;
                          $sec2number{$name} = $number;
                          $number2sec{$number} = $name;
                          $number2sec{$number} = $name;
                        }
                        }
                        if (defined($toplevel))
                        if (defined($toplevel))
                        {
                        {
                          push @lines, ($level==$toplevel ? $CHAPTEREND : $SECTIONEND);
                          push @lines, ($level==$toplevel ? $CHAPTEREND : $SECTIONEND);
                        }
                        }
                        else
                        else
                        {
                        {
                          # first time we see a "section"
                          # first time we see a "section"
                          unless ($level == 1)
                          unless ($level == 1)
                          {
                          {
                            warn "$WARN The first section found is not of level 1: $_";
                            warn "$WARN The first section found is not of level 1: $_";
                          }
                          }
                          $toplevel = $level;
                          $toplevel = $level;
                        }
                        }
                        push(@sections, $name);
                        push(@sections, $name);
                        next_doc() if ($T2H_SPLIT eq 'section' ||
                        next_doc() if ($T2H_SPLIT eq 'section' ||
                                       $T2H_SPLIT && $level == $toplevel);
                                       $T2H_SPLIT && $level == $toplevel);
                      }
                      }
                      $sec_num++;
                      $sec_num++;
                      $docid = "SEC$sec_num";
                      $docid = "SEC$sec_num";
                      $tocid = (/^\@\w*heading/ ? undef : "TOC$sec_num");
                      $tocid = (/^\@\w*heading/ ? undef : "TOC$sec_num");
                      # check biblio and glossary
                      # check biblio and glossary
                      $in_bibliography = ($name =~ /^([A-Z]|\d+)?(\.\d+)*\s*bibliography$/i);
                      $in_bibliography = ($name =~ /^([A-Z]|\d+)?(\.\d+)*\s*bibliography$/i);
                      $in_glossary = ($name =~ /^([A-Z]|\d+)?(\.\d+)*\s*glossary$/i);
                      $in_glossary = ($name =~ /^([A-Z]|\d+)?(\.\d+)*\s*glossary$/i);
                      # check node
                      # check node
                      if ($node)
                      if ($node)
                      {
                      {
                        warn "$ERROR Duplicate node found: $node\n"
                        warn "$ERROR Duplicate node found: $node\n"
                          if ($node2sec{$node});
                          if ($node2sec{$node});
                      }
                      }
                      else
                      else
                      {
                      {
                        $name .= ' ' while ($node2sec{$name});
                        $name .= ' ' while ($node2sec{$name});
                        $node = $name;
                        $node = $name;
                      }
                      }
                      $name .= ' ' while ($sec2node{$name});
                      $name .= ' ' while ($sec2node{$name});
                      $section = $name;
                      $section = $name;
                      $node2sec{$node} = $name;
                      $node2sec{$node} = $name;
                      $sec2node{$name} = $node;
                      $sec2node{$name} = $node;
                      $node2href{$node} = "$docu_doc#$docid";
                      $node2href{$node} = "$docu_doc#$docid";
                      $node2next{$node} = $node_next;
                      $node2next{$node} = $node_next;
                      $node2prev{$node} = $node_prev;
                      $node2prev{$node} = $node_prev;
                      $node2up{$node} = $node_up;
                      $node2up{$node} = $node_up;
                      print "# node $node, section $name, level $level\n"
                      print "# node $node, section $name, level $level\n"
                        if $T2H_DEBUG & $DEBUG_TOC;
                        if $T2H_DEBUG & $DEBUG_TOC;
                      $node = '';
                      $node = '';
                      $node_next = '';
                      $node_next = '';
                      $node_prev = '';
                      $node_prev = '';
                      $node_next = '';
                      $node_next = '';
                      if ($tocid)
                      if ($tocid)
                      {
                      {
                        # update TOC
                        # update TOC
                        while ($level > $curlevel) {
                        while ($level > $curlevel) {
                          $curlevel++;
                          $curlevel++;
                          push(@toc_lines, "
      \n");
                          push(@toc_lines, "
      \n");
                        }
                        }
                        while ($level < $curlevel) {
                        while ($level < $curlevel) {
                          $curlevel--;
                          $curlevel--;
                          push(@toc_lines, "\n");
                          push(@toc_lines, "\n");
                        }
                        }
                        $_ = &t2h_anchor($tocid, "$docu_doc#$docid", $name, 1);
                        $_ = &t2h_anchor($tocid, "$docu_doc#$docid", $name, 1);
                        $_ = &substitute_style($_);
                        $_ = &substitute_style($_);
                        push(@stoc_lines, "$_
    \n") if ($level == 1);
                        push(@stoc_lines, "$_
    \n") if ($level == 1);
                        if ($T2H_NUMBER_SECTIONS)
                        if ($T2H_NUMBER_SECTIONS)
                        {
                        {
                          push(@toc_lines, $_ . "
    \n")
                          push(@toc_lines, $_ . "
    \n")
                        }
                        }
                        else
                        else
                        {
                        {
                          push(@toc_lines, "
  • " . $_ ."
  • ");
                          push(@toc_lines, "
  • " . $_ ."
  • ");
                        }
                        }
                      }
                      }
                      else
                      else
                      {
                      {
                        push(@lines, &html_debug("\n",
                        push(@lines, &html_debug("\n",
                                               __LINE__));
                                               __LINE__));
                      }
                      }
                      # update DOC
                      # update DOC
                      push(@lines, &html_debug('', __LINE__));
                      push(@lines, &html_debug('', __LINE__));
                      &html_reset;
                      &html_reset;
                      $_ =  " $name \n\n";
                      $_ =  " $name \n\n";
                      $_ = &debug($_, __LINE__);
                      $_ = &debug($_, __LINE__);
                      push(@lines, &html_debug('', __LINE__));
                      push(@lines, &html_debug('', __LINE__));
                    }
                    }
                    # update DOC
                    # update DOC
                    foreach $line (split(/\n+/, $_)) {
                    foreach $line (split(/\n+/, $_)) {
                        push(@lines, "$line\n");
                        push(@lines, "$line\n");
                    }
                    }
                    next;
                    next;
                } else {
                } else {
                    warn "$ERROR Bad section line: $_";
                    warn "$ERROR Bad section line: $_";
                }
                }
            } else {
            } else {
                # track variables
                # track variables
                $value{$1} = Unprotect_texi($2), next if /^\@set\s+($VARRE)\s+(.*)$/o;
                $value{$1} = Unprotect_texi($2), next if /^\@set\s+($VARRE)\s+(.*)$/o;
                delete $value{$1}, next if /^\@clear\s+($VARRE)\s*$/o;
                delete $value{$1}, next if /^\@clear\s+($VARRE)\s*$/o;
                # store things
                # store things
                $value{'_shorttitle'} = Unprotect_texi($1), next if /^\@shorttitle\s+(.*)$/;
                $value{'_shorttitle'} = Unprotect_texi($1), next if /^\@shorttitle\s+(.*)$/;
                $value{'_setfilename'}   = Unprotect_texi($1), next if /^\@setfilename\s+(.*)$/;
                $value{'_setfilename'}   = Unprotect_texi($1), next if /^\@setfilename\s+(.*)$/;
                $value{'_settitle'}      = Unprotect_texi($1), next if /^\@settitle\s+(.*)$/;
                $value{'_settitle'}      = Unprotect_texi($1), next if /^\@settitle\s+(.*)$/;
                $value{'_author'}   .= Unprotect_texi($1)."\n", next if /^\@author\s+(.*)$/;
                $value{'_author'}   .= Unprotect_texi($1)."\n", next if /^\@author\s+(.*)$/;
                $value{'_subtitle'} .= Unprotect_texi($1)."\n", next if /^\@subtitle\s+(.*)$/;
                $value{'_subtitle'} .= Unprotect_texi($1)."\n", next if /^\@subtitle\s+(.*)$/;
                $value{'_title'}    .= Unprotect_texi($1)."\n", next if /^\@title\s+(.*)$/;
                $value{'_title'}    .= Unprotect_texi($1)."\n", next if /^\@title\s+(.*)$/;
                # list item
                # list item
                if (/^\s*\@itemx?\s+/) {
                if (/^\s*\@itemx?\s+/) {
                    $what = $';
                    $what = $';
                    $what =~ s/\s+$//;
                    $what =~ s/\s+$//;
                    if ($in_bibliography && $use_bibliography) {
                    if ($in_bibliography && $use_bibliography) {
                        if ($what =~ /^$BIBRE$/o) {
                        if ($what =~ /^$BIBRE$/o) {
                            $id = 'BIB' . ++$bib_num;
                            $id = 'BIB' . ++$bib_num;
                            $bib2href{$what} = "$docu_doc#$id";
                            $bib2href{$what} = "$docu_doc#$id";
                            print "# found bibliography for '$what' id $id\n"
                            print "# found bibliography for '$what' id $id\n"
                                if $T2H_DEBUG & $DEBUG_BIB;
                                if $T2H_DEBUG & $DEBUG_BIB;
                            $what = &t2h_anchor($id, '', $what);
                            $what = &t2h_anchor($id, '', $what);
                        }
                        }
                    } elsif ($in_glossary && $T2H_USE_GLOSSARY) {
                    } elsif ($in_glossary && $T2H_USE_GLOSSARY) {
                        $id = 'GLOSS' . ++$gloss_num;
                        $id = 'GLOSS' . ++$gloss_num;
                        $entry = $what;
                        $entry = $what;
                        $entry =~ tr/A-Z/a-z/ unless $entry =~ /^[A-Z\s]+$/;
                        $entry =~ tr/A-Z/a-z/ unless $entry =~ /^[A-Z\s]+$/;
                        $gloss2href{$entry} = "$docu_doc#$id";
                        $gloss2href{$entry} = "$docu_doc#$id";
                        print "# found glossary for '$entry' id $id\n"
                        print "# found glossary for '$entry' id $id\n"
                            if $T2H_DEBUG & $DEBUG_GLOSS;
                            if $T2H_DEBUG & $DEBUG_GLOSS;
                        $what = &t2h_anchor($id, '', $what);
                        $what = &t2h_anchor($id, '', $what);
                    }
                    }
                    elsif ($in_table && ($table_type eq 'f' || $table_type eq 'v'))
                    elsif ($in_table && ($table_type eq 'f' || $table_type eq 'v'))
                    {
                    {
                      EnterIndexEntry($table_type, $what, $docu_doc, $section, \@lines);
                      EnterIndexEntry($table_type, $what, $docu_doc, $section, \@lines);
                    }
                    }
                    &html_pop_if('P');
                    &html_pop_if('P');
                    if ($html_element eq 'DL' || $html_element eq 'DD') {
                    if ($html_element eq 'DL' || $html_element eq 'DD') {
                        if ($things_map{$in_table} && !$what) {
                        if ($things_map{$in_table} && !$what) {
                            # special case to allow @table @bullet for instance
                            # special case to allow @table @bullet for instance
                            push(@lines, &debug("
    $things_map{$in_table}\n", __LINE__));
                            push(@lines, &debug("
    $things_map{$in_table}\n", __LINE__));
                        } else {
                        } else {
                            push(@lines, &debug("
    \@$in_table\{$what\}\n", __LINE__));
                            push(@lines, &debug("
    \@$in_table\{$what\}\n", __LINE__));
                        }
                        }
                        push(@lines, "
    ");
                        push(@lines, "
    ");
                        &html_push('DD') unless $html_element eq 'DD';
                        &html_push('DD') unless $html_element eq 'DD';
                        if ($table_type) { # add also an index
                        if ($table_type) { # add also an index
                            unshift(@input_spool, "\@${table_type}index $what\n");
                            unshift(@input_spool, "\@${table_type}index $what\n");
                        }
                        }
                    } elsif ($html_element eq 'TABLE') {
                    } elsif ($html_element eq 'TABLE') {
                        push(@lines, &debug("
    $what
                        push(@lines, &debug("
    $what
                        &html_push('TR');
                        &html_push('TR');
                    } elsif ($html_element eq 'TR') {
                    } elsif ($html_element eq 'TR') {
                        push(@lines, &debug("
                        push(@lines, &debug("
                        push(@lines, &debug("
    $what
                        push(@lines, &debug("
    $what
                    } else {
                    } else {
                        push(@lines, &debug("
  • $what\n", __LINE__));
  •                     push(@lines, &debug("
  • $what\n", __LINE__));
  •                     &html_push('LI') unless $html_element eq 'LI';
                        &html_push('LI') unless $html_element eq 'LI';
                    }
                    }
                    push(@lines, &html_debug('', __LINE__));
                    push(@lines, &html_debug('', __LINE__));
                    if ($deferred_ref) {
                    if ($deferred_ref) {
                        push(@lines, &debug("$deferred_ref\n", __LINE__));
                        push(@lines, &debug("$deferred_ref\n", __LINE__));
                        $deferred_ref = '';
                        $deferred_ref = '';
                    }
                    }
                    next;
                    next;
                } elsif (/^\@tab\s+(.*)$/) {
                } elsif (/^\@tab\s+(.*)$/) {
                    push(@lines, "
    $1
                    push(@lines, "
    $1
                    next;
                    next;
                }
                }
            }
            }
        }
        }
        # paragraph separator
        # paragraph separator
        if ($_ eq "\n" && ! $in_pre) {
        if ($_ eq "\n" && ! $in_pre) {
            next if $#lines >= 0 && $lines[$#lines] eq "\n";
            next if $#lines >= 0 && $lines[$#lines] eq "\n";
            if ($html_element eq 'P') {
            if ($html_element eq 'P') {
                push (@lines, &debug("

    \n", __LINE__));

                push (@lines, &debug("

    \n", __LINE__));

            }
            }
    #       else
    #       else
    #       {
    #       {
    #         push(@lines, "

    \n");
    #         push(@lines, "

    \n");
    #         $_ = &debug("

    \n", __LINE__);
    #         $_ = &debug("

    \n", __LINE__);
    #       }
    #       }
            elsif ($html_element eq 'body' || $html_element eq 'BLOCKQUOTE' || $html_element eq 'DD' || $html_element eq 'LI')
            elsif ($html_element eq 'body' || $html_element eq 'BLOCKQUOTE' || $html_element eq 'DD' || $html_element eq 'LI')
            {
            {
              &html_push('P');
              &html_push('P');
              push(@lines, &debug("

    \n", __LINE__));

              push(@lines, &debug("

    \n", __LINE__));

            }
            }
          }
          }
        # otherwise
        # otherwise
        push(@lines, $_) unless $in_titlepage;
        push(@lines, $_) unless $in_titlepage;
        push(@lines, &debug("\n", __LINE__))  if ($tag eq 'center');
        push(@lines, &debug("\n", __LINE__))  if ($tag eq 'center');
    }
    }
    # finish TOC
    # finish TOC
    $level = 0;
    $level = 0;
    while ($level < $curlevel) {
    while ($level < $curlevel) {
        $curlevel--;
        $curlevel--;
        push(@toc_lines, "\n");
        push(@toc_lines, "\n");
    }
    }
    print "# end of pass 1\n" if $T2H_VERBOSE;
    print "# end of pass 1\n" if $T2H_VERBOSE;
    SetDocumentLanguage('en') unless ($T2H_LANG);
    SetDocumentLanguage('en') unless ($T2H_LANG);
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # Stuff related to Index generation                                            #
    # Stuff related to Index generation                                            #
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    sub EnterIndexEntry
    sub EnterIndexEntry
    {
    {
      my $prefix = shift;
      my $prefix = shift;
      my $key = shift;
      my $key = shift;
      my $docu_doc = shift;
      my $docu_doc = shift;
      my $section = shift;
      my $section = shift;
      my $lines = shift;
      my $lines = shift;
      local $_;
      local $_;
      warn "$ERROR Undefined index command: $_", next
      warn "$ERROR Undefined index command: $_", next
        unless (exists ($index_properties->{$prefix}));
        unless (exists ($index_properties->{$prefix}));
      $key =~ s/\s+$//;
      $key =~ s/\s+$//;
      $_ = $key;
      $_ = $key;
      &protect_texi;
      &protect_texi;
      $key = $_;
      $key = $_;
      $_ = &protect_html($_);
      $_ = &protect_html($_);
      my $html_key = substitute_style($_);
      my $html_key = substitute_style($_);
      my $id;
      my $id;
      $key = remove_style($key);
      $key = remove_style($key);
      $key = remove_things($key);
      $key = remove_things($key);
      $_ = $key;
      $_ = $key;
      &unprotect_texi;
      &unprotect_texi;
      $key = $_;
      $key = $_;
      while (exists $index->{$prefix}->{$key}) {$key .= ' '};
      while (exists $index->{$prefix}->{$key}) {$key .= ' '};
      if ($lines->[$#lines] =~ /^$/)
      if ($lines->[$#lines] =~ /^$/)
      {
      {
        $id = $1;
        $id = $1;
      }
      }
      else
      else
      {
      {
        $id = 'IDX' . ++$idx_num;
        $id = 'IDX' . ++$idx_num;
        push(@$lines, &t2h_anchor($id, '', $T2H_INVISIBLE_MARK, !$in_pre));
        push(@$lines, &t2h_anchor($id, '', $T2H_INVISIBLE_MARK, !$in_pre));
      }
      }
      $index->{$prefix}->{$key}->{html_key} = $html_key;
      $index->{$prefix}->{$key}->{html_key} = $html_key;
      $index->{$prefix}->{$key}->{section} = $section;
      $index->{$prefix}->{$key}->{section} = $section;
      $index->{$prefix}->{$key}->{href} = "$docu_doc#$id";
      $index->{$prefix}->{$key}->{href} = "$docu_doc#$id";
      print "# found ${prefix}index  for '$key' with id $id\n"
      print "# found ${prefix}index  for '$key' with id $id\n"
        if $T2H_DEBUG & $DEBUG_INDEX;
        if $T2H_DEBUG & $DEBUG_INDEX;
    }
    }
    sub IndexName2Prefix
    sub IndexName2Prefix
    {
    {
      my $name = shift;
      my $name = shift;
      my $prefix;
      my $prefix;
      for $prefix (keys %$index_properties)
      for $prefix (keys %$index_properties)
      {
      {
        return $prefix if ($index_properties->{$prefix}->{name} eq $name);
        return $prefix if ($index_properties->{$prefix}->{name} eq $name);
      }
      }
      return undef;
      return undef;
    }
    }
    sub GetIndexEntries
    sub GetIndexEntries
    {
    {
      my $normal = shift;
      my $normal = shift;
      my $code = shift;
      my $code = shift;
      my ($entries, $prefix, $key) = ({});
      my ($entries, $prefix, $key) = ({});
      for $prefix (keys %$normal)
      for $prefix (keys %$normal)
      {
      {
        for $key (keys %{$index->{$prefix}})
        for $key (keys %{$index->{$prefix}})
        {
        {
          $entries->{$key} = {%{$index->{$prefix}->{$key}}};
          $entries->{$key} = {%{$index->{$prefix}->{$key}}};
        }
        }
      }
      }
      if (defined($code))
      if (defined($code))
      {
      {
        for $prefix (keys %$code)
        for $prefix (keys %$code)
        {
        {
          unless (exists $normal->{$keys})
          unless (exists $normal->{$keys})
          {
          {
            for $key (keys %{$index->{$prefix}})
            for $key (keys %{$index->{$prefix}})
            {
            {
              $entries->{$key} = {%{$index->{$prefix}->{$key}}};
              $entries->{$key} = {%{$index->{$prefix}->{$key}}};
              $entries->{$key}->{html_key} = "$entries->{$key}->{html_key}";
              $entries->{$key}->{html_key} = "$entries->{$key}->{html_key}";
            }
            }
          }
          }
        }
        }
      }
      }
      return $entries;
      return $entries;
    }
    }
    sub byAlpha
    sub byAlpha
    {
    {
      if ($a =~ /^[A-Za-z]/)
      if ($a =~ /^[A-Za-z]/)
      {
      {
        if ($b =~ /^[A-Za-z]/)
        if ($b =~ /^[A-Za-z]/)
        {
        {
          return lc($a) cmp lc($b);
          return lc($a) cmp lc($b);
        }
        }
        else
        else
        {
        {
          return 1;
          return 1;
        }
        }
      }
      }
      elsif ($b =~ /^[A-Za-z]/)
      elsif ($b =~ /^[A-Za-z]/)
      {
      {
        return -1;
        return -1;
      }
      }
      else
      else
      {
      {
        return lc($a) cmp lc($b);
        return lc($a) cmp lc($b);
      }
      }
    }
    }
    sub GetIndexPages
    sub GetIndexPages
    {
    {
      my $entries = shift;
      my $entries = shift;
      my (@Letters, $key);
      my (@Letters, $key);
      my ($EntriesByLetter, $Pages, $page) = ({}, [], {});
      my ($EntriesByLetter, $Pages, $page) = ({}, [], {});
      my @keys = sort byAlpha keys %$entries;
      my @keys = sort byAlpha keys %$entries;
      for $key (@keys)
      for $key (@keys)
      {
      {
        push @{$EntriesByLetter->{uc(substr($key,0, 1))}} , $entries->{$key};
        push @{$EntriesByLetter->{uc(substr($key,0, 1))}} , $entries->{$key};
      }
      }
      @Letters = sort byAlpha keys %$EntriesByLetter;
      @Letters = sort byAlpha keys %$EntriesByLetter;
      $T2H_SPLIT_INDEX = 0 unless ($T2H_SPLIT);
      $T2H_SPLIT_INDEX = 0 unless ($T2H_SPLIT);
      unless ($T2H_SPLIT_INDEX)
      unless ($T2H_SPLIT_INDEX)
      {
      {
        $page->{First} = $Letters[0];
        $page->{First} = $Letters[0];
        $page->{Last} = $Letters[$#Letters];
        $page->{Last} = $Letters[$#Letters];
        $page->{Letters} = \@Letters;
        $page->{Letters} = \@Letters;
        $page->{EntriesByLetter} = $EntriesByLetter;
        $page->{EntriesByLetter} = $EntriesByLetter;
        push @$Pages, $page;
        push @$Pages, $page;
        return $Pages;
        return $Pages;
      }
      }
      if ($T2H_SPLIT_INDEX =~ /^\d+$/)
      if ($T2H_SPLIT_INDEX =~ /^\d+$/)
      {
      {
        my $i = 0;
        my $i = 0;
        my ($prev_letter, $letter);
        my ($prev_letter, $letter);
        $page->{First} = $Letters[0];
        $page->{First} = $Letters[0];
        for $letter (@Letters)
        for $letter (@Letters)
        {
        {
          if ($i > $T2H_SPLIT_INDEX)
          if ($i > $T2H_SPLIT_INDEX)
          {
          {
            $page->{Last} = $prev_letter;
            $page->{Last} = $prev_letter;
            push @$Pages, {%$page};
            push @$Pages, {%$page};
            $page->{Letters} = [];
            $page->{Letters} = [];
            $page->{EntriesByLetter} = {};
            $page->{EntriesByLetter} = {};
            $page->{First} = $letter;
            $page->{First} = $letter;
            $i=0;
            $i=0;
          }
          }
          push @{$page->{Letters}}, $letter;
          push @{$page->{Letters}}, $letter;
          $page->{EntriesByLetter}->{$letter} = [@{$EntriesByLetter->{$letter}}];
          $page->{EntriesByLetter}->{$letter} = [@{$EntriesByLetter->{$letter}}];
          $i += scalar(@{$EntriesByLetter->{$letter}});
          $i += scalar(@{$EntriesByLetter->{$letter}});
          $prev_letter = $letter;
          $prev_letter = $letter;
        }
        }
        $page->{Last} = $Letters[$#Letters];
        $page->{Last} = $Letters[$#Letters];
        push @$Pages, {%$page};
        push @$Pages, {%$page};
      }
      }
      return $Pages;
      return $Pages;
    }
    }
    sub GetIndexSummary
    sub GetIndexSummary
    {
    {
      my $first_page = shift;
      my $first_page = shift;
      my $Pages = shift;
      my $Pages = shift;
      my $name = shift;
      my $name = shift;
      my ($page, $letter, $summary, $i, $l1, $l2, $l);
      my ($page, $letter, $summary, $i, $l1, $l2, $l);
      $i = 0;
      $i = 0;
      $summary = '
    Jump to:   ';
      $summary = '
    Jump to:   ';
      for $page ($first_page, @$Pages)
      for $page ($first_page, @$Pages)
      {
      {
        for $letter (@{$page->{Letters}})
        for $letter (@{$page->{Letters}})
        {
        {
          $l = t2h_anchor('', "$page->{href}#${name}_$letter", "$letter",
          $l = t2h_anchor('', "$page->{href}#${name}_$letter", "$letter",
                          0, 'style="text-decoration:none"') . "\n   \n";
                          0, 'style="text-decoration:none"') . "\n   \n";
          if ($letter =~ /^[A-Za-z]/)
          if ($letter =~ /^[A-Za-z]/)
          {
          {
            $l2 .= $l;
            $l2 .= $l;
          }
          }
          else
          else
          {
          {
            $l1 .= $l;
            $l1 .= $l;
          }
          }
        }
        }
      }
      }
      $summary .= $l1 . "
    \n" if ($l1);
      $summary .= $l1 . "
    \n" if ($l1);
      $summary .= $l2 . '

    ';
      $summary .= $l2 . '

    ';
      return $summary;
      return $summary;
    }
    }
    sub PrintIndexPage
    sub PrintIndexPage
    {
    {
      my $lines = shift;
      my $lines = shift;
      my $summary = shift;
      my $summary = shift;
      my $page = shift;
      my $page = shift;
      my $name = shift;
      my $name = shift;
      push @$lines, $summary;
      push @$lines, $summary;
      push @$lines , <
      push @$lines , <

    \n";\n";\n";\n";\n";\n";
    Index Entry Section
    Index Entry Section


    EOT
    EOT
      for $letter (@{$page->{Letters}})
      for $letter (@{$page->{Letters}})
      {
      {
        push @$lines, "
    $letter
        push @$lines, "
    $letter
        for $entry (@{$page->{EntriesByLetter}->{$letter}})
        for $entry (@{$page->{EntriesByLetter}->{$letter}})
        {
        {
          push @$lines,
          push @$lines,
          "
    " .
          "
    " .
            t2h_anchor('', $entry->{href}, $entry->{html_key}) .
            t2h_anchor('', $entry->{href}, $entry->{html_key}) .
              "
    " .
              "
    " .
                t2h_anchor('', sec_href($entry->{section}), clean_name($entry->{section})) .
                t2h_anchor('', sec_href($entry->{section}), clean_name($entry->{section})) .
                  "
                  "
        }
        }
        push @$lines, "

        push @$lines, "

      }
      }
      push @$lines, "

    ";
      push @$lines, "

    ";
      push @$lines, $summary;
      push @$lines, $summary;
    }
    }
    sub PrintIndex
    sub PrintIndex
    {
    {
      my $lines = shift;
      my $lines = shift;
      my $name = shift;
      my $name = shift;
      my $section = shift;
      my $section = shift;
      $section = 'Top' unless $section;
      $section = 'Top' unless $section;
      my $prefix = IndexName2Prefix($name);
      my $prefix = IndexName2Prefix($name);
      warn ("$ERROR printindex: bad index name: $name"), return
      warn ("$ERROR printindex: bad index name: $name"), return
        unless $prefix;
        unless $prefix;
      if ($index_properties->{$prefix}->{code})
      if ($index_properties->{$prefix}->{code})
      {
      {
        $index_properties->{$prefix}->{from_code}->{$prefix} = 1;
        $index_properties->{$prefix}->{from_code}->{$prefix} = 1;
      }
      }
      else
      else
      {
      {
        $index_properties->{$prefix}->{from}->{$prefix}= 1;
        $index_properties->{$prefix}->{from}->{$prefix}= 1;
      }
      }
      my $Entries = GetIndexEntries($index_properties->{$prefix}->{from},
      my $Entries = GetIndexEntries($index_properties->{$prefix}->{from},
                                    $index_properties->{$prefix}->{from_code});
                                    $index_properties->{$prefix}->{from_code});
      return unless %$Entries;
      return unless %$Entries;
      if ($T2H_IDX_SUMMARY)
      if ($T2H_IDX_SUMMARY)
      {
      {
        my $key;
        my $key;
        open(FHIDX, ">$docu_rdir$docu_name" . "_$name.idx")
        open(FHIDX, ">$docu_rdir$docu_name" . "_$name.idx")
          || die "Can't open > $docu_rdir$docu_name" . "_$name.idx for writing: $!\n";
          || die "Can't open > $docu_rdir$docu_name" . "_$name.idx for writing: $!\n";
        print "# writing $name index summary in $docu_rdir$docu_name" . "_$name.idx...\n" if $T2H_VERBOSE;
        print "# writing $name index summary in $docu_rdir$docu_name" . "_$name.idx...\n" if $T2H_VERBOSE;
        for $key (sort keys %$Entries)
        for $key (sort keys %$Entries)
        {
        {
          print FHIDX "$key\t$Entries->{$key}->{href}\n";
          print FHIDX "$key\t$Entries->{$key}->{href}\n";
        }
        }
      }
      }
      my $Pages = GetIndexPages($Entries);
      my $Pages = GetIndexPages($Entries);
      my $page;
      my $page;
      my $first_page = shift @$Pages;
      my $first_page = shift @$Pages;
      my $sec_name = $section;
      my $sec_name = $section;
      # remove section number
      # remove section number
      $sec_name =~ s/.*? // if $sec_name =~ /^([A-Z]|\d+)\./;
      $sec_name =~ s/.*? // if $sec_name =~ /^([A-Z]|\d+)\./;
      ($first_page->{href} = sec_href($section)) =~ s/\#.*$//;
      ($first_page->{href} = sec_href($section)) =~ s/\#.*$//;
      # Update tree structure of document
      # Update tree structure of document
      if (@$Pages)
      if (@$Pages)
      {
      {
        my $sec;
        my $sec;
        my @after;
        my @after;
        while (@sections && $sections[$#sections] ne $section)
        while (@sections && $sections[$#sections] ne $section)
        {
        {
          unshift @after, pop @sections;
          unshift @after, pop @sections;
        }
        }
        for $page (@$Pages)
        for $page (@$Pages)
        {
        {
          my $node = ($page->{First} ne $page->{Last} ?
          my $node = ($page->{First} ne $page->{Last} ?
                      "$sec_name: $page->{First} -- $page->{Last}" :
                      "$sec_name: $page->{First} -- $page->{Last}" :
                      "$sec_name: $page->{First}");
                      "$sec_name: $page->{First}");
          push @sections, $node;
          push @sections, $node;
          $node2sec{$node} = $node;
          $node2sec{$node} = $node;
          $sec2node{$node} = $node;
          $sec2node{$node} = $node;
          $node2up{$node} = $section;
          $node2up{$node} = $section;
          $page->{href} = next_doc();
          $page->{href} = next_doc();
          $page->{name} = $node;
          $page->{name} = $node;
          $node2href{$node} = $page->{href};
          $node2href{$node} = $page->{href};
          if ($prev_node)
          if ($prev_node)
          {
          {
            $node2next{$prev_node} = $node;
            $node2next{$prev_node} = $node;
            $node2prev{$node} = $prev_node;
            $node2prev{$node} = $prev_node;
          }
          }
          $prev_node = $node;
          $prev_node = $node;
        }
        }
        push @sections, @after;
        push @sections, @after;
      }
      }
      my $summary = GetIndexSummary($first_page, $Pages, $name);
      my $summary = GetIndexSummary($first_page, $Pages, $name);
      PrintIndexPage($lines, $summary, $first_page, $name);
      PrintIndexPage($lines, $summary, $first_page, $name);
      for $page (@$Pages)
      for $page (@$Pages)
      {
      {
        push @$lines, ($T2H_SPLIT eq 'chapter' ? $CHAPTEREND : $SECTIONEND);
        push @$lines, ($T2H_SPLIT eq 'chapter' ? $CHAPTEREND : $SECTIONEND);
        push @$lines, "

    $page->{name}

    \n";
        push @$lines, "

    $page->{name}

    \n";
        PrintIndexPage($lines, $summary, $page, $name);
        PrintIndexPage($lines, $summary, $page, $name);
      }
      }
    }
    }
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # Pass 2/3: handle style, menu, index, cross-reference                         #
    # Pass 2/3: handle style, menu, index, cross-reference                         #
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    @lines2 = ();                           # whole document (2nd pass)
    @lines2 = ();                           # whole document (2nd pass)
    @lines3 = ();                           # whole document (3rd pass)
    @lines3 = ();                           # whole document (3rd pass)
    $in_menu = 0;                           # am I inside a menu
    $in_menu = 0;                           # am I inside a menu
    while (@lines) {
    while (@lines) {
        $_ = shift(@lines);
        $_ = shift(@lines);
        #
        #
        # special case (protected sections)
        # special case (protected sections)
        #
        #
        if (/^$PROTECTTAG/o) {
        if (/^$PROTECTTAG/o) {
            push(@lines2, $_);
            push(@lines2, $_);
            next;
            next;
        }
        }
        #
        #
        # menu
        # menu
        #
        #
        if (/^\@menu\b/)
        if (/^\@menu\b/)
        {
        {
          $in_menu = 1;
          $in_menu = 1;
          $in_menu_listing = 1;
          $in_menu_listing = 1;
          push(@lines2, &debug("
    \n", __LINE__));
          push(@lines2, &debug("
    \n", __LINE__));
          next;
          next;
        }
        }
        if (/^\@end\s+menu\b/)
        if (/^\@end\s+menu\b/)
        {
        {
          if ($in_menu_listing)
          if ($in_menu_listing)
          {
          {
            push(@lines2, &debug("
    \n", __LINE__));
            push(@lines2, &debug("
    \n", __LINE__));
          }
          }
          else
          else
          {
          {
            push(@lines2, &debug("\n", __LINE__));
            push(@lines2, &debug("\n", __LINE__));
          }
          }
          $in_menu = 0;
          $in_menu = 0;
          $in_menu_listing = 0;
          $in_menu_listing = 0;
          next;
          next;
        }
        }
        if ($in_menu)
        if ($in_menu)
        {
        {
          my ($node, $name, $descr);
          my ($node, $name, $descr);
          if (/^\*\s+($NODERE)::/o)
          if (/^\*\s+($NODERE)::/o)
          {
          {
            $node = $1;
            $node = $1;
            $descr = $';
            $descr = $';
          }
          }
          elsif (/^\*\s+(.+):\s+([^\t,\.\n]+)[\t,\.\n]/)
          elsif (/^\*\s+(.+):\s+([^\t,\.\n]+)[\t,\.\n]/)
          {
          {
            $name = $1;
            $name = $1;
            $node = $2;
            $node = $2;
            $descr = $';
            $descr = $';
          }
          }
          elsif (/^\*/)
          elsif (/^\*/)
          {
          {
            warn "$ERROR Bad menu line: $_";
            warn "$ERROR Bad menu line: $_";
          }
          }
          else
          else
          {
          {
            if ($in_menu_listing)
            if ($in_menu_listing)
            {
            {
              $in_menu_listing = 0;
              $in_menu_listing = 0;
              push(@lines2, &debug("
    \n", __LINE__));
              push(@lines2, &debug("\n", __LINE__));
            }
            }
            # should be like verbatim -- preseve spaces, etc
            # should be like verbatim -- preseve spaces, etc
            s/ /\ /g;
            s/ /\ /g;
            $_ .= "
    \n";
            $_ .= "
    \n";
            push(@lines2, $_);
            push(@lines2, $_);
          }
          }
          if ($node)
          if ($node)
          {
          {
            if (! $in_menu_listing)
            if (! $in_menu_listing)
            {
            {
              $in_menu_listing = 1;
              $in_menu_listing = 1;
              push(@lines2, &debug("\n", __LINE__));
              push(@lines2, &debug("\n", __LINE__));\n", __LINE__));\n", __LINE__));\n", __LINE__))\n", __LINE__))
            }
            }
            # look for continuation
            # look for continuation
            while ($lines[0] =~ /^\s+\w+/)
            while ($lines[0] =~ /^\s+\w+/)
            {
            {
              $descr .= shift(@lines);
              $descr .= shift(@lines);
            }
            }
            &menu_entry($node, $name, $descr);
            &menu_entry($node, $name, $descr);
          }
          }
          next;
          next;
        }
        }
        #
        #
        # printindex
        # printindex
        #
        #
        PrintIndex(\@lines2, $2, $1), next
        PrintIndex(\@lines2, $2, $1), next
          if (/^\@printindex\s+(\w+)/);
          if (/^\@printindex\s+(\w+)/);
        #
        #
        # simple style substitutions
        # simple style substitutions
        #
        #
        $_ = &substitute_style($_);
        $_ = &substitute_style($_);
        #
        #
        # xref
        # xref
        #
        #
        while (/\@(x|px|info|)ref{([^{}]+)(}?)/) {
        while (/\@(x|px|info|)ref{([^{}]+)(}?)/) {
            # note: Texinfo may accept other characters
            # note: Texinfo may accept other characters
            ($type, $nodes, $full) = ($1, $2, $3);
            ($type, $nodes, $full) = ($1, $2, $3);
            ($before, $after) = ($`, $');
            ($before, $after) = ($`, $');
            if (! $full && $after) {
            if (! $full && $after) {
                warn "$ERROR Bad xref (no ending } on line): $_";
                warn "$ERROR Bad xref (no ending } on line): $_";
                $_ = "$before$;0${type}ref\{$nodes$after";
                $_ = "$before$;0${type}ref\{$nodes$after";
                next; # while xref
                next; # while xref
            }
            }
            if ($type eq 'x') {
            if ($type eq 'x') {
                $type = "$T2H_WORDS->{$T2H_LANG}->{'See'} ";
                $type = "$T2H_WORDS->{$T2H_LANG}->{'See'} ";
            } elsif ($type eq 'px') {
            } elsif ($type eq 'px') {
                $type = "$T2H_WORDS->{$T2H_LANG}->{'see'} ";
                $type = "$T2H_WORDS->{$T2H_LANG}->{'see'} ";
            } elsif ($type eq 'info') {
            } elsif ($type eq 'info') {
                $type = "$T2H_WORDS->{$T2H_LANG}->{'See'} Info";
                $type = "$T2H_WORDS->{$T2H_LANG}->{'See'} Info";
            } else {
            } else {
                $type = '';
                $type = '';
            }
            }
            unless ($full) {
            unless ($full) {
                $next = shift(@lines);
                $next = shift(@lines);
                $next = &substitute_style($next);
                $next = &substitute_style($next);
                chop($nodes); # remove final newline
                chop($nodes); # remove final newline
                if ($next =~ /\}/) { # split on 2 lines
                if ($next =~ /\}/) { # split on 2 lines
                    $nodes .= " $`";
                    $nodes .= " $`";
                    $after = $';
                    $after = $';
                } else {
                } else {
                    $nodes .= " $next";
                    $nodes .= " $next";
                    $next = shift(@lines);
                    $next = shift(@lines);
                    $next = &substitute_style($next);
                    $next = &substitute_style($next);
                    chop($nodes);
                    chop($nodes);
                    if ($next =~ /\}/) { # split on 3 lines
                    if ($next =~ /\}/) { # split on 3 lines
                        $nodes .= " $`";
                        $nodes .= " $`";
                        $after = $';
                        $after = $';
                    } else {
                    } else {
                        warn "$ERROR Bad xref (no ending }): $_";
                        warn "$ERROR Bad xref (no ending }): $_";
                        $_ = "$before$;0xref\{$nodes$after";
                        $_ = "$before$;0xref\{$nodes$after";
                        unshift(@lines, $next);
                        unshift(@lines, $next);
                        next; # while xref
                        next; # while xref
                    }
                    }
                }
                }
            }
            }
            $nodes =~ s/\s+/ /g; # remove useless spaces
            $nodes =~ s/\s+/ /g; # remove useless spaces
            @args = split(/\s*,\s*/, $nodes);
            @args = split(/\s*,\s*/, $nodes);
            $node = $args[0]; # the node is always the first arg
            $node = $args[0]; # the node is always the first arg
            $node = &normalise_node($node);
            $node = &normalise_node($node);
            $sec = $args[2] || $args[1] || $node2sec{$node};
            $sec = $args[2] || $args[1] || $node2sec{$node};
            $href = $node2href{$node};
            $href = $node2href{$node};
            if (@args == 5) { # reference to another manual
            if (@args == 5) { # reference to another manual
                $sec = $args[2] || $node;
                $sec = $args[2] || $node;
                $man = $args[4] || $args[3];
                $man = $args[4] || $args[3];
                $_ = "${before}${type}$T2H_WORDS->{$T2H_LANG}->{'section'} `$sec' in \@cite{$man}$after";
                $_ = "${before}${type}$T2H_WORDS->{$T2H_LANG}->{'section'} `$sec' in \@cite{$man}$after";
            } elsif ($type =~ /Info/) { # inforef
            } elsif ($type =~ /Info/) { # inforef
                warn "$ERROR Wrong number of arguments: $_" unless @args == 3;
                warn "$ERROR Wrong number of arguments: $_" unless @args == 3;
                ($nn, $_, $in) = @args;
                ($nn, $_, $in) = @args;
                $_ = "${before}${type} file `$in', node `$nn'$after";
                $_ = "${before}${type} file `$in', node `$nn'$after";
            } elsif ($sec && $href && ! $T2H_SHORT_REF) {
            } elsif ($sec && $href && ! $T2H_SHORT_REF) {
                $_  = "${before}${type}";
                $_  = "${before}${type}";
                $_ .= "$T2H_WORDS->{$T2H_LANG}->{'section'} " if ${type};
                $_ .= "$T2H_WORDS->{$T2H_LANG}->{'section'} " if ${type};
                $_ .= &t2h_anchor('', $href, $sec) . $after;
                $_ .= &t2h_anchor('', $href, $sec) . $after;
            }
            }
            elsif ($href)
            elsif ($href)
            {
            {
              $_ = "${before}${type} " .
              $_ = "${before}${type} " .
                &t2h_anchor('', $href, $args[2] || $args[1] || $node) .
                &t2h_anchor('', $href, $args[2] || $args[1] || $node) .
                  $after;
                  $after;
            }
            }
            else {
            else {
                warn "$ERROR Undefined node ($node): $_";
                warn "$ERROR Undefined node ($node): $_";
                $_ = "$before$;0xref{$nodes}$after";
                $_ = "$before$;0xref{$nodes}$after";
            }
            }
        }
        }
        # replace images
        # replace images
        s[\@image\s*{(.+?)}]
        s[\@image\s*{(.+?)}]
        {
        {
         my @args = split (/\s*,\s*/, $1);
         my @args = split (/\s*,\s*/, $1);
         my $base = $args[0];
         my $base = $args[0];
         my $image =
         my $image =
           LocateIncludeFile("$base.png") ||
           LocateIncludeFile("$base.png") ||
           LocateIncludeFile("$base.jpg") ||
           LocateIncludeFile("$base.jpg") ||
           LocateIncludeFile("$base.gif");
           LocateIncludeFile("$base.gif");
         warn "$ERROR no image file for $base: $_" unless ($image && -e $image);
         warn "$ERROR no image file for $base: $_" unless ($image && -e $image);
         "\"$base\"";
         "\"$base\"";
         ($T2H_CENTER_IMAGE ?
         ($T2H_CENTER_IMAGE ?
          "
    \"$base\"
    " :
          "
    \"$base\"
    " :
          "\"$base\"");
          "\"$base\"");
        }eg;
        }eg;
        #
        #
        # try to guess bibliography references or glossary terms
        # try to guess bibliography references or glossary terms
        #
        #
        unless (/^
        unless (/^
            if ($use_bibliography) {
            if ($use_bibliography) {
                $done = '';
                $done = '';
                while (/$BIBRE/o) {
                while (/$BIBRE/o) {
                    ($pre, $what, $post) = ($`, $&, $');
                    ($pre, $what, $post) = ($`, $&, $');
                    $href = $bib2href{$what};
                    $href = $bib2href{$what};
                    if (defined($href) && $post !~ /^[^<]*<\/A>/) {
                    if (defined($href) && $post !~ /^[^<]*<\/A>/) {
                        $done .= $pre . &t2h_anchor('', $href, $what);
                        $done .= $pre . &t2h_anchor('', $href, $what);
                    } else {
                    } else {
                        $done .= "$pre$what";
                        $done .= "$pre$what";
                    }
                    }
                    $_ = $post;
                    $_ = $post;
                }
                }
                $_ = $done . $_;
                $_ = $done . $_;
            }
            }
            if ($T2H_USE_GLOSSARY) {
            if ($T2H_USE_GLOSSARY) {
                $done = '';
                $done = '';
                while (/\b\w+\b/) {
                while (/\b\w+\b/) {
                    ($pre, $what, $post) = ($`, $&, $');
                    ($pre, $what, $post) = ($`, $&, $');
                    $entry = $what;
                    $entry = $what;
                    $entry =~ tr/A-Z/a-z/ unless $entry =~ /^[A-Z\s]+$/;
                    $entry =~ tr/A-Z/a-z/ unless $entry =~ /^[A-Z\s]+$/;
                    $href = $gloss2href{$entry};
                    $href = $gloss2href{$entry};
                    if (defined($href) && $post !~ /^[^<]*<\/A>/) {
                    if (defined($href) && $post !~ /^[^<]*<\/A>/) {
                        $done .= $pre . &t2h_anchor('', $href, $what);
                        $done .= $pre . &t2h_anchor('', $href, $what);
                    } else {
                    } else {
                        $done .= "$pre$what";
                        $done .= "$pre$what";
                    }
                    }
                    $_ = $post;
                    $_ = $post;
                }
                }
                $_ = $done . $_;
                $_ = $done . $_;
            }
            }
        }
        }
        # otherwise
        # otherwise
        push(@lines2, $_);
        push(@lines2, $_);
    }
    }
    print "# end of pass 2\n" if $T2H_VERBOSE;
    print "# end of pass 2\n" if $T2H_VERBOSE;
    #
    #
    # split style substitutions
    # split style substitutions
    #
    #
    while (@lines2) {
    while (@lines2) {
        $_ = shift(@lines2);
        $_ = shift(@lines2);
        #
        #
        # special case (protected sections)
        # special case (protected sections)
        #
        #
        if (/^$PROTECTTAG/o) {
        if (/^$PROTECTTAG/o) {
            push(@lines3, $_);
            push(@lines3, $_);
            next;
            next;
        }
        }
        #
        #
        # split style substitutions
        # split style substitutions
        #
        #
        $old = '';
        $old = '';
        while ($old ne $_) {
        while ($old ne $_) {
            $old = $_;
            $old = $_;
            if (/\@(\w+)\{/) {
            if (/\@(\w+)\{/) {
                ($before, $style, $after) = ($`, $1, $');
                ($before, $style, $after) = ($`, $1, $');
                if (defined($style_map{$style})) {
                if (defined($style_map{$style})) {
                    $_ = $after;
                    $_ = $after;
                    $text = '';
                    $text = '';
                    $after = '';
                    $after = '';
                    $failed = 1;
                    $failed = 1;
                    while (@lines2) {
                    while (@lines2) {
                        if (/\}/) {
                        if (/\}/) {
                            $text .= $`;
                            $text .= $`;
                            $after = $';
                            $after = $';
                            $failed = 0;
                            $failed = 0;
                            last;
                            last;
                        } else {
                        } else {
                            $text .= $_;
                            $text .= $_;
                            $_ = shift(@lines2);
                            $_ = shift(@lines2);
                        }
                        }
                    }
                    }
                    if ($failed) {
                    if ($failed) {
                        die "* Bad syntax (\@$style) after: $before\n";
                        die "* Bad syntax (\@$style) after: $before\n";
                    } else {
                    } else {
                        $text = &apply_style($style, $text);
                        $text = &apply_style($style, $text);
                        $_ = "$before$text$after";
                        $_ = "$before$text$after";
                    }
                    }
                }
                }
            }
            }
        }
        }
        # otherwise
        # otherwise
        push(@lines3, $_);
        push(@lines3, $_);
    }
    }
    print "# end of pass 3\n" if $T2H_VERBOSE;
    print "# end of pass 3\n" if $T2H_VERBOSE;
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # Pass 4: foot notes, final cleanup                                            #
    # Pass 4: foot notes, final cleanup                                            #
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    @foot_lines = ();                       # footnotes
    @foot_lines = ();                       # footnotes
    @doc_lines = ();                        # final document
    @doc_lines = ();                        # final document
    $end_of_para = 0;                       # true if last line is 

    $end_of_para = 0;                       # true if last line is 

    while (@lines3) {
    while (@lines3) {
        $_ = shift(@lines3);
        $_ = shift(@lines3);
        #
        #
        # special case (protected sections)
        # special case (protected sections)
        #
        #
        if (/^$PROTECTTAG/o) {
        if (/^$PROTECTTAG/o) {
            push(@doc_lines, $_);
            push(@doc_lines, $_);
            $end_of_para = 0;
            $end_of_para = 0;
            next;
            next;
        }
        }
        #
        #
        # footnotes
        # footnotes
        #
        #
        while (/\@footnote([^\{\s]+)\{/) {
        while (/\@footnote([^\{\s]+)\{/) {
            ($before, $d, $after) = ($`, $1, $');
            ($before, $d, $after) = ($`, $1, $');
            $_ = $after;
            $_ = $after;
            $text = '';
            $text = '';
            $after = '';
            $after = '';
            $failed = 1;
            $failed = 1;
            while (@lines3) {
            while (@lines3) {
                if (/\}/) {
                if (/\}/) {
                    $text .= $`;
                    $text .= $`;
                    $after = $';
                    $after = $';
                    $failed = 0;
                    $failed = 0;
                    last;
                    last;
                } else {
                } else {
                    $text .= $_;
                    $text .= $_;
                    $_ = shift(@lines3);
                    $_ = shift(@lines3);
                }
                }
            }
            }
            if ($failed) {
            if ($failed) {
                die "* Bad syntax (\@footnote) after: $before\n";
                die "* Bad syntax (\@footnote) after: $before\n";
            } else {
            } else {
                $foot_num++;
                $foot_num++;
                $docid  = "DOCF$foot_num";
                $docid  = "DOCF$foot_num";
                $footid = "FOOT$foot_num";
                $footid = "FOOT$foot_num";
                $foot = "($foot_num)";
                $foot = "($foot_num)";
                push(@foot_lines, "

    " . &t2h_anchor($footid, "$d#$docid", $foot) . "

    \n");
                push(@foot_lines, "

    " . &t2h_anchor($footid, "$d#$docid", $foot) . "

    \n");
                $text = "

    $text" unless $text =~ /^\s*

    /;

                $text = "

    $text" unless $text =~ /^\s*

    /;

                push(@foot_lines, "$text\n");
                push(@foot_lines, "$text\n");
                $_ = $before . &t2h_anchor($docid, "$docu_foot#$footid", $foot) . $after;
                $_ = $before . &t2h_anchor($docid, "$docu_foot#$footid", $foot) . $after;
            }
            }
        }
        }
        #
        #
        # remove unnecessary 

        # remove unnecessary 

        #
        #
        if (/^\s*

    \s*$/) {

        if (/^\s*

    \s*$/) {

            next if $end_of_para++;
            next if $end_of_para++;
        } else {
        } else {
            $end_of_para = 0;
            $end_of_para = 0;
        }
        }
        # otherwise
        # otherwise
        push(@doc_lines, $_);
        push(@doc_lines, $_);
    }
    }
    print "# end of pass 4\n" if $T2H_VERBOSE;
    print "# end of pass 4\n" if $T2H_VERBOSE;
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # Pass 5: print things                                                         #
    # Pass 5: print things                                                         #
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    $T2H_L2H = &l2h_FinishToLatex if ($T2H_L2H);
    $T2H_L2H = &l2h_FinishToLatex if ($T2H_L2H);
    $T2H_L2H = &l2h_ToHtml        if ($T2H_L2H);
    $T2H_L2H = &l2h_ToHtml        if ($T2H_L2H);
    $T2H_L2H = &l2h_InitFromHtml  if ($T2H_L2H);
    $T2H_L2H = &l2h_InitFromHtml  if ($T2H_L2H);
    # fix node2up, node2prev, node2next, if desired
    # fix node2up, node2prev, node2next, if desired
    if ($has_top_command)
    if ($has_top_command)
    {
    {
      for $section (keys %sec2number)
      for $section (keys %sec2number)
      {
      {
        $node = $sec2node{$section};
        $node = $sec2node{$section};
        $node2up{$node} = Sec2UpNode($section) unless $node2up{$node};
        $node2up{$node} = Sec2UpNode($section) unless $node2up{$node};
        $node2prev{$node} = Sec2PrevNode($section) unless $node2prev{$node};
        $node2prev{$node} = Sec2PrevNode($section) unless $node2prev{$node};
        $node2next{$node} = Sec2NextNode($section) unless $node2next{$node};
        $node2next{$node} = Sec2NextNode($section) unless $node2next{$node};
      }
      }
    }
    }
    # prepare %T2H_THISDOC
    # prepare %T2H_THISDOC
    $T2H_THISDOC{fulltitle} = $value{'_title'} || $value{'_settitle'} || "Untitled Document";
    $T2H_THISDOC{fulltitle} = $value{'_title'} || $value{'_settitle'} || "Untitled Document";
    $T2H_THISDOC{title} = $value{'_settitle'} || $T2H_THISDOC{fulltitle};
    $T2H_THISDOC{title} = $value{'_settitle'} || $T2H_THISDOC{fulltitle};
    $T2H_THISDOC{author} = $value{'_author'};
    $T2H_THISDOC{author} = $value{'_author'};
    $T2H_THISDOC{subtitle} = $value{'_subtitle'};
    $T2H_THISDOC{subtitle} = $value{'_subtitle'};
    $T2H_THISDOC{shorttitle} = $value{'_shorttitle'};
    $T2H_THISDOC{shorttitle} = $value{'_shorttitle'};
    for $key (keys %T2H_THISDOC)
    for $key (keys %T2H_THISDOC)
    {
    {
      $_ = &substitute_style($T2H_THISDOC{$key});
      $_ = &substitute_style($T2H_THISDOC{$key});
      &unprotect_texi;
      &unprotect_texi;
      s/\s*$//;
      s/\s*$//;
      $T2H_THISDOC{$key} = $_;
      $T2H_THISDOC{$key} = $_;
    }
    }
    # if no sections, then simply print document as is
    # if no sections, then simply print document as is
    unless (@sections)
    unless (@sections)
    {
    {
      print "# Writing content into $docu_top_file \n" if $T2H_VERBOSE;
      print "# Writing content into $docu_top_file \n" if $T2H_VERBOSE;
      open(FILE, "> $docu_top_file")
      open(FILE, "> $docu_top_file")
        || die "$ERROR: Can't open $docu_top_file for writing: $!\n";
        || die "$ERROR: Can't open $docu_top_file for writing: $!\n";
      &$T2H_print_page_head(\*FILE);
      &$T2H_print_page_head(\*FILE);
      $T2H_THIS_SECTION = \@doc_lines;
      $T2H_THIS_SECTION = \@doc_lines;
      t2h_print_lines(\*FILE);
      t2h_print_lines(\*FILE);
      &$T2H_print_foot_navigation(\*FILE);
      &$T2H_print_foot_navigation(\*FILE);
      &$T2H_print_page_foot(\*FILE);
      &$T2H_print_page_foot(\*FILE);
      close(FILE);
      close(FILE);
      goto Finish;
      goto Finish;
    }
    }
    # initialize $T2H_HREF, $T2H_NAME
    # initialize $T2H_HREF, $T2H_NAME
    %T2H_HREF =
    %T2H_HREF =
      (
      (
       'First' ,   sec_href($sections[0]),
       'First' ,   sec_href($sections[0]),
       'Last',     sec_href($sections[$#sections]),
       'Last',     sec_href($sections[$#sections]),
       'About',     $docu_about. '#SEC_About',
       'About',     $docu_about. '#SEC_About',
      );
      );
    # prepare TOC, OVERVIEW, TOP
    # prepare TOC, OVERVIEW, TOP
    $T2H_TOC = \@toc_lines;
    $T2H_TOC = \@toc_lines;
    $T2H_OVERVIEW = \@stoc_lines;
    $T2H_OVERVIEW = \@stoc_lines;
    if ($has_top)
    if ($has_top)
    {
    {
      while (1)
      while (1)
      {
      {
        $_ = shift @doc_lines;
        $_ = shift @doc_lines;
        last if /$TOPEND/;
        last if /$TOPEND/;
        push @$T2H_TOP, $_;
        push @$T2H_TOP, $_;
      }
      }
      $T2H_HREF{'Top'} = $docu_top . '#SEC_Top';
      $T2H_HREF{'Top'} = $docu_top . '#SEC_Top';
    }
    }
    else
    else
    {
    {
      $T2H_HREF{'Top'} = $T2H_HREF{First};
      $T2H_HREF{'Top'} = $T2H_HREF{First};
    }
    }
    $node2href{Top} = $T2H_HREF{Top};
    $node2href{Top} = $T2H_HREF{Top};
    $T2H_HREF{Contents} = $docu_toc.'#SEC_Contents' if @toc_lines;
    $T2H_HREF{Contents} = $docu_toc.'#SEC_Contents' if @toc_lines;
    $T2H_HREF{Overview} = $docu_stoc.'#SEC_OVERVIEW' if @stoc_lines;
    $T2H_HREF{Overview} = $docu_stoc.'#SEC_OVERVIEW' if @stoc_lines;
    # settle on index
    # settle on index
    if ($T2H_INDEX_CHAPTER)
    if ($T2H_INDEX_CHAPTER)
    {
    {
      $T2H_HREF{Index} = $node2href{normalise_node($T2H_INDEX_CHAPTER)};
      $T2H_HREF{Index} = $node2href{normalise_node($T2H_INDEX_CHAPTER)};
      warn "$ERROR T2H_INDEX_CHAPTER '$T2H_INDEX_CHAPTER' not found\n"
      warn "$ERROR T2H_INDEX_CHAPTER '$T2H_INDEX_CHAPTER' not found\n"
        unless $T2H_HREF{Index};
        unless $T2H_HREF{Index};
    }
    }
    if (! $T2H_HREF{Index} && $first_index_chapter)
    if (! $T2H_HREF{Index} && $first_index_chapter)
    {
    {
      $T2H_INDEX_CHAPTER = $first_index_chapter;
      $T2H_INDEX_CHAPTER = $first_index_chapter;
      $T2H_HREF{Index} = $node2href{$T2H_INDEX_CHAPTER};
      $T2H_HREF{Index} = $node2href{$T2H_INDEX_CHAPTER};
    }
    }
    print "# Using '" . clean_name($T2H_INDEX_CHAPTER) . "' as index page\n"
    print "# Using '" . clean_name($T2H_INDEX_CHAPTER) . "' as index page\n"
      if ($T2H_VERBOSE && $T2H_HREF{Index});
      if ($T2H_VERBOSE && $T2H_HREF{Index});
    %T2H_NAME =
    %T2H_NAME =
      (
      (
       'First',   clean_name($sec2node{$sections[0]}),
       'First',   clean_name($sec2node{$sections[0]}),
       'Last',    clean_name($sec2node{$sections[$#sections]}),
       'Last',    clean_name($sec2node{$sections[$#sections]}),
       'About',    $T2H_WORDS->{$T2H_LANG}->{'About_Title'},
       'About',    $T2H_WORDS->{$T2H_LANG}->{'About_Title'},
       'Contents', $T2H_WORDS->{$T2H_LANG}->{'ToC_Title'},
       'Contents', $T2H_WORDS->{$T2H_LANG}->{'ToC_Title'},
       'Overview', $T2H_WORDS->{$T2H_LANG}->{'Overview_Title'},
       'Overview', $T2H_WORDS->{$T2H_LANG}->{'Overview_Title'},
       'Index' ,   clean_name($T2H_INDEX_CHAPTER),
       'Index' ,   clean_name($T2H_INDEX_CHAPTER),
       'Top',      clean_name($T2H_TOP_HEADING || $T2H_THISDOC{'title'} || $T2H_THISDOC{'shorttitle'}),
       'Top',      clean_name($T2H_TOP_HEADING || $T2H_THISDOC{'title'} || $T2H_THISDOC{'shorttitle'}),
      );
      );
    #############################################################################
    #############################################################################
    # print frame and frame toc file
    # print frame and frame toc file
    #
    #
    if ( $T2H_FRAMES )
    if ( $T2H_FRAMES )
    {
    {
      open(FILE, "> $docu_frame_file")
      open(FILE, "> $docu_frame_file")
        || die "$ERROR: Can't open $docu_frame_file for writing: $!\n";
        || die "$ERROR: Can't open $docu_frame_file for writing: $!\n";
      print "# Creating frame in $docu_frame_file ...\n" if $T2H_VERBOSE;
      print "# Creating frame in $docu_frame_file ...\n" if $T2H_VERBOSE;
      &$T2H_print_frame(\*FILE);
      &$T2H_print_frame(\*FILE);
      close(FILE);
      close(FILE);
      open(FILE, "> $docu_toc_frame_file")
      open(FILE, "> $docu_toc_frame_file")
        || die "$ERROR: Can't open $docu_toc_frame_file for writing: $!\n";
        || die "$ERROR: Can't open $docu_toc_frame_file for writing: $!\n";
      print "# Creating toc frame in $docu_frame_file ...\n" if $T2H_VERBOSE;
      print "# Creating toc frame in $docu_frame_file ...\n" if $T2H_VERBOSE;
       &$T2H_print_toc_frame(\*FILE);
       &$T2H_print_toc_frame(\*FILE);
      close(FILE);
      close(FILE);
    }
    }
    #############################################################################
    #############################################################################
    # print Top
    # print Top
    #
    #
    open(FILE, "> $docu_top_file")
    open(FILE, "> $docu_top_file")
      || die "$ERROR: Can't open $docu_top_file for writing: $!\n";
      || die "$ERROR: Can't open $docu_top_file for writing: $!\n";
    &$T2H_print_page_head(\*FILE) unless ($T2H_SPLIT);
    &$T2H_print_page_head(\*FILE) unless ($T2H_SPLIT);
    if ($has_top)
    if ($has_top)
    {
    {
      print "# Creating Top in $docu_top_file ...\n" if $T2H_VERBOSE;
      print "# Creating Top in $docu_top_file ...\n" if $T2H_VERBOSE;
      $T2H_THIS_SECTION = $T2H_TOP;
      $T2H_THIS_SECTION = $T2H_TOP;
      $T2H_HREF{This} = $T2H_HREF{Top};
      $T2H_HREF{This} = $T2H_HREF{Top};
      $T2H_NAME{This} = $T2H_NAME{Top};
      $T2H_NAME{This} = $T2H_NAME{Top};
      &$T2H_print_Top(\*FILE);
      &$T2H_print_Top(\*FILE);
    }
    }
    close(FILE) if $T2H_SPLIT;
    close(FILE) if $T2H_SPLIT;
    #############################################################################
    #############################################################################
    # Print sections
    # Print sections
    #
    #
    $T2H_NODE{Forward} = $sec2node{$sections[0]};
    $T2H_NODE{Forward} = $sec2node{$sections[0]};
    $T2H_NAME{Forward} = &clean_name($sec2node{$sections[0]});
    $T2H_NAME{Forward} = &clean_name($sec2node{$sections[0]});
    $T2H_HREF{Forward} = sec_href($sections[0]);
    $T2H_HREF{Forward} = sec_href($sections[0]);
    $T2H_NODE{This} = 'Top';
    $T2H_NODE{This} = 'Top';
    $T2H_NAME{This} = $T2H_NAME{Top};
    $T2H_NAME{This} = $T2H_NAME{Top};
    $T2H_HREF{This} = $T2H_HREF{Top};
    $T2H_HREF{This} = $T2H_HREF{Top};
    if ($T2H_SPLIT)
    if ($T2H_SPLIT)
    {
    {
      print "# writing " . scalar(@sections) .
      print "# writing " . scalar(@sections) .
        " sections in $docu_rdir$docu_name"."_[1..$doc_num]"
        " sections in $docu_rdir$docu_name"."_[1..$doc_num]"
              if $T2H_VERBOSE;
              if $T2H_VERBOSE;
      $previous = ($T2H_SPLIT eq 'chapter' ? $CHAPTEREND : $SECTIONEND);
      $previous = ($T2H_SPLIT eq 'chapter' ? $CHAPTEREND : $SECTIONEND);
      undef $FH;
      undef $FH;
      $doc_num = 0;
      $doc_num = 0;
    }
    }
    else
    else
    {
    {
      print "# writing " . scalar(@sections) . " sections in $docu_top_file ..."
      print "# writing " . scalar(@sections) . " sections in $docu_top_file ..."
        if $T2H_VERBOSE;
        if $T2H_VERBOSE;
      $FH = \*FILE;
      $FH = \*FILE;
      $previous = '';
      $previous = '';
    }
    }
    $counter = 0;
    $counter = 0;
    # loop through sections
    # loop through sections
    while ($section = shift(@sections))
    while ($section = shift(@sections))
    {
    {
      if ($T2H_SPLIT && ($T2H_SPLIT eq 'section' || $previous eq $CHAPTEREND))
      if ($T2H_SPLIT && ($T2H_SPLIT eq 'section' || $previous eq $CHAPTEREND))
      {
      {
        if ($FH)
        if ($FH)
        {
        {
          #close previous page
          #close previous page
          &$T2H_print_chapter_footer($FH) if $T2H_SPLIT eq 'chapter';
          &$T2H_print_chapter_footer($FH) if $T2H_SPLIT eq 'chapter';
          &$T2H_print_page_foot($FH);
          &$T2H_print_page_foot($FH);
          close($FH);
          close($FH);
          undef $FH;
          undef $FH;
        }
        }
      }
      }
      $T2H_NAME{Back} = $T2H_NAME{This};
      $T2H_NAME{Back} = $T2H_NAME{This};
      $T2H_HREF{Back} = $T2H_HREF{This};
      $T2H_HREF{Back} = $T2H_HREF{This};
      $T2H_NODE{Back} = $T2H_NODE{This};
      $T2H_NODE{Back} = $T2H_NODE{This};
      $T2H_NAME{This} = $T2H_NAME{Forward};
      $T2H_NAME{This} = $T2H_NAME{Forward};
      $T2H_HREF{This} = $T2H_HREF{Forward};
      $T2H_HREF{This} = $T2H_HREF{Forward};
      $T2H_NODE{This} = $T2H_NODE{Forward};
      $T2H_NODE{This} = $T2H_NODE{Forward};
      if ($sections[0])
      if ($sections[0])
      {
      {
        $T2H_NODE{Forward} = $sec2node{$sections[0]};
        $T2H_NODE{Forward} = $sec2node{$sections[0]};
        $T2H_NAME{Forward} = &clean_name($T2H_NODE{Forward});
        $T2H_NAME{Forward} = &clean_name($T2H_NODE{Forward});
        $T2H_HREF{Forward} = sec_href($sections[0]);
        $T2H_HREF{Forward} = sec_href($sections[0]);
      }
      }
      else
      else
      {
      {
        undef $T2H_HREF{Forward}, $T2H_NODE{Forward}, $T2H_NAME{Forward};
        undef $T2H_HREF{Forward}, $T2H_NODE{Forward}, $T2H_NAME{Forward};
      }
      }
      $node = $node2up{$T2H_NODE{This}};
      $node = $node2up{$T2H_NODE{This}};
      $T2H_HREF{Up} = $node2href{$node};
      $T2H_HREF{Up} = $node2href{$node};
      if ($T2H_HREF{Up} eq $T2H_HREF{This} || ! $T2H_HREF{Up})
      if ($T2H_HREF{Up} eq $T2H_HREF{This} || ! $T2H_HREF{Up})
      {
      {
        $T2H_NAME{Up} = $T2H_NAME{Top};
        $T2H_NAME{Up} = $T2H_NAME{Top};
        $T2H_HREF{Up} = $T2H_HREF{Top};
        $T2H_HREF{Up} = $T2H_HREF{Top};
        $T2H_NODE{Up} = 'Up';
        $T2H_NODE{Up} = 'Up';
      }
      }
      else
      else
      {
      {
        $T2H_NAME{Up} = &clean_name($node);
        $T2H_NAME{Up} = &clean_name($node);
        $T2H_NODE{Up} = $node;
        $T2H_NODE{Up} = $node;
      }
      }
      $node = $T2H_NODE{This};
      $node = $T2H_NODE{This};
      $node = $node2prev{$node};
      $node = $node2prev{$node};
      $T2H_NAME{Prev} = &clean_name($node);
      $T2H_NAME{Prev} = &clean_name($node);
      $T2H_HREF{Prev} = $node2href{$node};
      $T2H_HREF{Prev} = $node2href{$node};
      $T2H_NODE{Prev} = $node;
      $T2H_NODE{Prev} = $node;
      $node = $T2H_NODE{This};
      $node = $T2H_NODE{This};
      if ($node2up{$node} && $node2up{$node} ne 'Top'&&
      if ($node2up{$node} && $node2up{$node} ne 'Top'&&
          ($node2prev{$node} eq $T2H_NODE{Back} || ! $node2prev{$node}))
          ($node2prev{$node} eq $T2H_NODE{Back} || ! $node2prev{$node}))
      {
      {
        $node = $node2up{$node};
        $node = $node2up{$node};
        while ($node && $node ne $node2up{$node} && ! $node2prev{$node})
        while ($node && $node ne $node2up{$node} && ! $node2prev{$node})
        {
        {
          $node = $node2up{$node};
          $node = $node2up{$node};
        }
        }
        $node = $node2prev{$node}
        $node = $node2prev{$node}
          unless $node2up{$node} eq 'Top' || ! $node2up{$node};
          unless $node2up{$node} eq 'Top' || ! $node2up{$node};
      }
      }
      else
      else
      {
      {
        $node = $node2prev{$node};
        $node = $node2prev{$node};
      }
      }
      $T2H_NAME{FastBack} = &clean_name($node);
      $T2H_NAME{FastBack} = &clean_name($node);
      $T2H_HREF{FastBack} = $node2href{$node};
      $T2H_HREF{FastBack} = $node2href{$node};
      $T2H_NODE{FastBack} = $node;
      $T2H_NODE{FastBack} = $node;
      $node = $T2H_NODE{This};
      $node = $T2H_NODE{This};
      $node = $node2next{$node};
      $node = $node2next{$node};
      $T2H_NAME{Next} = &clean_name($node);
      $T2H_NAME{Next} = &clean_name($node);
      $T2H_HREF{Next} = $node2href{$node};
      $T2H_HREF{Next} = $node2href{$node};
      $T2H_NODE{Next} = $node;
      $T2H_NODE{Next} = $node;
      $node = $T2H_NODE{This};
      $node = $T2H_NODE{This};
      if ($node2up{$node} && $node2up{$node} ne 'Top'&&
      if ($node2up{$node} && $node2up{$node} ne 'Top'&&
          ($node2next{$node} eq $T2H_NODE{Forward} || ! $node2next{$node}))
          ($node2next{$node} eq $T2H_NODE{Forward} || ! $node2next{$node}))
      {
      {
        $node = $node2up{$node};
        $node = $node2up{$node};
        while ($node && $node ne $node2up{$node} && ! $node2next{$node})
        while ($node && $node ne $node2up{$node} && ! $node2next{$node})
        {
        {
          $node = $node2up{$node};
          $node = $node2up{$node};
        }
        }
      }
      }
      $node = $node2next{$node};
      $node = $node2next{$node};
      $T2H_NAME{FastForward} = &clean_name($node);
      $T2H_NAME{FastForward} = &clean_name($node);
      $T2H_HREF{FastForward} = $node2href{$node};
      $T2H_HREF{FastForward} = $node2href{$node};
      $T2H_NODE{FastForward} = $node;
      $T2H_NODE{FastForward} = $node;
      if (! defined($FH))
      if (! defined($FH))
      {
      {
        my $file = $T2H_HREF{This};
        my $file = $T2H_HREF{This};
        $file =~ s/\#.*$//;
        $file =~ s/\#.*$//;
        open(FILE, "> $docu_rdir$file") ||
        open(FILE, "> $docu_rdir$file") ||
          die "$ERROR: Can't open $docu_rdir$file for writing: $!\n";
          die "$ERROR: Can't open $docu_rdir$file for writing: $!\n";
        $FH = \*FILE;
        $FH = \*FILE;
        &$T2H_print_page_head($FH);
        &$T2H_print_page_head($FH);
        t2h_print_label($FH);
        t2h_print_label($FH);
        &$T2H_print_chapter_header($FH) if $T2H_SPLIT eq 'chapter';
        &$T2H_print_chapter_header($FH) if $T2H_SPLIT eq 'chapter';
      }
      }
      else
      else
      {
      {
        t2h_print_label($FH);
        t2h_print_label($FH);
      }
      }
      $T2H_THIS_SECTION = [];
      $T2H_THIS_SECTION = [];
      while (@doc_lines) {
      while (@doc_lines) {
        $_ = shift(@doc_lines);
        $_ = shift(@doc_lines);
        last if ($_ eq $SECTIONEND || $_ eq $CHAPTEREND);
        last if ($_ eq $SECTIONEND || $_ eq $CHAPTEREND);
        push(@$T2H_THIS_SECTION, $_);
        push(@$T2H_THIS_SECTION, $_);
      }
      }
      $previous = $_;
      $previous = $_;
      &$T2H_print_section($FH);
      &$T2H_print_section($FH);
      if ($T2H_VERBOSE)
      if ($T2H_VERBOSE)
      {
      {
        $counter++;
        $counter++;
        print "." if $counter =~ /00$/;
        print "." if $counter =~ /00$/;
      }
      }
    }
    }
    if ($T2H_SPLIT)
    if ($T2H_SPLIT)
    {
    {
      &$T2H_print_chapter_footer($FH) if $T2H_SPLIT eq 'chapter';
      &$T2H_print_chapter_footer($FH) if $T2H_SPLIT eq 'chapter';
      &$T2H_print_page_foot($FH);
      &$T2H_print_page_foot($FH);
      close($FH);
      close($FH);
    }
    }
    print "\n" if $T2H_VERBOSE;
    print "\n" if $T2H_VERBOSE;
    #############################################################################
    #############################################################################
    # Print ToC, Overview, Footnotes
    # Print ToC, Overview, Footnotes
    #
    #
    undef $T2H_HREF{Prev};
    undef $T2H_HREF{Prev};
    undef $T2H_HREF{Next};
    undef $T2H_HREF{Next};
    undef $T2H_HREF{Back};
    undef $T2H_HREF{Back};
    undef $T2H_HREF{Forward};
    undef $T2H_HREF{Forward};
    undef $T2H_HREF{Up};
    undef $T2H_HREF{Up};
    if (@foot_lines)
    if (@foot_lines)
    {
    {
      print "# writing Footnotes in $docu_foot_file...\n" if $T2H_VERBOSE;
      print "# writing Footnotes in $docu_foot_file...\n" if $T2H_VERBOSE;
      open (FILE, "> $docu_foot_file") || die "$ERROR: Can't open $docu_foot_file for writing: $!\n"
      open (FILE, "> $docu_foot_file") || die "$ERROR: Can't open $docu_foot_file for writing: $!\n"
          if $T2H_SPLIT;
          if $T2H_SPLIT;
      $T2H_HREF{This} = $docu_foot;
      $T2H_HREF{This} = $docu_foot;
      $T2H_NAME{This} = $T2H_WORDS->{$T2H_LANG}->{'Footnotes_Title'};
      $T2H_NAME{This} = $T2H_WORDS->{$T2H_LANG}->{'Footnotes_Title'};
      $T2H_THIS_SECTION = \@foot_lines;
      $T2H_THIS_SECTION = \@foot_lines;
      &$T2H_print_Footnotes(\*FILE);
      &$T2H_print_Footnotes(\*FILE);
      close(FILE) if $T2H_SPLIT;
      close(FILE) if $T2H_SPLIT;
    }
    }
    if (@toc_lines)
    if (@toc_lines)
    {
    {
      print "# writing Toc in $docu_toc_file...\n" if $T2H_VERBOSE;
      print "# writing Toc in $docu_toc_file...\n" if $T2H_VERBOSE;
      open (FILE, "> $docu_toc_file") || die "$ERROR: Can't open $docu_toc_file for writing: $!\n"
      open (FILE, "> $docu_toc_file") || die "$ERROR: Can't open $docu_toc_file for writing: $!\n"
          if $T2H_SPLIT;
          if $T2H_SPLIT;
      $T2H_HREF{This} = $T2H_HREF{Contents};
      $T2H_HREF{This} = $T2H_HREF{Contents};
      $T2H_NAME{This} = $T2H_NAME{Contents};
      $T2H_NAME{This} = $T2H_NAME{Contents};
      $T2H_THIS_SECTION = \@toc_lines;
      $T2H_THIS_SECTION = \@toc_lines;
      &$T2H_print_Toc(\*FILE);
      &$T2H_print_Toc(\*FILE);
      close(FILE) if $T2H_SPLIT;
      close(FILE) if $T2H_SPLIT;
    }
    }
    if (@stoc_lines)
    if (@stoc_lines)
    {
    {
      print "# writing Overview in $docu_stoc_file...\n" if $T2H_VERBOSE;
      print "# writing Overview in $docu_stoc_file...\n" if $T2H_VERBOSE;
      open (FILE, "> $docu_stoc_file") || die "$ERROR: Can't open $docu_stoc_file for writing: $!\n"
      open (FILE, "> $docu_stoc_file") || die "$ERROR: Can't open $docu_stoc_file for writing: $!\n"
          if $T2H_SPLIT;
          if $T2H_SPLIT;
      $T2H_HREF{This} = $T2H_HREF{Overview};
      $T2H_HREF{This} = $T2H_HREF{Overview};
      $T2H_NAME{This} = $T2H_NAME{Overview};
      $T2H_NAME{This} = $T2H_NAME{Overview};
      $T2H_THIS_SECTION = \@stoc_lines;
      $T2H_THIS_SECTION = \@stoc_lines;
      unshift @$T2H_THIS_SECTION, "
    \n";
      unshift @$T2H_THIS_SECTION, "
    \n";
      push @$T2H_THIS_SECTION, "\n\n";
      push @$T2H_THIS_SECTION, "\n\n";
      &$T2H_print_Overview(\*FILE);
      &$T2H_print_Overview(\*FILE);
      close(FILE) if $T2H_SPLIT;
      close(FILE) if $T2H_SPLIT;
    }
    }
    if ($about_body = &$T2H_about_body())
    if ($about_body = &$T2H_about_body())
    {
    {
      print "# writing About in $docu_about_file...\n" if $T2H_VERBOSE;
      print "# writing About in $docu_about_file...\n" if $T2H_VERBOSE;
      open (FILE, "> $docu_about_file") || die "$ERROR: Can't open $docu_about_file for writing: $!\n"
      open (FILE, "> $docu_about_file") || die "$ERROR: Can't open $docu_about_file for writing: $!\n"
          if $T2H_SPLIT;
          if $T2H_SPLIT;
      $T2H_HREF{This} = $T2H_HREF{About};
      $T2H_HREF{This} = $T2H_HREF{About};
      $T2H_NAME{This} = $T2H_NAME{About};
      $T2H_NAME{This} = $T2H_NAME{About};
      $T2H_THIS_SECTION = [$about_body];
      $T2H_THIS_SECTION = [$about_body];
      &$T2H_print_About(\*FILE);
      &$T2H_print_About(\*FILE);
      close(FILE) if $T2H_SPLIT;
      close(FILE) if $T2H_SPLIT;
    }
    }
    unless ($T2H_SPLIT)
    unless ($T2H_SPLIT)
    {
    {
      &$T2H_print_page_foot(\*FILE);
      &$T2H_print_page_foot(\*FILE);
      close (FILE);
      close (FILE);
    }
    }
    Finish:
    Finish:
    &l2h_FinishFromHtml if ($T2H_L2H);
    &l2h_FinishFromHtml if ($T2H_L2H);
    &l2h_Finish if($T2H_L2H);
    &l2h_Finish if($T2H_L2H);
    print "# that's all folks\n" if $T2H_VERBOSE;
    print "# that's all folks\n" if $T2H_VERBOSE;
    exit(0);
    exit(0);
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # Low level functions                                                          #
    # Low level functions                                                          #
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    sub LocateIncludeFile
    sub LocateIncludeFile
    {
    {
      my $file = shift;
      my $file = shift;
      my $dir;
      my $dir;
      return $file if (-e $file && -r $file);
      return $file if (-e $file && -r $file);
      foreach $dir (@T2H_INCLUDE_DIRS)
      foreach $dir (@T2H_INCLUDE_DIRS)
      {
      {
        return "$dir/$file" if (-e "$dir/$file" && -r "$dir/$file");
        return "$dir/$file" if (-e "$dir/$file" && -r "$dir/$file");
      }
      }
      return undef;
      return undef;
    }
    }
    sub clean_name
    sub clean_name
    {
    {
      local ($_);
      local ($_);
      $_ = &remove_style($_[0]);
      $_ = &remove_style($_[0]);
      &unprotect_texi;
      &unprotect_texi;
      return $_;
      return $_;
    }
    }
    sub update_sec_num {
    sub update_sec_num {
        local($name, $level) = @_;
        local($name, $level) = @_;
        my $ret;
        my $ret;
        $level--; # here we start at 0
        $level--; # here we start at 0
        if ($name =~ /^appendix/ || defined(@appendix_sec_num)) {
        if ($name =~ /^appendix/ || defined(@appendix_sec_num)) {
            # appendix style
            # appendix style
            if (defined(@appendix_sec_num)) {
            if (defined(@appendix_sec_num)) {
                &incr_sec_num($level, @appendix_sec_num);
                &incr_sec_num($level, @appendix_sec_num);
            } else {
            } else {
                @appendix_sec_num = ('A', 0, 0, 0);
                @appendix_sec_num = ('A', 0, 0, 0);
            }
            }
            $ret = join('.', @appendix_sec_num[0..$level]);
            $ret = join('.', @appendix_sec_num[0..$level]);
        } else {
        } else {
            # normal style
            # normal style
            if (defined(@normal_sec_num))
            if (defined(@normal_sec_num))
            {
            {
              &incr_sec_num($level, @normal_sec_num);
              &incr_sec_num($level, @normal_sec_num);
            }
            }
            else
            else
            {
            {
              @normal_sec_num = (1, 0, 0, 0);
              @normal_sec_num = (1, 0, 0, 0);
            }
            }
            $ret = join('.', @normal_sec_num[0..$level]);
            $ret = join('.', @normal_sec_num[0..$level]);
        }
        }
        $ret .= "." if $level == 0;
        $ret .= "." if $level == 0;
        return $ret;
        return $ret;
    }
    }
    sub incr_sec_num {
    sub incr_sec_num {
        local($level, $l);
        local($level, $l);
        $level = shift(@_);
        $level = shift(@_);
        $_[$level]++;
        $_[$level]++;
        foreach $l ($level+1 .. 3) {
        foreach $l ($level+1 .. 3) {
            $_[$l] = 0;
            $_[$l] = 0;
        }
        }
    }
    }
    sub Sec2UpNode
    sub Sec2UpNode
    {
    {
      my $sec = shift;
      my $sec = shift;
      my $num = $sec2number{$sec};
      my $num = $sec2number{$sec};
      return '' unless $num;
      return '' unless $num;
      return 'Top' unless $num =~ /\.\d+/;
      return 'Top' unless $num =~ /\.\d+/;
      $num =~ s/\.[^\.]*$//;
      $num =~ s/\.[^\.]*$//;
      $num = $num . '.' unless $num =~ /\./;
      $num = $num . '.' unless $num =~ /\./;
      return $sec2node{$number2sec{$num}};
      return $sec2node{$number2sec{$num}};
    }
    }
    sub Sec2PrevNode
    sub Sec2PrevNode
    {
    {
      my $sec = shift;
      my $sec = shift;
      my $num = $sec2number{$sec};
      my $num = $sec2number{$sec};
      my ($i, $post);
      my ($i, $post);
      if ($num =~ /(\w+)(\.$|$)/)
      if ($num =~ /(\w+)(\.$|$)/)
      {
      {
        $num = $`;
        $num = $`;
        $i = $1;
        $i = $1;
        $post = $2;
        $post = $2;
        if ($i eq 'A')
        if ($i eq 'A')
        {
        {
          $i = $normal_sec_num[0];
          $i = $normal_sec_num[0];
        }
        }
        elsif ($i ne '1')
        elsif ($i ne '1')
        {
        {
          # unfortunately, -- operator is not magical
          # unfortunately, -- operator is not magical
          $i = chr(ord($i) + 1);
          $i = chr(ord($i) + 1);
        }
        }
        else
        else
        {
        {
          return '';
          return '';
        }
        }
        return $sec2node{$number2sec{$num . $i . $post}}
        return $sec2node{$number2sec{$num . $i . $post}}
      }
      }
      return '';
      return '';
    }
    }
    sub Sec2NextNode
    sub Sec2NextNode
    {
    {
      my $sec = shift;
      my $sec = shift;
      my $num = $sec2number{$sec};
      my $num = $sec2number{$sec};
      my $i;
      my $i;
      if ($num =~ /(\w+)(\.$|$)/)
      if ($num =~ /(\w+)(\.$|$)/)
      {
      {
        $num = $`;
        $num = $`;
        $i = $1;
        $i = $1;
        $post = $2;
        $post = $2;
        if ($post eq '.' && $i eq $normal_sec_num[0])
        if ($post eq '.' && $i eq $normal_sec_num[0])
        {
        {
          $i = 'A';
          $i = 'A';
        }
        }
        else
        else
        {
        {
          $i++;
          $i++;
        }
        }
        return $sec2node{$number2sec{$num . $i . $post}}
        return $sec2node{$number2sec{$num . $i . $post}}
      }
      }
      return '';
      return '';
    }
    }
    sub check {
    sub check {
        local($_, %seen, %context, $before, $match, $after);
        local($_, %seen, %context, $before, $match, $after);
        while (<>) {
        while (<>) {
            if (/\@(\*|\.|\:|\@|\{|\})/) {
            if (/\@(\*|\.|\:|\@|\{|\})/) {
                $seen{$&}++;
                $seen{$&}++;
                $context{$&} .= "> $_" if $T2H_VERBOSE;
                $context{$&} .= "> $_" if $T2H_VERBOSE;
                $_ = "$`XX$'";
                $_ = "$`XX$'";
                redo;
                redo;
            }
            }
            if (/\@(\w+)/) {
            if (/\@(\w+)/) {
                ($before, $match, $after) = ($`, $&, $');
                ($before, $match, $after) = ($`, $&, $');
                if ($before =~ /\b[\w-]+$/ && $after =~ /^[\w-.]*\b/) { # e-mail address
                if ($before =~ /\b[\w-]+$/ && $after =~ /^[\w-.]*\b/) { # e-mail address
                    $seen{'e-mail address'}++;
                    $seen{'e-mail address'}++;
                    $context{'e-mail address'} .= "> $_" if $T2H_VERBOSE;
                    $context{'e-mail address'} .= "> $_" if $T2H_VERBOSE;
                } else {
                } else {
                    $seen{$match}++;
                    $seen{$match}++;
                    $context{$match} .= "> $_" if $T2H_VERBOSE;
                    $context{$match} .= "> $_" if $T2H_VERBOSE;
                }
                }
                $match =~ s/^\@/X/;
                $match =~ s/^\@/X/;
                $_ = "$before$match$after";
                $_ = "$before$match$after";
                redo;
                redo;
            }
            }
        }
        }
        foreach (sort(keys(%seen))) {
        foreach (sort(keys(%seen))) {
            if ($T2H_VERBOSE) {
            if ($T2H_VERBOSE) {
                print "$_\n";
                print "$_\n";
                print $context{$_};
                print $context{$_};
            } else {
            } else {
                print "$_ ($seen{$_})\n";
                print "$_ ($seen{$_})\n";
            }
            }
        }
        }
    }
    }
    sub open {
    sub open {
        local($name) = @_;
        local($name) = @_;
        ++$fh_name;
        ++$fh_name;
        if (open($fh_name, $name)) {
        if (open($fh_name, $name)) {
            unshift(@fhs, $fh_name);
            unshift(@fhs, $fh_name);
        } else {
        } else {
            warn "$ERROR Can't read file $name: $!\n";
            warn "$ERROR Can't read file $name: $!\n";
        }
        }
    }
    }
    sub init_input {
    sub init_input {
        @fhs = ();                  # hold the file handles to read
        @fhs = ();                  # hold the file handles to read
        @input_spool = ();          # spooled lines to read
        @input_spool = ();          # spooled lines to read
        $fh_name = 'FH000';
        $fh_name = 'FH000';
        &open($docu);
        &open($docu);
    }
    }
    sub next_line {
    sub next_line {
        local($fh, $line);
        local($fh, $line);
        if (@input_spool) {
        if (@input_spool) {
            $line = shift(@input_spool);
            $line = shift(@input_spool);
            return($line);
            return($line);
        }
        }
        while (@fhs) {
        while (@fhs) {
            $fh = $fhs[0];
            $fh = $fhs[0];
            $line = <$fh>;
            $line = <$fh>;
            return($line) if $line;
            return($line) if $line;
            close($fh);
            close($fh);
            shift(@fhs);
            shift(@fhs);
        }
        }
        return(undef);
        return(undef);
    }
    }
    # used in pass 1, use &next_line
    # used in pass 1, use &next_line
    sub skip_until {
    sub skip_until {
        local($tag) = @_;
        local($tag) = @_;
        local($_);
        local($_);
        while ($_ = &next_line) {
        while ($_ = &next_line) {
            return if /^\@end\s+$tag\s*$/;
            return if /^\@end\s+$tag\s*$/;
        }
        }
        die "* Failed to find '$tag' after: " . $lines[$#lines];
        die "* Failed to find '$tag' after: " . $lines[$#lines];
    }
    }
    # used in pass 1 for l2h use &next_line
    # used in pass 1 for l2h use &next_line
    sub string_until {
    sub string_until {
        local($tag) = @_;
        local($tag) = @_;
        local($_, $string);
        local($_, $string);
        while ($_ = &next_line) {
        while ($_ = &next_line) {
            return $string if /^\@end\s+$tag\s*$/;
            return $string if /^\@end\s+$tag\s*$/;
    #       $_ =~ s/hbox/mbox/g;
    #       $_ =~ s/hbox/mbox/g;
            $string = $string.$_;
            $string = $string.$_;
        }
        }
        die "* Failed to find '$tag' after: " . $lines[$#lines];
        die "* Failed to find '$tag' after: " . $lines[$#lines];
    }
    }
    #
    #
    # HTML stacking to have a better HTML output
    # HTML stacking to have a better HTML output
    #
    #
    sub html_reset {
    sub html_reset {
        @html_stack = ('html');
        @html_stack = ('html');
        $html_element = 'body';
        $html_element = 'body';
    }
    }
    sub html_push {
    sub html_push {
        local($what) = @_;
        local($what) = @_;
        push(@html_stack, $html_element);
        push(@html_stack, $html_element);
        $html_element = $what;
        $html_element = $what;
    }
    }
    sub html_push_if {
    sub html_push_if {
        local($what) = @_;
        local($what) = @_;
        push(@html_stack, $html_element)
        push(@html_stack, $html_element)
            if ($html_element && $html_element ne 'P');
            if ($html_element && $html_element ne 'P');
        $html_element = $what;
        $html_element = $what;
    }
    }
    sub html_pop {
    sub html_pop {
        $html_element = pop(@html_stack);
        $html_element = pop(@html_stack);
    }
    }
    sub html_pop_if {
    sub html_pop_if {
        local($elt);
        local($elt);
        if (@_) {
        if (@_) {
            foreach $elt (@_) {
            foreach $elt (@_) {
                if ($elt eq $html_element) {
                if ($elt eq $html_element) {
                    $html_element = pop(@html_stack) if @html_stack;
                    $html_element = pop(@html_stack) if @html_stack;
                    last;
                    last;
                }
                }
            }
            }
        } else {
        } else {
            $html_element = pop(@html_stack) if @html_stack;
            $html_element = pop(@html_stack) if @html_stack;
        }
        }
    }
    }
    sub html_debug {
    sub html_debug {
        local($what, $line) = @_;
        local($what, $line) = @_;
        if ($T2H_DEBUG & $DEBUG_HTML)
        if ($T2H_DEBUG & $DEBUG_HTML)
        {
        {
         $what = "\n" unless $what;
         $what = "\n" unless $what;
         return("$what")
         return("$what")
        }
        }
        return($what);
        return($what);
    }
    }
    # to debug the output...
    # to debug the output...
    sub debug {
    sub debug {
        local($what, $line) = @_;
        local($what, $line) = @_;
        return("$what")
        return("$what")
            if $T2H_DEBUG & $DEBUG_HTML;
            if $T2H_DEBUG & $DEBUG_HTML;
        return($what);
        return($what);
    }
    }
    sub SimpleTexi2Html
    sub SimpleTexi2Html
    {
    {
      local $_ = $_[0];
      local $_ = $_[0];
      &protect_texi;
      &protect_texi;
      &protect_html;
      &protect_html;
      $_ = substitute_style($_);
      $_ = substitute_style($_);
      $_[0]  = $_;
      $_[0]  = $_;
    }
    }
    sub normalise_node {
    sub normalise_node {
      local $_ = $_[0];
      local $_ = $_[0];
      s/\s+/ /g;
      s/\s+/ /g;
      s/ $//;
      s/ $//;
      s/^ //;
      s/^ //;
      &protect_texi;
      &protect_texi;
      &protect_html;
      &protect_html;
      $_ = substitute_style($_);
      $_ = substitute_style($_);
      $_[0]  = $_;
      $_[0]  = $_;
    }
    }
    sub menu_entry
    sub menu_entry
    {
    {
      my ($node, $name, $descr) = @_;
      my ($node, $name, $descr) = @_;
      my ($href, $entry);
      my ($href, $entry);
      &normalise_node($node);
      &normalise_node($node);
      $href = $node2href{$node};
      $href = $node2href{$node};
      if ($href)
      if ($href)
      {
      {
        $descr =~ s/^\s+//;
        $descr =~ s/^\s+//;
        $descr =~ s/\s*$//;
        $descr =~ s/\s*$//;
        $descr = SimpleTexi2Html($descr);
        $descr = SimpleTexi2Html($descr);
        if ($T2H_NUMBER_SECTIONS && !$T2H_NODE_NAME_IN_MENU && $node2sec{$node})
        if ($T2H_NUMBER_SECTIONS && !$T2H_NODE_NAME_IN_MENU && $node2sec{$node})
        {
        {
          $entry = $node2sec{$node};
          $entry = $node2sec{$node};
          $name = '';
          $name = '';
        }
        }
        else
        else
        {
        {
          &normalise_node($name);
          &normalise_node($name);
          $entry = ($name && ($name ne $node || ! $T2H_AVOID_MENU_REDUNDANCY)
          $entry = ($name && ($name ne $node || ! $T2H_AVOID_MENU_REDUNDANCY)
                    ? "$name : $node" : $node);
                    ? "$name : $node" : $node);
        }
        }
        if ($T2H_AVOID_MENU_REDUNDANCY && $descr)
        if ($T2H_AVOID_MENU_REDUNDANCY && $descr)
        {
        {
          my $clean_entry = $entry;
          my $clean_entry = $entry;
          $clean_entry =~ s/^.*? // if ($clean_entry =~ /^([A-Z]|\d+)\.[\d\.]* /);
          $clean_entry =~ s/^.*? // if ($clean_entry =~ /^([A-Z]|\d+)\.[\d\.]* /);
          $clean_entry =~ s/[^\w]//g;
          $clean_entry =~ s/[^\w]//g;
          my $clean_descr = $descr;
          my $clean_descr = $descr;
          $clean_descr =~ s/[^\w]//g;
          $clean_descr =~ s/[^\w]//g;
          $descr = '' if ($clean_entry eq $clean_descr)
          $descr = '' if ($clean_entry eq $clean_descr)
        }
        }
        push(@lines2,&debug('
    ' .
        push(@lines2,&debug('
    ' .
                            &t2h_anchor('', $href, $entry) .
                            &t2h_anchor('', $href, $entry) .
                            '
      ' .
                            '
      ' .
                            $descr .
                            $descr .
                            "
                            "
      }
      }
      elsif ($node =~ /^\(.*\)\w+/)
      elsif ($node =~ /^\(.*\)\w+/)
      {
      {
        push(@lines2,&debug('
    ' .
        push(@lines2,&debug('
    ' .
                            $entry .
                            $entry .
                            '
    ' . $descr .
                            '
    ' . $descr .
                            "
                            "
      }
      }
      else
      else
      {
      {
        warn "$ERROR Undefined node of menu_entry ($node): $_";
        warn "$ERROR Undefined node of menu_entry ($node): $_";
      }
      }
    }
    }
    sub do_ctrl { "^$_[0]" }
    sub do_ctrl { "^$_[0]" }
    sub do_email {
    sub do_email {
        local($addr, $text) = split(/,\s*/, $_[0]);
        local($addr, $text) = split(/,\s*/, $_[0]);
        $text = $addr unless $text;
        $text = $addr unless $text;
        &t2h_anchor('', "mailto:$addr", $text);
        &t2h_anchor('', "mailto:$addr", $text);
    }
    }
    sub do_sc
    sub do_sc
    {
    {
      # l2h does this much better
      # l2h does this much better
      return &l2h_ToLatex("{\\sc ".&unprotect_html($_[0])."}") if ($T2H_L2H);
      return &l2h_ToLatex("{\\sc ".&unprotect_html($_[0])."}") if ($T2H_L2H);
      return "\U$_[0]\E";
      return "\U$_[0]\E";
    }
    }
    sub do_math
    sub do_math
    {
    {
      return &l2h_ToLatex("\$".&unprotect_html($_[0])."\$") if ($T2H_L2H);
      return &l2h_ToLatex("\$".&unprotect_html($_[0])."\$") if ($T2H_L2H);
      return "".$text."";
      return "".$text."";
    }
    }
    sub do_uref {
    sub do_uref {
        local($url, $text, $only_text) = split(/,\s*/, $_[0]);
        local($url, $text, $only_text) = split(/,\s*/, $_[0]);
        $text = $only_text if $only_text;
        $text = $only_text if $only_text;
        $text = $url unless $text;
        $text = $url unless $text;
        &t2h_anchor('', $url, $text);
        &t2h_anchor('', $url, $text);
    }
    }
    sub do_url { &t2h_anchor('', $_[0], $_[0]) }
    sub do_url { &t2h_anchor('', $_[0], $_[0]) }
    sub do_acronym
    sub do_acronym
    {
    {
      return '' . $_[0] . '';
      return '' . $_[0] . '';
    }
    }
    sub do_accent
    sub do_accent
    {
    {
      return "&$_[0]acute;" if $_[1] eq 'H';
      return "&$_[0]acute;" if $_[1] eq 'H';
      return "$_[0]." if $_[1] eq 'dotaccent';
      return "$_[0]." if $_[1] eq 'dotaccent';
      return "$_[0]*" if $_[1] eq 'ringaccent';
      return "$_[0]*" if $_[1] eq 'ringaccent';
      return "$_[0]".'[' if $_[1] eq 'tieaccent';
      return "$_[0]".'[' if $_[1] eq 'tieaccent';
      return "$_[0]".'(' if $_[1] eq 'u';
      return "$_[0]".'(' if $_[1] eq 'u';
      return "$_[0]_" if $_[1] eq 'ubaraccent';
      return "$_[0]_" if $_[1] eq 'ubaraccent';
      return ".$_[0]" if $_[1] eq 'udotaccent';
      return ".$_[0]" if $_[1] eq 'udotaccent';
      return "$_[0]<" if $_[1] eq 'v';
      return "$_[0]<" if $_[1] eq 'v';
      return "&$_[0]cedil;" if $_[1] eq ',';
      return "&$_[0]cedil;" if $_[1] eq ',';
      return "$_[0]" if $_[1] eq 'dotless';
      return "$_[0]" if $_[1] eq 'dotless';
      return undef;
      return undef;
    }
    }
    sub apply_style {
    sub apply_style {
        local($texi_style, $text) = @_;
        local($texi_style, $text) = @_;
        local($style);
        local($style);
        $style = $style_map{$texi_style};
        $style = $style_map{$texi_style};
        if (defined($style)) { # known style
        if (defined($style)) { # known style
            if ($style =~ /^\"/) { # add quotes
            if ($style =~ /^\"/) { # add quotes
                $style = $';
                $style = $';
                $text = "\`$text\'";
                $text = "\`$text\'";
            }
            }
            if ($style =~ /^\&/) { # custom
            if ($style =~ /^\&/) { # custom
                $style = $';
                $style = $';
                $text = &$style($text, $texi_style);
                $text = &$style($text, $texi_style);
            } elsif ($style) { # good style
            } elsif ($style) { # good style
                $text = "<$style>$text";
                $text = "<$style>$text";
            } else { # no style
            } else { # no style
            }
            }
        } else { # unknown style
        } else { # unknown style
            $text = undef;
            $text = undef;
        }
        }
        return($text);
        return($text);
    }
    }
    # remove Texinfo styles
    # remove Texinfo styles
    sub remove_style {
    sub remove_style {
        local($_) = @_;
        local($_) = @_;
        1 while(s/\@\w+{([^\{\}]+)}/$1/g);
        1 while(s/\@\w+{([^\{\}]+)}/$1/g);
        return($_);
        return($_);
    }
    }
    sub remove_things
    sub remove_things
    {
    {
      local ($_) = @_;
      local ($_) = @_;
      s|\@(\w+)\{\}|$1|g;
      s|\@(\w+)\{\}|$1|g;
      return $_;
      return $_;
    }
    }
    sub substitute_style {
    sub substitute_style {
        local($_) = @_;
        local($_) = @_;
        local($changed, $done, $style, $text);
        local($changed, $done, $style, $text);
        &simple_substitutions;
        &simple_substitutions;
        $changed = 1;
        $changed = 1;
        while ($changed) {
        while ($changed) {
            $changed = 0;
            $changed = 0;
            $done = '';
            $done = '';
            while (/\@(\w+){([^\{\}]+)}/ || /\@(,){([^\{\}]+)}/) {
            while (/\@(\w+){([^\{\}]+)}/ || /\@(,){([^\{\}]+)}/) {
                $text = &apply_style($1, $2);
                $text = &apply_style($1, $2);
                if ($text) {
                if ($text) {
                    $_ = "$`$text$'";
                    $_ = "$`$text$'";
                    $changed = 1;
                    $changed = 1;
                } else {
                } else {
                    $done .= "$`\@$1";
                    $done .= "$`\@$1";
                    $_ = "{$2}$'";
                    $_ = "{$2}$'";
                }
                }
            }
            }
            $_ = $done . $_;
            $_ = $done . $_;
        }
        }
        return($_);
        return($_);
    }
    }
    sub t2h_anchor {
    sub t2h_anchor {
        local($name, $href, $text, $newline, $extra_attribs) = @_;
        local($name, $href, $text, $newline, $extra_attribs) = @_;
        local($result);
        local($result);
        $result = "
        $result = "
        $result .= " NAME=\"$name\"" if $name;
        $result .= " NAME=\"$name\"" if $name;
        if ($href)
        if ($href)
        {
        {
          $href =~ s|^$T2H_HREF_DIR_INSTEAD_FILE|./|
          $href =~ s|^$T2H_HREF_DIR_INSTEAD_FILE|./|
            if ($T2H_HREF_DIR_INSTEAD_FILE);
            if ($T2H_HREF_DIR_INSTEAD_FILE);
          $result .= ($href =~ /\"/ ? " HREF='$href'"  : " HREF=\"$href\"");
          $result .= ($href =~ /\"/ ? " HREF='$href'"  : " HREF=\"$href\"");
        }
        }
        $result .= " $extra_attribs" if $extra_attribs;
        $result .= " $extra_attribs" if $extra_attribs;
        $result .= ">$text";
        $result .= ">$text";
        $result .= "\n" if $newline;
        $result .= "\n" if $newline;
        return($result);
        return($result);
    }
    }
    sub pretty_date {
    sub pretty_date {
        local(@MoY, $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);
        local(@MoY, $sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);
        @MoY = ('January', 'February', 'March', 'April', 'May', 'June',
        @MoY = ('January', 'February', 'March', 'April', 'May', 'June',
                'July', 'August', 'September', 'October', 'November', 'December');
                'July', 'August', 'September', 'October', 'November', 'December');
        ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
        ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
        $year += ($year < 70) ? 2000 : 1900;
        $year += ($year < 70) ? 2000 : 1900;
        # obachman: Let's do it as the Americans do
        # obachman: Let's do it as the Americans do
        return("$MoY[$mon], $mday  $year");
        return("$MoY[$mon], $mday  $year");
    }
    }
    sub doc_href {
    sub doc_href {
        local($num) = @_;
        local($num) = @_;
        return("${docu_name}_$num.$docu_ext");
        return("${docu_name}_$num.$docu_ext");
    }
    }
    sub sec_href
    sub sec_href
    {
    {
      return $node2href{$sec2node{$_[0]}};
      return $node2href{$sec2node{$_[0]}};
    }
    }
    sub next_doc {
    sub next_doc {
        $docu_doc = &doc_href(++$doc_num);
        $docu_doc = &doc_href(++$doc_num);
    }
    }
    sub t2h_print_lines {
    sub t2h_print_lines {
        my ($fh, $lines) = @_;
        my ($fh, $lines) = @_;
        local($_);
        local($_);
        $lines = $T2H_THIS_SECTION unless $lines;
        $lines = $T2H_THIS_SECTION unless $lines;
        my $cnt = 0;
        my $cnt = 0;
        for (@$lines)
        for (@$lines)
        {
        {
            $_ = l2h_FromHtml($_) if ($T2H_L2H);
            $_ = l2h_FromHtml($_) if ($T2H_L2H);
            if (/^$PROTECTTAG/o) {
            if (/^$PROTECTTAG/o) {
                $_ = $tag2pro{$_};
                $_ = $tag2pro{$_};
            } else {
            } else {
                &unprotect_texi;
                &unprotect_texi;
            }
            }
            print $fh $_;
            print $fh $_;
            $cnt += split(/\W*\s+\W*/);
            $cnt += split(/\W*\s+\W*/);
        }
        }
        return $cnt;
        return $cnt;
    }
    }
    sub protect_texi {
    sub protect_texi {
        # protect @ { } ` '
        # protect @ { } ` '
        s/\@\@/$;0/go;
        s/\@\@/$;0/go;
        s/\@\{/$;1/go;
        s/\@\{/$;1/go;
        s/\@\}/$;2/go;
        s/\@\}/$;2/go;
        s/\@\`/$;3/go;
        s/\@\`/$;3/go;
        s/\@\'/$;4/go;
        s/\@\'/$;4/go;
    }
    }
    sub protect_html {
    sub protect_html {
        local($what) = @_;
        local($what) = @_;
        # protect & < >
        # protect & < >
        $what =~ s/\&/\&\#38;/g;
        $what =~ s/\&/\&\#38;/g;
        $what =~ s/\
        $what =~ s/\
        $what =~ s/\>/\&\#62;/g;
        $what =~ s/\>/\&\#62;/g;
        # restore anything in quotes
        # restore anything in quotes
        # this fixes my problem where I had:
        # this fixes my problem where I had:
        # < IMG SRC="leftarrow.gif" ALT="<--" >  but what if I wanted < in my ALT text ??
        # < IMG SRC="leftarrow.gif" ALT="<--" >  but what if I wanted < in my ALT text ??
        # maybe byte stuffing or some other technique should be used.
        # maybe byte stuffing or some other technique should be used.
        $what =~ s/\"([^\&]+)\&\#60;(.*)\"/"$1<$2"/g;
        $what =~ s/\"([^\&]+)\&\#60;(.*)\"/"$1<$2"/g;
        $what =~ s/\"([^\&]+)\&\#62;(.*)\"/"$1>$2"/g;
        $what =~ s/\"([^\&]+)\&\#62;(.*)\"/"$1>$2"/g;
        $what =~ s/\"([^\&]+)\&\#38;(.*)\"/"$1&$2"/g;
        $what =~ s/\"([^\&]+)\&\#38;(.*)\"/"$1&$2"/g;
        # but recognize some HTML things
        # but recognize some HTML things
        $what =~ s/\&\#60;\/A\&\#62;/<\/A>/g;            # 
        $what =~ s/\&\#60;\/A\&\#62;/<\/A>/g;            # 
        $what =~ s/\&\#60;A ([^\&]+)\&\#62;//g;     # 
        $what =~ s/\&\#60;A ([^\&]+)\&\#62;//g;     # 
        $what =~ s/\&\#60;IMG ([^\&]+)\&\#62;//g; # 
        $what =~ s/\&\#60;IMG ([^\&]+)\&\#62;//g; # 
        return($what);
        return($what);
    }
    }
    sub unprotect_texi {
    sub unprotect_texi {
        s/$;0/\@/go;
        s/$;0/\@/go;
        s/$;1/\{/go;
        s/$;1/\{/go;
        s/$;2/\}/go;
        s/$;2/\}/go;
        s/$;3/\`/go;
        s/$;3/\`/go;
        s/$;4/\'/go;
        s/$;4/\'/go;
    }
    }
    sub Unprotect_texi
    sub Unprotect_texi
    {
    {
      local $_ = shift;
      local $_ = shift;
      &unprotect_texi;
      &unprotect_texi;
      return($_);
      return($_);
    }
    }
    sub unprotect_html {
    sub unprotect_html {
        local($what) = @_;
        local($what) = @_;
        $what =~ s/\&\#38;/\&/g;
        $what =~ s/\&\#38;/\&/g;
        $what =~ s/\&\#60;/\
        $what =~ s/\&\#60;/\
        $what =~ s/\&\#62;/\>/g;
        $what =~ s/\&\#62;/\>/g;
        return($what);
        return($what);
    }
    }
    sub t2h_print_label
    sub t2h_print_label
    {
    {
        my $fh = shift;
        my $fh = shift;
        my $href = shift || $T2H_HREF{This};
        my $href = shift || $T2H_HREF{This};
        $href =~ s/.*#(.*)$/$1/;
        $href =~ s/.*#(.*)$/$1/;
        print $fh qq{\n};
        print $fh qq{\n};
    }
    }
    ##############################################################################
    ##############################################################################
            # These next few lines are legal in both Perl and nroff.
            # These next few lines are legal in both Perl and nroff.
    .00 ;                   # finish .ig
    .00 ;                   # finish .ig
    'di                     \" finish diversion--previous line must be blank
    'di                     \" finish diversion--previous line must be blank
    .nr nl 0-1              \" fake up transition to first page again
    .nr nl 0-1              \" fake up transition to first page again
    .nr % 0                 \" start at page 1
    .nr % 0                 \" start at page 1
    '; __END__ ############# From here on it's a standard manual page ############
    '; __END__ ############# From here on it's a standard manual page ############
    .so /usr/local/man/man1/texi2html.1
    .so /usr/local/man/man1/texi2html.1
     
     

    powered by: WebSVN 2.1.0

    © copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.