OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [start/] [gdb-5.0/] [readline/] [doc/] [texi2html] - Diff between revs 579 and 1765

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 579 Rev 1765
#!/usr/local/bin/perl
#!/usr/local/bin/perl
'di ';
'di ';
'ig 00 ';
'ig 00 ';
#+##############################################################################
#+##############################################################################
#                                                                              #
#                                                                              #
# File: texi2html                                                              #
# File: texi2html                                                              #
#                                                                              #
#                                                                              #
# Description: Program to transform most Texinfo documents to HTML             #
# Description: Program to transform most Texinfo documents to HTML             #
#                                                                              #
#                                                                              #
#-##############################################################################
#-##############################################################################
# @(#)texi2html 1.52 01/05/98   Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch
# @(#)texi2html 1.52 01/05/98   Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch
# 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'.
# Please read the copyright at the end of the man page.
# Please read the copyright at the end of the man page.
#+++############################################################################
#+++############################################################################
#                                                                              #
#                                                                              #
# 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;
$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
$XREFRE = '[^@{}]+';                    # RE for a xref (should use NODERE)
$XREFRE = '[^@{}]+';                    # RE for a xref (should use NODERE)
$ERROR = "***";                         # prefix for errors and warnings
$ERROR = "***";                         # prefix for errors and warnings
$THISPROG = "texi2html 1.52";                   # program name and version
$THISPROG = "texi2html 1.52";                   # program name and version
$HOMEPAGE = "http://wwwinfo.cern.ch/dis/texi2html/"; # program home page
$HOMEPAGE = "http://wwwinfo.cern.ch/dis/texi2html/"; # program home page
$TODAY = &pretty_date;                      # like "20 September 1993"
$TODAY = &pretty_date;                      # like "20 September 1993"
$SPLITTAG = "\n";       # tag to know where to split
$SPLITTAG = "\n";       # tag to know where to split
$PROTECTTAG = "_ThisIsProtected_";      # tag to recognize protected sections
$PROTECTTAG = "_ThisIsProtected_";      # tag to recognize protected sections
$html2_doctype = '';
$html2_doctype = '';
#
#
# language dependent constants
# language dependent constants
#
#
#$LDC_SEE = 'see';
#$LDC_SEE = 'see';
#$LDC_SECTION = 'section';
#$LDC_SECTION = 'section';
#$LDC_IN = 'in';
#$LDC_IN = 'in';
#$LDC_TOC = 'Table of Contents';
#$LDC_TOC = 'Table of Contents';
#$LDC_GOTO = 'Go to the';
#$LDC_GOTO = 'Go to the';
#$LDC_FOOT = 'Footnotes';
#$LDC_FOOT = 'Footnotes';
# TODO: @def* shortcuts
# TODO: @def* shortcuts
#
#
# pre-defined indices
# pre-defined indices
#
#
%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+
               " ", " ",
               " ", " ",
               "\n", "\n",
               "\n", "\n",
               "|", "",
               "|", "",
               # 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', '...',
               'dots', '...',
               'equiv', '==',
               'equiv', '==',
               'error', 'error-->',
               'error', 'error-->',
               'expansion', '==>',
               'expansion', '==>',
               'minus', '-',
               'minus', '-',
               'point', '-!-',
               'point', '-!-',
               'print', '-|',
               'print', '-|',
               'result', '=>',
               'result', '=>',
               'today', $TODAY,
               'today', $TODAY,
               );
               );
#
#
# texinfo styles (@foo{bar}) to HTML ones
# texinfo styles (@foo{bar}) to HTML ones
#
#
%style_map = (
%style_map = (
              'asis', '',
              'asis', '',
              'b', 'B',
              'b', 'B',
              'cite', 'CITE',
              'cite', 'CITE',
              'code', 'CODE',
              'code', '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',
              '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', 'EM',
              'math', 'EM',
              '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
              );
              );
#
#
# texinfo format (@foo/@end foo) to HTML ones
# texinfo format (@foo/@end foo) to HTML ones
#
#
%format_map = (
%format_map = (
               'display', 'PRE',
               'display', 'PRE',
               'example', 'PRE',
               'example', 'PRE',
               'format', 'PRE',
               'format', 'PRE',
               'lisp', 'PRE',
               'lisp', 'PRE',
               'quotation', 'BLOCKQUOTE',
               'quotation', 'BLOCKQUOTE',
               'smallexample', 'PRE',
               'smallexample', 'PRE',
               'smalllisp', 'PRE',
               'smalllisp', 'PRE',
               # lists
               # lists
               'itemize', 'UL',
               'itemize', 'UL',
               'enumerate', 'OL',
               'enumerate', 'OL',
               # poorly supported
               # poorly supported
               'flushleft', 'PRE',
               'flushleft', 'PRE',
               'flushright', 'PRE',
               'flushright', 'PRE',
               );
               );
#
#
# 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}',
            'defmethod', 'defop Method',
            'defmethod', 'defop Method',
            # 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,
            # useless
            # useless
            '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,
            '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                                             #
#                                                                              #
#                                                                              #
#---############################################################################
#---############################################################################
%value = ();                            # hold texinfo variables, see also -D
%value = ();                            # hold texinfo variables, see also -D
$use_bibliography = 1;
$use_bibliography = 1;
$use_acc = 0;
$use_acc = 0;
$debug = 0;
$debug = 0;
$doctype = '';
$doctype = '';
$check = 0;
$check = 0;
$expandinfo = 0;
$expandinfo = 0;
$use_glossary = 0;
$use_glossary = 0;
$invisible_mark = '';
$invisible_mark = '';
$use_iso = 0;
$use_iso = 0;
@include_dirs = ();
@include_dirs = ();
$show_menu = 0;
$show_menu = 0;
$number_sections = 0;
$number_sections = 0;
$split_node = 0;
$split_node = 0;
$split_chapter = 0;
$split_chapter = 0;
$monolithic = 0;
$monolithic = 0;
$verbose = 0;
$verbose = 0;
$usage = <
$usage = <
This is $THISPROG
This is $THISPROG
To convert a Texinfo file to HMTL: $0 [options] file
To convert a Texinfo file to HMTL: $0 [options] file
  where options can be:
  where options can be:
    -expandinfo    : use \@ifinfo sections, not \@iftex
    -expandinfo    : use \@ifinfo sections, not \@iftex
    -glossary      : handle a glossary
    -glossary      : handle a glossary
    -invisible name: use 'name' as an invisible anchor
    -invisible name: use 'name' as an invisible anchor
    -Dname         : define name like with \@set
    -Dname         : define name like with \@set
    -I dir         : search also for files in 'dir'
    -I dir         : search also for files in 'dir'
    -menu          : handle menus
    -menu          : handle menus
    -monolithic    : output only one file including ToC
    -monolithic    : output only one file including ToC
    -number        : number sections
    -number        : number sections
    -split_chapter : split on main sections
    -split_chapter : split on main sections
    -split_node    : split on nodes
    -split_node    : split on nodes
    -usage         : print usage instructions
    -usage         : print usage instructions
    -verbose       : verbose output
    -verbose       : verbose output
To check converted files: $0 -check [-verbose] files
To check converted files: $0 -check [-verbose] files
EOT
EOT
while (@ARGV && $ARGV[0] =~ /^-/) {
while (@ARGV && $ARGV[0] =~ /^-/) {
    $_ = shift(@ARGV);
    $_ = shift(@ARGV);
    if (/^-acc$/)            { $use_acc = 1; next; }
    if (/^-acc$/)            { $use_acc = 1; next; }
    if (/^-d(ebug)?(\d+)?$/) { $debug = $2 || shift(@ARGV); next; }
    if (/^-d(ebug)?(\d+)?$/) { $debug = $2 || shift(@ARGV); next; }
    if (/^-doctype$/)        { $doctype = shift(@ARGV); next; }
    if (/^-doctype$/)        { $doctype = shift(@ARGV); next; }
    if (/^-c(heck)?$/)       { $check = 1; next; }
    if (/^-c(heck)?$/)       { $check = 1; next; }
    if (/^-e(xpandinfo)?$/)  { $expandinfo = 1; next; }
    if (/^-e(xpandinfo)?$/)  { $expandinfo = 1; next; }
    if (/^-g(lossary)?$/)    { $use_glossary = 1; next; }
    if (/^-g(lossary)?$/)    { $use_glossary = 1; next; }
    if (/^-i(nvisible)?$/)   { $invisible_mark = shift(@ARGV); next; }
    if (/^-i(nvisible)?$/)   { $invisible_mark = shift(@ARGV); next; }
    if (/^-iso$/)            { $use_iso = 1; next; }
    if (/^-iso$/)            { $use_iso = 1; next; }
    if (/^-D(.+)?$/)         { $value{$1 || shift(@ARGV)} = 1; next; }
    if (/^-D(.+)?$/)         { $value{$1 || shift(@ARGV)} = 1; next; }
    if (/^-I(.+)?$/)         { push(@include_dirs, $1 || shift(@ARGV)); next; }
    if (/^-I(.+)?$/)         { push(@include_dirs, $1 || shift(@ARGV)); next; }
    if (/^-m(enu)?$/)        { $show_menu = 1; next; }
    if (/^-m(enu)?$/)        { $show_menu = 1; next; }
    if (/^-mono(lithic)?$/)  { $monolithic = 1; next; }
    if (/^-mono(lithic)?$/)  { $monolithic = 1; next; }
    if (/^-n(umber)?$/)      { $number_sections = 1; next; }
    if (/^-n(umber)?$/)      { $number_sections = 1; next; }
    if (/^-s(plit)?_?(n(ode)?|c(hapter)?)?$/) {
    if (/^-s(plit)?_?(n(ode)?|c(hapter)?)?$/) {
        if ($2 =~ /^n/) {
        if ($2 =~ /^n/) {
            $split_node = 1;
            $split_node = 1;
        } else {
        } else {
            $split_chapter = 1;
            $split_chapter = 1;
        }
        }
        next;
        next;
    }
    }
    if (/^-v(erbose)?$/)     { $verbose = 1; next; }
    if (/^-v(erbose)?$/)     { $verbose = 1; next; }
    die $usage;
    die $usage;
}
}
if ($check) {
if ($check) {
    die $usage unless @ARGV > 0;
    die $usage unless @ARGV > 0;
    exit;
    exit;
}
}
if (($split_node || $split_chapter) && $monolithic) {
if (($split_node || $split_chapter) && $monolithic) {
    warn "Can't use -monolithic with -split, -monolithic ignored.\n";
    warn "Can't use -monolithic with -split, -monolithic ignored.\n";
    $monolithic = 0;
    $monolithic = 0;
}
}
if ($expandinfo) {
if ($expandinfo) {
    $to_skip{'ifinfo'}++;
    $to_skip{'ifinfo'}++;
    $to_skip{'end ifinfo'}++;
    $to_skip{'end ifinfo'}++;
} else {
} else {
    $to_skip{'iftex'}++;
    $to_skip{'iftex'}++;
    $to_skip{'end iftex'}++;
    $to_skip{'end iftex'}++;
}
}
$invisible_mark = '' if $invisible_mark eq 'xbm';
$invisible_mark = '' if $invisible_mark eq 'xbm';
die $usage unless @ARGV == 1;
die $usage 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(@include_dirs, $docu_dir);
unshift(@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_doc = "$docu_name.html";          # document's contents
$docu_doc = "$docu_name.html";          # document's contents
if ($monolithic) {
if ($monolithic) {
    $docu_toc = $docu_foot = $docu_doc;
    $docu_toc = $docu_foot = $docu_doc;
} else {
} else {
    $docu_toc  = "${docu_name}_toc.html";  # document's table of contents
    $docu_toc  = "${docu_name}_toc.html";  # document's table of contents
    $docu_foot = "${docu_name}_foot.html"; # document's footnotes
    $docu_foot = "${docu_name}_foot.html"; # document's footnotes
}
}
#
#
# variables
# variables
#
#
$value{'html'} = 1;                     # predefine html (the output format)
$value{'html'} = 1;                     # predefine html (the output format)
$value{'texi2html'} = '1.52';           # predefine texi2html (the translator)
$value{'texi2html'} = '1.52';           # predefine texi2html (the translator)
# _foo: internal to track @foo
# _foo: internal to track @foo
foreach ('_author', '_title', '_subtitle',
foreach ('_author', '_title', '_subtitle',
         '_settitle', '_setfilename') {
         '_settitle', '_setfilename') {
    $value{$_} = '';                    # prevent -w warnings
    $value{$_} = '';                    # prevent -w warnings
}
}
%node2sec = ();                         # node to section name
%node2sec = ();                         # node to section name
%node2href = ();                        # node to HREF
%node2href = ();                        # node to HREF
%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 ($use_iso) {
if ($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 $verbose;
    print "# reading extensions from $extensions\n" if $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 $verbose;
        print "# reading extensions from $extensions\n" if $verbose;
        require($extensions);
        require($extensions);
    }
    }
}
}
print "# reading from $docu\n" if $verbose;
print "# reading from $docu\n" if $verbose;
#+++############################################################################
#+++############################################################################
#                                                                              #
#                                                                              #
# 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
$toplevel = 0;                          # top level seen in hierarchy
$toplevel = 0;                          # top level seen in hierarchy
$curlevel = 0;                          # current level in TOC
$curlevel = 0;                          # current level in TOC
$node = '';                             # current node name
$node = '';                             # current node 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
$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
$split_num = 0;                         # split index
$split_num = 0;                         # split index
$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;
# 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 .= "([aeiou])/&\${1}$accent_map{$_};/gi;\n";
        $subst_code .= "([aeiou])/&\${1}$accent_map{$_};/gi;\n";
    }
    }
}
}
eval("sub simple_substitutions { $subst_code }");
eval("sub simple_substitutions { $subst_code }");
&init_input;
&init_input;
while ($_ = &next_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;
    }
    }
    #
    #
    # parse texinfo tags
    # parse texinfo tags
    #
    #
    $tag = '';
    $tag = '';
    $end_tag = '';
    $end_tag = '';
    if (/^\@end\s+(\w+)\b/) {
    if (/^\@end\s+(\w+)\b/) {
        $end_tag = $1;
        $end_tag = $1;
    } elsif (/^\@(\w+)\b/) {
    } elsif (/^\@(\w+)\b/) {
        $tag = $1;
        $tag = $1;
    }
    }
    #
    #
    # handle @ifhtml / @end ifhtml
    # handle @ifhtml / @end ifhtml
    #
    #
    if ($in_html) {
    if ($in_html) {
        if ($end_tag eq 'ifhtml') {
        if ($end_tag eq 'ifhtml') {
            $in_html = 0;
            $in_html = 0;
        } else {
        } else {
            $tag2pro{$in_html} .= $_;
            $tag2pro{$in_html} .= $_;
        }
        }
        next;
        next;
    } elsif ($tag eq 'ifhtml') {
    } elsif ($tag eq 'ifhtml') {
        $in_html = $PROTECTTAG . ++$html_num;
        $in_html = $PROTECTTAG . ++$html_num;
        push(@lines, $in_html);
        push(@lines, $in_html);
        next;
        next;
    }
    }
    #
    #
    # try to skip the line
    # try to skip the line
    #
    #
    if ($end_tag) {
    if ($end_tag) {
        next if $to_skip{"end $end_tag"};
        next if $to_skip{"end $end_tag"};
    } elsif ($tag) {
    } elsif ($tag) {
        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' || $tag eq 'include' || $sec2level{$tag}) {
        if ($tag eq 'node' || $tag eq 'include' || $sec2level{$tag}) {
            # no more in top
            # no more in top
            $in_top = 0;
            $in_top = 0;
        } else {
        } else {
            # skip it
            # skip it
            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/;
    # non-@ substitutions cf. texinfmt.el
    # non-@ substitutions cf. texinfmt.el
    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';
        if ($expandinfo) {
        if ($expandinfo) {
            &skip_until($tag), next if $tag eq 'iftex';
            &skip_until($tag), next if $tag eq 'iftex';
        } else {
        } else {
            &skip_until($tag), next if $tag eq 'ifinfo';
            &skip_until($tag), next if $tag eq 'ifinfo';
        }
        }
        &skip_until($tag), next if $tag eq 'tex';
        &skip_until($tag), next if $tag eq 'tex';
        # 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;
            @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') {
            $in_top = 0;
            $in_top = 0;
            warn "$ERROR Bad node line: $_" unless $_ =~ /^\@node\s$NODESRE$/o;
            warn "$ERROR Bad node line: $_" unless $_ =~ /^\@node\s$NODESRE$/o;
            $_ = &protect_html($_); # if node contains '&' for instance
            $_ = &protect_html($_); # if node contains '&' for instance
            s/^\@node\s+//;
            s/^\@node\s+//;
            ($node) = split(/,/);
            ($node) = split(/,/);
            &normalise_node($node);
            &normalise_node($node);
            if ($split_node) {
            if ($split_node) {
                &next_doc;
                &next_doc;
                push(@lines, $SPLITTAG) if $split_num++;
                push(@lines, $SPLITTAG) if $split_num++;
                push(@sections, $node);
                push(@sections, $node);
            }
            }
            next;
            next;
        } elsif ($tag eq 'include') {
        } elsif ($tag eq 'include') {
            if (/^\@include\s+($FILERE)\s*$/o) {
            if (/^\@include\s+($FILERE)\s*$/o) {
                $file = $1;
                $file = $1;
                unless (-e $file) {
                unless (-e $file) {
                    foreach $dir (@include_dirs) {
                    foreach $dir (@include_dirs) {
                        $file = "$dir/$1";
                        $file = "$dir/$1";
                        last if -e $file;
                        last if -e $file;
                    }
                    }
                }
                }
                if (-e $file) {
                if (-e $file) {
                    &open($file);
                    &open($file);
                    print "# including $file\n" if $verbose;
                    print "# including $file\n" if $verbose;
                } else {
                } else {
                    warn "$ERROR Can't find $file, skipping";
                    warn "$ERROR Can't find $file, 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 ($show_menu) {
            unless ($show_menu) {
                &skip_until($tag);
                &skip_until($tag);
                next;
                next;
            }
            }
            &html_push_if($tag);
            &html_push_if($tag);
            push(@lines, &html_debug("\n", __LINE__));
            push(@lines, &html_debug("\n", __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("\n", __LINE__));
            push(@lines, &html_debug("\n", __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("<$format_map{$tag}>\n", __LINE__));
            push(@lines, &debug("<$format_map{$tag}>\n", __LINE__));
            next;
            next;
        } elsif ($tag eq 'table') {
        } elsif ($tag eq 'table') {
            if (/^\@(|f|v|multi)table\s+\@(\w+)/) {
            if (/^\@(|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") {
                    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("\n", __LINE__));
                push(@lines, &html_debug("\n", __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)\w\s+(\w)\w\s*$/) {
            if (/^\@$tag\s+(\w)\w\s+(\w)\w\s*$/) {
                eval("*${1}index = *${2}index");
                eval("*${1}index = *${2}index");
            } else {
            } else {
                warn "$ERROR Bad syn*index line: $_";
                warn "$ERROR Bad syn*index line: $_";
            }
            }
            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 '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;
                $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 'defindex' || $tag eq 'defcodeindex') {
        } elsif ($tag eq 'defindex' || $tag eq 'defcodeindex') {
            if (/^\@$tag\s+(\w\w)\s*$/) {
            if (/^\@$tag\s+(\w\w)\s*$/) {
                $valid_index{$1} = 1;
                $valid_index{$1} = 1;
            } else {
            } else {
                warn "$ERROR Bad defindex line: $_";
                warn "$ERROR Bad defindex line: $_";
            }
            }
            next;
            next;
        } 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 $debug & $DEBUG_USER;
            print "# user $tag = $sub, arg: $_" if $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 $debug & $DEBUG_DEF;
                if $debug & $DEBUG_DEF;
            $type .= ':'; # it's nicer like this
            $type .= ':'; # it's nicer like this
            $name = shift(@args);
            $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') {
                unshift(@input_spool, "\@findex $name\n");
                unshift(@input_spool, "\@findex $name\n");
            } elsif ($tag eq 'defop') {
            } elsif ($tag eq 'defop') {
                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') {
                unshift(@input_spool, "\@vindex $name\n");
                unshift(@input_spool, "\@vindex $name\n");
            } else {
            } else {
                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('LI', 'P');
            &html_pop_if('LI', 'P');
            &html_pop_if();
            &html_pop_if();
            push(@lines, &debug("\n", __LINE__));
            push(@lines, &debug("\n", __LINE__));
            push(@lines, &html_debug("\n", __LINE__));
            push(@lines, &html_debug("\n", __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;
            }
            }
            ($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;
    }
    }
    #
    #
    # misc things
    # misc things
    #
    #
    # 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/^\@center\s+//g;
    s/^\@center\s+//g;
    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/\@value{($VARRE)}/$value{$1}/eg;
    s/\@value{($VARRE)}/$value{$1}/eg;
    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 =~ s/\s+$//;
                $name =~ s/\s+$//;
                $level = $sec2level{$tag};
                $level = $sec2level{$tag};
                $name = &update_sec_num($tag, $level) . "  $name"
                $name = &update_sec_num($tag, $level) . "  $name"
                    if $number_sections && $tag !~ /^unnumbered/;
                    if $number_sections && $tag !~ /^unnumbered/;
                if ($tag =~ /heading$/) {
                if ($tag =~ /heading$/) {
                    push(@lines, &html_debug("\n", __LINE__));
                    push(@lines, &html_debug("\n", __LINE__));
                    if ($html_element ne 'body') {
                    if ($html_element ne 'body') {
                        # We are in a nice pickle here. We are trying to get a H? heading
                        # We are in a nice pickle here. We are trying to get a H? heading
                        # even though we are not in the body level. So, we convert it to a
                        # even though we are not in the body level. So, we convert it to a
                        # nice, bold, line by itself.
                        # nice, bold, line by itself.
                        $_ = &debug("\n\n

$name

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

$name

\n\n", __LINE__);
                    } else {
                    } else {
                        $_ = &debug("$name\n", __LINE__);
                        $_ = &debug("$name\n", __LINE__);
                        &html_push_if('body');
                        &html_push_if('body');
                    }
                    }
                    print "# heading, section $name, level $level\n"
                    print "# heading, section $name, level $level\n"
                        if $debug & $DEBUG_TOC;
                        if $debug & $DEBUG_TOC;
                } else {
                } else {
                    if ($split_chapter) {
                    if ($split_chapter) {
                        unless ($toplevel) {
                        unless ($toplevel) {
                            # first time we see a "section"
                            # first time we see a "section"
                            unless ($level == 1) {
                            unless ($level == 1) {
                                warn "$ERROR The first section found is not of level 1: $_";
                                warn "$ERROR The first section found is not of level 1: $_";
                                warn "$ERROR I'll split on sections of level $level...\n";
                                warn "$ERROR I'll split on sections of level $level...\n";
                            }
                            }
                            $toplevel = $level;
                            $toplevel = $level;
                        }
                        }
                        if ($level == $toplevel) {
                        if ($level == $toplevel) {
                            &next_doc;
                            &next_doc;
                            push(@lines, $SPLITTAG) if $split_num++;
                            push(@lines, $SPLITTAG) if $split_num++;
                            push(@sections, $name);
                            push(@sections, $name);
                        }
                        }
                    }
                    }
                    $sec_num++;
                    $sec_num++;
                    $docid = "SEC$sec_num";
                    $docid = "SEC$sec_num";
                    $tocid = "TOC$sec_num";
                    $tocid = "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) {
                        if ($node2sec{$node}) {
                        if ($node2sec{$node}) {
                            warn "$ERROR Duplicate node found: $node\n";
                            warn "$ERROR Duplicate node found: $node\n";
                        } else {
                        } else {
                            $node2sec{$node} = $name;
                            $node2sec{$node} = $name;
                            $node2href{$node} = "$docu_doc#$docid";
                            $node2href{$node} = "$docu_doc#$docid";
                            print "# node $node, section $name, level $level\n"
                            print "# node $node, section $name, level $level\n"
                                if $debug & $DEBUG_TOC;
                                if $debug & $DEBUG_TOC;
                        }
                        }
                        $node = '';
                        $node = '';
                    } else {
                    } else {
                        print "# no node, section $name, level $level\n"
                        print "# no node, section $name, level $level\n"
                            if $debug & $DEBUG_TOC;
                            if $debug & $DEBUG_TOC;
                    }
                    }
                    # 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");
                    }
                    }
                    $_ = "
  • " . &anchor($tocid, "$docu_doc#$docid", $name, 1);
  •                     $_ = "
  • " . &anchor($tocid, "$docu_doc#$docid", $name, 1);
  •                     push(@toc_lines, &substitute_style($_));
                        push(@toc_lines, &substitute_style($_));
                        # update DOC
                        # update DOC
                        push(@lines, &html_debug("\n", __LINE__));
                        push(@lines, &html_debug("\n", __LINE__));
                        &html_reset;
                        &html_reset;
                        $_ =  "".&anchor($docid, "$docu_toc#$tocid", $name)."\n";
                        $_ =  "".&anchor($docid, "$docu_toc#$tocid", $name)."\n";
                        $_ = &debug($_, __LINE__);
                        $_ = &debug($_, __LINE__);
                        push(@lines, &html_debug("\n", __LINE__));
                        push(@lines, &html_debug("\n", __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} = $2, next if /^\@set\s+($VARRE)\s+(.*)$/o;
                $value{$1} = $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{'_setfilename'}   = $1, next if /^\@setfilename\s+(.*)$/;
                $value{'_setfilename'}   = $1, next if /^\@setfilename\s+(.*)$/;
                $value{'_settitle'}      = $1, next if /^\@settitle\s+(.*)$/;
                $value{'_settitle'}      = $1, next if /^\@settitle\s+(.*)$/;
                $value{'_author'}   .= "$1\n", next if /^\@author\s+(.*)$/;
                $value{'_author'}   .= "$1\n", next if /^\@author\s+(.*)$/;
                $value{'_subtitle'} .= "$1\n", next if /^\@subtitle\s+(.*)$/;
                $value{'_subtitle'} .= "$1\n", next if /^\@subtitle\s+(.*)$/;
                $value{'_title'}    .= "$1\n", next if /^\@title\s+(.*)$/;
                $value{'_title'}    .= "$1\n", next if /^\@title\s+(.*)$/;
                # index
                # index
                if (/^\@(..?)index\s+/) {
                if (/^\@(..?)index\s+/) {
                    unless ($valid_index{$1}) {
                    unless ($valid_index{$1}) {
                        warn "$ERROR Undefined index command: $_";
                        warn "$ERROR Undefined index command: $_";
                        next;
                        next;
                    }
                    }
                    $id = 'IDX' . ++$idx_num;
                    $id = 'IDX' . ++$idx_num;
                    $index = $1 . 'index';
                    $index = $1 . 'index';
                    $what = &substitute_style($');
                    $what = &substitute_style($');
                    $what =~ s/\s+$//;
                    $what =~ s/\s+$//;
                    print "# found $index for '$what' id $id\n"
                    print "# found $index for '$what' id $id\n"
                        if $debug & $DEBUG_INDEX;
                        if $debug & $DEBUG_INDEX;
                    eval(<
                    eval(<
                    if (defined(\$$index\{\$what\})) {
                    if (defined(\$$index\{\$what\})) {
                        \$$index\{\$what\} .= "$;$docu_doc#$id";
                        \$$index\{\$what\} .= "$;$docu_doc#$id";
                    } else {
                    } else {
                        \$$index\{\$what\} = "$docu_doc#$id";
                        \$$index\{\$what\} = "$docu_doc#$id";
                    }
                    }
    EOC
    EOC
                    #
                    #
                    # dirty hack to see if I can put an invisible anchor...
                    # dirty hack to see if I can put an invisible anchor...
                    #
                    #
                    if ($html_element eq 'P' ||
                    if ($html_element eq 'P' ||
                        $html_element eq 'LI' ||
                        $html_element eq 'LI' ||
                        $html_element eq 'DT' ||
                        $html_element eq 'DT' ||
                        $html_element eq 'DD' ||
                        $html_element eq 'DD' ||
                        $html_element eq 'ADDRESS' ||
                        $html_element eq 'ADDRESS' ||
                        $html_element eq 'B' ||
                        $html_element eq 'B' ||
                        $html_element eq 'BLOCKQUOTE' ||
                        $html_element eq 'BLOCKQUOTE' ||
                        $html_element eq 'PRE' ||
                        $html_element eq 'PRE' ||
                        $html_element eq 'SAMP') {
                        $html_element eq 'SAMP') {
                        push(@lines, &anchor($id, '', $invisible_mark, !$in_pre));
                        push(@lines, &anchor($id, '', $invisible_mark, !$in_pre));
                    } elsif ($html_element eq 'body') {
                    } elsif ($html_element eq 'body') {
                        push(@lines, &debug("

    \n", __LINE__));

                        push(@lines, &debug("

    \n", __LINE__));

                        push(@lines, &anchor($id, '', $invisible_mark, !$in_pre));
                        push(@lines, &anchor($id, '', $invisible_mark, !$in_pre));
                        &html_push('P');
                        &html_push('P');
                    } elsif ($html_element eq 'DL' ||
                    } elsif ($html_element eq 'DL' ||
                             $html_element eq 'UL' ||
                             $html_element eq 'UL' ||
                             $html_element eq 'OL' ) {
                             $html_element eq 'OL' ) {
                        $deferred_ref .= &anchor($id, '', $invisible_mark, !$in_pre) . " ";
                        $deferred_ref .= &anchor($id, '', $invisible_mark, !$in_pre) . " ";
                    }
                    }
                    next;
                    next;
                }
                }
                # list item
                # list item
                if (/^\@itemx?\s+/) {
                if (/^\@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 $debug & $DEBUG_BIB;
                                if $debug & $DEBUG_BIB;
                            $what = &anchor($id, '', $what);
                            $what = &anchor($id, '', $what);
                        }
                        }
                    } elsif ($in_glossary && $use_glossary) {
                    } elsif ($in_glossary && $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 $debug & $DEBUG_GLOSS;
                            if $debug & $DEBUG_GLOSS;
                        $what = &anchor($id, '', $what);
                        $what = &anchor($id, '', $what);
                    }
                    }
                    &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("\n", __LINE__));
                    push(@lines, &html_debug("\n", __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") {
        if ($_ eq "\n") {
            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, "\n");
                push(@lines, "\n");
                $_ = &debug("

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

    \n", __LINE__);
                &html_pop;
                &html_pop;
            }
            }
        } elsif ($html_element eq 'body' || $html_element eq 'BLOCKQUOTE') {
        } elsif ($html_element eq 'body' || $html_element eq 'BLOCKQUOTE') {
            push(@lines, "

    \n");

            push(@lines, "

    \n");

            &html_push('P');
            &html_push('P');
            $_ = &debug($_, __LINE__);
            $_ = &debug($_, __LINE__);
        }
        }
        # otherwise
        # otherwise
        push(@lines, $_);
        push(@lines, $_);
    }
    }
    # 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 $verbose;
    print "# end of pass 1\n" if $verbose;
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # 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
        #
        #
        $in_menu = 1, push(@lines2, &debug("
      \n", __LINE__)), next if /^\@menu\b/;
        $in_menu = 1, push(@lines2, &debug("
      \n", __LINE__)), next if /^\@menu\b/;
        $in_menu = 0, push(@lines2, &debug("\n", __LINE__)), next if /^\@end\s+menu\b/;
        $in_menu = 0, push(@lines2, &debug("\n", __LINE__)), next if /^\@end\s+menu\b/;
        if ($in_menu) {
        if ($in_menu) {
            if (/^\*\s+($NODERE)::/o) {
            if (/^\*\s+($NODERE)::/o) {
                $descr = $';
                $descr = $';
                chop($descr);
                chop($descr);
                &menu_entry($1, $1, $descr);
                &menu_entry($1, $1, $descr);
            } elsif (/^\*\s+(.+):\s+([^\t,\.\n]+)[\t,\.\n]/) {
            } elsif (/^\*\s+(.+):\s+([^\t,\.\n]+)[\t,\.\n]/) {
                $descr = $';
                $descr = $';
                chop($descr);
                chop($descr);
                &menu_entry($1, $2, $descr);
                &menu_entry($1, $2, $descr);
            } elsif (/^\*/) {
            } elsif (/^\*/) {
                warn "$ERROR Bad menu line: $_";
                warn "$ERROR Bad menu line: $_";
            } else { # description continued?
            } else { # description continued?
                push(@lines2, $_);
                push(@lines2, $_);
            }
            }
            next;
            next;
        }
        }
        #
        #
        # printindex
        # printindex
        #
        #
        if (/^\@printindex\s+(\w\w)\b/) {
        if (/^\@printindex\s+(\w\w)\b/) {
            local($index, *ary, @keys, $key, $letter, $last_letter, @refs);
            local($index, *ary, @keys, $key, $letter, $last_letter, @refs);
            if ($predefined_index{$1}) {
            if ($predefined_index{$1}) {
                $index = $predefined_index{$1} . 'index';
                $index = $predefined_index{$1} . 'index';
            } else {
            } else {
                $index = $1 . 'index';
                $index = $1 . 'index';
            }
            }
            eval("*ary = *$index");
            eval("*ary = *$index");
            @keys = keys(%ary);
            @keys = keys(%ary);
            foreach $key (@keys) {
            foreach $key (@keys) {
                $_ = $key;
                $_ = $key;
                1 while s/<(\w+)>\`(.*)\'<\/\1>/$2/; # remove HTML tags with quotes
                1 while s/<(\w+)>\`(.*)\'<\/\1>/$2/; # remove HTML tags with quotes
                1 while s/<(\w+)>(.*)<\/\1>/$2/;     # remove HTML tags
                1 while s/<(\w+)>(.*)<\/\1>/$2/;     # remove HTML tags
                $_ = &unprotect_html($_);
                $_ = &unprotect_html($_);
                &unprotect_texi;
                &unprotect_texi;
                tr/A-Z/a-z/; # lowercase
                tr/A-Z/a-z/; # lowercase
                $key2alpha{$key} = $_;
                $key2alpha{$key} = $_;
                print "# index $key sorted as $_\n"
                print "# index $key sorted as $_\n"
                    if $key ne $_ && $debug & $DEBUG_INDEX;
                    if $key ne $_ && $debug & $DEBUG_INDEX;
            }
            }
            push(@lines2, "Jump to:\n");
            push(@lines2, "Jump to:\n");
            $last_letter = undef;
            $last_letter = undef;
            foreach $key (sort byalpha @keys) {
            foreach $key (sort byalpha @keys) {
                $letter = substr($key2alpha{$key}, 0, 1);
                $letter = substr($key2alpha{$key}, 0, 1);
                $letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;;
                $letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;;
                if (!defined($last_letter) || $letter ne $last_letter) {
                if (!defined($last_letter) || $letter ne $last_letter) {
                    push(@lines2, "-\n") if defined($last_letter);
                    push(@lines2, "-\n") if defined($last_letter);
                    push(@lines2, "" . &protect_html($letter) . "\n");
                    push(@lines2, "" . &protect_html($letter) . "\n");
                    $last_letter = $letter;
                    $last_letter = $letter;
                }
                }
            }
            }
            push(@lines2, "

    \n");

            push(@lines2, "

    \n");

            $last_letter = undef;
            $last_letter = undef;
            foreach $key (sort byalpha @keys) {
            foreach $key (sort byalpha @keys) {
                $letter = substr($key2alpha{$key}, 0, 1);
                $letter = substr($key2alpha{$key}, 0, 1);
                $letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;;
                $letter = substr($key2alpha{$key}, 0, 2) if $letter eq $;;
                if (!defined($last_letter) || $letter ne $last_letter) {
                if (!defined($last_letter) || $letter ne $last_letter) {
                    push(@lines2, "\n") if defined($last_letter);
                    push(@lines2, "\n") if defined($last_letter);
                    push(@lines2, "

    " . &protect_html($letter) . "

    \n");
                    push(@lines2, "

    " . &protect_html($letter) . "

    \n");
                    push(@lines2, "\n");
                    push(@lines2, "\n");
                    $last_letter = $letter;
                    $last_letter = $letter;
                }
                }
                @refs = ();
                @refs = ();
                foreach (split(/$;/, $ary{$key})) {
                foreach (split(/$;/, $ary{$key})) {
                    push(@refs, &anchor('', $_, $key, 0));
                    push(@refs, &anchor('', $_, $key, 0));
                }
                }
                push(@lines2, "
  • " . join(", ", @refs) . "\n");
  •             push(@lines2, "
  • " . join(", ", @refs) . "\n");
  •         }
            }
            push(@lines2, "\n") if defined($last_letter);
            push(@lines2, "\n") if defined($last_letter);
            next;
            next;
        }
        }
        #
        #
        # simple style substitutions
        # simple style substitutions
        #
        #
        $_ = &substitute_style($_);
        $_ = &substitute_style($_);
        #
        #
        # xref
        # xref
        #
        #
        while (/\@(x|px|info|)ref{($XREFRE)(}?)/o) {
        while (/\@(x|px|info|)ref{($XREFRE)(}?)/o) {
            # 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 = 'See ';
                $type = 'See ';
            } elsif ($type eq 'px') {
            } elsif ($type eq 'px') {
                $type = 'see ';
                $type = 'see ';
            } elsif ($type eq 'info') {
            } elsif ($type eq 'info') {
                $type = 'See Info';
                $type = '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
            &normalise_node($node);
            &normalise_node($node);
            $sec = $node2sec{$node};
            $sec = $node2sec{$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}section `$sec' in \@cite{$man}$after";
                $_ = "${before}${type}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) {
            } elsif ($sec) {
                $href = $node2href{$node};
                $href = $node2href{$node};
                $_ = "${before}${type}section " . &anchor('', $href, $sec) . $after;
                $_ = "${before}${type}section " . &anchor('', $href, $sec) . $after;
            } else {
            } else {
                warn "$ERROR Undefined node ($node): $_";
                warn "$ERROR Undefined node ($node): $_";
                $_ = "$before$;0xref{$nodes}$after";
                $_ = "$before$;0xref{$nodes}$after";
            }
            }
        }
        }
        #
        #
        # 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 . &anchor('', $href, $what);
                        $done .= $pre . &anchor('', $href, $what);
                    } else {
                    } else {
                        $done .= "$pre$what";
                        $done .= "$pre$what";
                    }
                    }
                    $_ = $post;
                    $_ = $post;
                }
                }
                $_ = $done . $_;
                $_ = $done . $_;
            }
            }
            if ($use_glossary) {
            if ($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 . &anchor('', $href, $what);
                        $done .= $pre . &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 $verbose;
    print "# end of pass 2\n" if $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 $verbose;
    print "# end of pass 3\n" if $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, "

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

    \n");
                push(@foot_lines, "

    " . &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 . &anchor($docid, "$docu_foot#$footid", $foot) . $after;
                $_ = $before . &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 $verbose;
    print "# end of pass 4\n" if $verbose;
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # Pass 5: print things                                                         #
    # Pass 5: print things                                                         #
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    $header = <
    $header = <
         from $docu on $TODAY -->
    EOT
    EOT
    $full_title = $value{'_title'} || $value{'_settitle'} || "Untitled Document";
    $full_title = $value{'_title'} || $value{'_settitle'} || "Untitled Document";
    $title = $value{'_settitle'} || $full_title;
    $title = $value{'_settitle'} || $full_title;
    $_ = &substitute_style($full_title);
    $_ = &substitute_style($full_title);
    &unprotect_texi;
    &unprotect_texi;
    s/\n$//; # rmv last \n (if any)
    s/\n$//; # rmv last \n (if any)
    $full_title = "

    " . join("

    \n

    ", split(/\n/, $_)) . "

    \n";
    $full_title = "

    " . join("

    \n

    ", split(/\n/, $_)) . "

    \n";
    #
    #
    # print ToC
    # print ToC
    #
    #
    if (!$monolithic && @toc_lines) {
    if (!$monolithic && @toc_lines) {
        if (open(FILE, "> $docu_toc")) {
        if (open(FILE, "> $docu_toc")) {
            print "# creating $docu_toc...\n" if $verbose;
            print "# creating $docu_toc...\n" if $verbose;
            &print_toplevel_header("$title - Table of Contents");
            &print_toplevel_header("$title - Table of Contents");
            &print_ruler;
            &print_ruler;
            &print(*toc_lines, FILE);
            &print(*toc_lines, FILE);
            &print_toplevel_footer;
            &print_toplevel_footer;
            close(FILE);
            close(FILE);
        } else {
        } else {
            warn "$ERROR Can't write to $docu_toc: $!\n";
            warn "$ERROR Can't write to $docu_toc: $!\n";
        }
        }
    }
    }
    #
    #
    # print footnotes
    # print footnotes
    #
    #
    if (!$monolithic && @foot_lines) {
    if (!$monolithic && @foot_lines) {
        if (open(FILE, "> $docu_foot")) {
        if (open(FILE, "> $docu_foot")) {
            print "# creating $docu_foot...\n" if $verbose;
            print "# creating $docu_foot...\n" if $verbose;
            &print_toplevel_header("$title - Footnotes");
            &print_toplevel_header("$title - Footnotes");
            &print_ruler;
            &print_ruler;
            &print(*foot_lines, FILE);
            &print(*foot_lines, FILE);
            &print_toplevel_footer;
            &print_toplevel_footer;
            close(FILE);
            close(FILE);
        } else {
        } else {
            warn "$ERROR Can't write to $docu_foot: $!\n";
            warn "$ERROR Can't write to $docu_foot: $!\n";
        }
        }
    }
    }
    #
    #
    # print document
    # print document
    #
    #
    if ($split_chapter || $split_node) { # split
    if ($split_chapter || $split_node) { # split
        $doc_num = 0;
        $doc_num = 0;
        $last_num = scalar(@sections);
        $last_num = scalar(@sections);
        $first_doc = &doc_name(1);
        $first_doc = &doc_name(1);
        $last_doc = &doc_name($last_num);
        $last_doc = &doc_name($last_num);
        while (@sections) {
        while (@sections) {
            $section = shift(@sections);
            $section = shift(@sections);
            &next_doc;
            &next_doc;
            if (open(FILE, "> $docu_doc")) {
            if (open(FILE, "> $docu_doc")) {
                print "# creating $docu_doc...\n" if $verbose;
                print "# creating $docu_doc...\n" if $verbose;
                &print_header("$title - $section");
                &print_header("$title - $section");
                $prev_doc = ($doc_num == 1 ? undef : &doc_name($doc_num - 1));
                $prev_doc = ($doc_num == 1 ? undef : &doc_name($doc_num - 1));
                $next_doc = ($doc_num == $last_num ? undef : &doc_name($doc_num + 1));
                $next_doc = ($doc_num == $last_num ? undef : &doc_name($doc_num + 1));
                $navigation = "Go to the ";
                $navigation = "Go to the ";
                $navigation .= ($prev_doc ? &anchor('', $first_doc, "first") : "first");
                $navigation .= ($prev_doc ? &anchor('', $first_doc, "first") : "first");
                $navigation .= ", ";
                $navigation .= ", ";
                $navigation .= ($prev_doc ? &anchor('', $prev_doc, "previous") : "previous");
                $navigation .= ($prev_doc ? &anchor('', $prev_doc, "previous") : "previous");
                $navigation .= ", ";
                $navigation .= ", ";
                $navigation .= ($next_doc ? &anchor('', $next_doc, "next") : "next");
                $navigation .= ($next_doc ? &anchor('', $next_doc, "next") : "next");
                $navigation .= ", ";
                $navigation .= ", ";
                $navigation .= ($next_doc ? &anchor('', $last_doc, "last") : "last");
                $navigation .= ($next_doc ? &anchor('', $last_doc, "last") : "last");
                $navigation .= " section, " . &anchor('', $docu_toc, "table of contents") . ".\n";
                $navigation .= " section, " . &anchor('', $docu_toc, "table of contents") . ".\n";
                print FILE $navigation;
                print FILE $navigation;
                &print_ruler;
                &print_ruler;
                # find corresponding lines
                # find corresponding lines
                @tmp_lines = ();
                @tmp_lines = ();
                while (@doc_lines) {
                while (@doc_lines) {
                    $_ = shift(@doc_lines);
                    $_ = shift(@doc_lines);
                    last if ($_ eq $SPLITTAG);
                    last if ($_ eq $SPLITTAG);
                    push(@tmp_lines, $_);
                    push(@tmp_lines, $_);
                }
                }
                &print(*tmp_lines, FILE);
                &print(*tmp_lines, FILE);
                &print_ruler;
                &print_ruler;
                print FILE $navigation;
                print FILE $navigation;
                &print_footer;
                &print_footer;
                close(FILE);
                close(FILE);
            } else {
            } else {
                warn "$ERROR Can't write to $docu_doc: $!\n";
                warn "$ERROR Can't write to $docu_doc: $!\n";
            }
            }
        }
        }
    } else { # not split
    } else { # not split
        if (open(FILE, "> $docu_doc")) {
        if (open(FILE, "> $docu_doc")) {
            print "# creating $docu_doc...\n" if $verbose;
            print "# creating $docu_doc...\n" if $verbose;
            if ($monolithic || !@toc_lines) {
            if ($monolithic || !@toc_lines) {
                &print_toplevel_header($title);
                &print_toplevel_header($title);
            } else {
            } else {
                &print_header($title);
                &print_header($title);
                print FILE $full_title;
                print FILE $full_title;
            }
            }
            if ($monolithic && @toc_lines) {
            if ($monolithic && @toc_lines) {
                &print_ruler;
                &print_ruler;
                print FILE "

    Table of Contents

    \n";
                print FILE "

    Table of Contents

    \n";
                &print(*toc_lines, FILE);
                &print(*toc_lines, FILE);
            }
            }
            &print_ruler;
            &print_ruler;
            &print(*doc_lines, FILE);
            &print(*doc_lines, FILE);
            if ($monolithic && @foot_lines) {
            if ($monolithic && @foot_lines) {
                &print_ruler;
                &print_ruler;
                print FILE "

    Footnotes

    \n";
                print FILE "

    Footnotes

    \n";
                &print(*foot_lines, FILE);
                &print(*foot_lines, FILE);
            }
            }
            if ($monolithic || !@toc_lines) {
            if ($monolithic || !@toc_lines) {
                &print_toplevel_footer;
                &print_toplevel_footer;
            } else {
            } else {
                &print_footer;
                &print_footer;
            }
            }
            close(FILE);
            close(FILE);
        } else {
        } else {
            warn "$ERROR Can't write to $docu_doc: $!\n";
            warn "$ERROR Can't write to $docu_doc: $!\n";
        }
        }
    }
    }
    print "# that's all folks\n" if $verbose;
    print "# that's all folks\n" if $verbose;
    #+++############################################################################
    #+++############################################################################
    #                                                                              #
    #                                                                              #
    # Low level functions                                                          #
    # Low level functions                                                          #
    #                                                                              #
    #                                                                              #
    #---############################################################################
    #---############################################################################
    sub update_sec_num {
    sub update_sec_num {
        local($name, $level) = @_;
        local($name, $level) = @_;
        $level--; # here we start at 0
        $level--; # here we start at 0
        if ($name =~ /^appendix/) {
        if ($name =~ /^appendix/) {
            # 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);
            }
            }
            return(join('.', @appendix_sec_num[0..$level]));
            return(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);
            }
            }
            return(join('.', @normal_sec_num[0..$level]));
            return(join('.', @normal_sec_num[0..$level]));
        }
        }
    }
    }
    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 check {
    sub check {
        local($_, %seen, %context, $before, $match, $after);
        local($_, %seen, %context, $before, $match, $after);
        while (<>) {
        while (<>) {
            if (/\@(\*|\.|\:|\@|\{|\})/) {
            if (/\@(\*|\.|\:|\@|\{|\})/) {
                $seen{$&}++;
                $seen{$&}++;
                $context{$&} .= "> $_" if $verbose;
                $context{$&} .= "> $_" if $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 $verbose;
                    $context{'e-mail address'} .= "> $_" if $verbose;
                } else {
                } else {
                    $seen{$match}++;
                    $seen{$match}++;
                    $context{$match} .= "> $_" if $verbose;
                    $context{$match} .= "> $_" if $verbose;
                }
                }
                $match =~ s/^\@/X/;
                $match =~ s/^\@/X/;
                $_ = "$before$match$after";
                $_ = "$before$match$after";
                redo;
                redo;
            }
            }
        }
        }
        foreach (sort(keys(%seen))) {
        foreach (sort(keys(%seen))) {
            if ($verbose) {
            if ($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];
    }
    }
    #
    #
    # 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) = @_;
        return("$what")
        return("$what")
            if $debug & $DEBUG_HTML;
            if $debug & $DEBUG_HTML;
        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 $debug & $DEBUG_HTML;
            if $debug & $DEBUG_HTML;
        return($what);
        return($what);
    }
    }
    sub normalise_node {
    sub normalise_node {
        $_[0] =~ s/\s+/ /g;
        $_[0] =~ s/\s+/ /g;
        $_[0] =~ s/ $//;
        $_[0] =~ s/ $//;
        $_[0] =~ s/^ //;
        $_[0] =~ s/^ //;
    }
    }
    sub menu_entry {
    sub menu_entry {
        local($entry, $node, $descr) = @_;
        local($entry, $node, $descr) = @_;
        local($href);
        local($href);
        &normalise_node($node);
        &normalise_node($node);
        $href = $node2href{$node};
        $href = $node2href{$node};
        if ($href) {
        if ($href) {
            $descr =~ s/^\s+//;
            $descr =~ s/^\s+//;
            $descr = ": $descr" if $descr;
            $descr = ": $descr" if $descr;
            push(@lines2, "
  • " . &anchor('', $href, $entry) . "$descr\n");
  •         push(@lines2, "
  • " . &anchor('', $href, $entry) . "$descr\n");
  •     } else {
        } else {
            warn "$ERROR Undefined node ($node): $_";
            warn "$ERROR Undefined node ($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;
        &anchor('', "mailto:$addr", $text);
        &anchor('', "mailto:$addr", $text);
    }
    }
    sub do_sc { "\U$_[0]\E" }
    sub do_sc { "\U$_[0]\E" }
    sub do_uref {
    sub do_uref {
        local($url, $text) = split(/,\s*/, $_[0]);
        local($url, $text) = split(/,\s*/, $_[0]);
        $text = $url unless $text;
        $text = $url unless $text;
        &anchor('', $url, $text);
        &anchor('', $url, $text);
    }
    }
    sub do_url { &anchor('', $_[0], $_[0]) }
    sub do_url { &anchor('', $_[0], $_[0]) }
    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);
                $text = &$style($text);
            } 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($_) = @_;
        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);
        $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 anchor {
    sub anchor {
        local($name, $href, $text, $newline) = @_;
        local($name, $href, $text, $newline) = @_;
        local($result);
        local($result);
        $result = "
        $result = "
        $result .= " NAME=\"$name\"" if $name;
        $result .= " NAME=\"$name\"" if $name;
        $result .= " HREF=\"$href\"" if $href;
        $result .= " HREF=\"$href\"" if $href;
        $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', 'Febuary', 'March', 'April', 'May', 'June',
        @MoY = ('January', 'Febuary', '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;
        return("$mday $MoY[$mon] $year");
        return("$mday $MoY[$mon] $year");
    }
    }
    sub doc_name {
    sub doc_name {
        local($num) = @_;
        local($num) = @_;
        return("${docu_name}_$num.html");
        return("${docu_name}_$num.html");
    }
    }
    sub next_doc {
    sub next_doc {
        $docu_doc = &doc_name(++$doc_num);
        $docu_doc = &doc_name(++$doc_num);
    }
    }
    sub print {
    sub print {
        local(*lines, $fh) = @_;
        local(*lines, $fh) = @_;
        local($_);
        local($_);
        while (@lines) {
        while (@lines) {
            $_ = shift(@lines);
            $_ = shift(@lines);
            if (/^$PROTECTTAG/o) {
            if (/^$PROTECTTAG/o) {
                $_ = $tag2pro{$_};
                $_ = $tag2pro{$_};
            } else {
            } else {
                &unprotect_texi;
                &unprotect_texi;
            }
            }
            print $fh $_;
            print $fh $_;
        }
        }
    }
    }
    sub print_ruler {
    sub print_ruler {
        print FILE "


    \n";

        print FILE "


    \n";

    }
    }
    sub print_header {
    sub print_header {
        local($_);
        local($_);
        # clean the title
        # clean the title
        $_ = &remove_style($_[0]);
        $_ = &remove_style($_[0]);
        &unprotect_texi;
        &unprotect_texi;
        # print the header
        # print the header
        if ($doctype eq 'html2') {
        if ($doctype eq 'html2') {
            print FILE $html2_doctype;
            print FILE $html2_doctype;
        } elsif ($doctype) {
        } elsif ($doctype) {
            print FILE $doctype;
            print FILE $doctype;
        }
        }
        print FILE <
        print FILE <
    $header
    $header
    $_
    $_
    EOT
    EOT
    }
    }
    sub print_toplevel_header {
    sub print_toplevel_header {
        local($_);
        local($_);
        &print_header; # pass given arg...
        &print_header; # pass given arg...
        print FILE $full_title;
        print FILE $full_title;
        if ($value{'_subtitle'}) {
        if ($value{'_subtitle'}) {
            $value{'_subtitle'} =~ s/\n+$//;
            $value{'_subtitle'} =~ s/\n+$//;
            foreach (split(/\n/, $value{'_subtitle'})) {
            foreach (split(/\n/, $value{'_subtitle'})) {
                $_ = &substitute_style($_);
                $_ = &substitute_style($_);
                &unprotect_texi;
                &unprotect_texi;
                print FILE "

    $_

    \n";
                print FILE "

    $_

    \n";
            }
            }
        }
        }
        if ($value{'_author'}) {
        if ($value{'_author'}) {
            $value{'_author'} =~ s/\n+$//;
            $value{'_author'} =~ s/\n+$//;
            foreach (split(/\n/, $value{'_author'})) {
            foreach (split(/\n/, $value{'_author'})) {
                $_ = &substitute_style($_);
                $_ = &substitute_style($_);
                &unprotect_texi;
                &unprotect_texi;
                s/[\w.-]+\@[\w.-]+/$&<\/A>/g;
                s/[\w.-]+\@[\w.-]+/$&<\/A>/g;
                print FILE "
    $_
    \n";
                print FILE "
    $_
    \n";
            }
            }
        }
        }
        print FILE "

    \n";

        print FILE "

    \n";

    }
    }
    sub print_footer {
    sub print_footer {
        print FILE <
        print FILE <
    EOT
    EOT
    }
    }
    sub print_toplevel_footer {
    sub print_toplevel_footer {
        &print_ruler;
        &print_ruler;
        print FILE <
        print FILE <
    This document was generated on $TODAY using the
    This document was generated on $TODAY using the
    texi2html
    texi2html
    translator version 1.52.

    translator version 1.52.

    EOT
    EOT
        &print_footer;
        &print_footer;
    }
    }
    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;
        # 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_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 byalpha {
    sub byalpha {
        $key2alpha{$a} cmp $key2alpha{$b};
        $key2alpha{$a} cmp $key2alpha{$b};
    }
    }
    ##############################################################################
    ##############################################################################
            # 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 ############
    .TH TEXI2HTML 1 "01/05/98"
    .TH TEXI2HTML 1 "01/05/98"
    .AT 3
    .AT 3
    .SH NAME
    .SH NAME
    texi2html \- a Texinfo to HTML converter
    texi2html \- a Texinfo to HTML converter
    .SH SYNOPSIS
    .SH SYNOPSIS
    .B texi2html [options] file
    .B texi2html [options] file
    .PP
    .PP
    .B texi2html -check [-verbose] files
    .B texi2html -check [-verbose] files
    .SH DESCRIPTION
    .SH DESCRIPTION
    .I Texi2html
    .I Texi2html
    converts the given Texinfo file to a set of HTML files. It tries to handle
    converts the given Texinfo file to a set of HTML files. It tries to handle
    most of the Texinfo commands. It creates hypertext links for cross-references,
    most of the Texinfo commands. It creates hypertext links for cross-references,
    footnotes...
    footnotes...
    .PP
    .PP
    It also tries to add links from a reference to its corresponding entry in the
    It also tries to add links from a reference to its corresponding entry in the
    bibliography (if any). It may also handle a glossary (see the
    bibliography (if any). It may also handle a glossary (see the
    .B \-glossary
    .B \-glossary
    option).
    option).
    .PP
    .PP
    .I Texi2html
    .I Texi2html
    creates several files depending on the contents of the Texinfo file and on
    creates several files depending on the contents of the Texinfo file and on
    the chosen options (see FILES).
    the chosen options (see FILES).
    .PP
    .PP
    The HTML files created by
    The HTML files created by
    .I texi2html
    .I texi2html
    are closer to TeX than to Info, that's why
    are closer to TeX than to Info, that's why
    .I texi2html
    .I texi2html
    converts @iftex sections and not @ifinfo ones by default. You can reverse
    converts @iftex sections and not @ifinfo ones by default. You can reverse
    this with the \-expandinfo option.
    this with the \-expandinfo option.
    .SH OPTIONS
    .SH OPTIONS
    .TP 12
    .TP 12
    .B \-check
    .B \-check
    Check the given file and give the list of all things that may be Texinfo commands.
    Check the given file and give the list of all things that may be Texinfo commands.
    This may be used to check the output of
    This may be used to check the output of
    .I texi2html
    .I texi2html
    to find the Texinfo commands that have been left in the HTML file.
    to find the Texinfo commands that have been left in the HTML file.
    .TP
    .TP
    .B \-expandinfo
    .B \-expandinfo
    Expand @ifinfo sections, not @iftex ones.
    Expand @ifinfo sections, not @iftex ones.
    .TP
    .TP
    .B \-glossary
    .B \-glossary
    Use the section named 'Glossary' to build a list of terms and put links in the HTML
    Use the section named 'Glossary' to build a list of terms and put links in the HTML
    document from each term toward its definition.
    document from each term toward its definition.
    .TP
    .TP
    .B \-invisible \fIname\fP
    .B \-invisible \fIname\fP
    Use \fIname\fP to create invisible destination anchors for index links
    Use \fIname\fP to create invisible destination anchors for index links
    (you can for instance use the invisible.xbm file shipped with this program).
    (you can for instance use the invisible.xbm file shipped with this program).
    This is a workaround for a known bug of many WWW browsers, including netscape.
    This is a workaround for a known bug of many WWW browsers, including netscape.
    .TP
    .TP
    .B \-I \fIdir\fP
    .B \-I \fIdir\fP
    Look also in \fIdir\fP to find included files.
    Look also in \fIdir\fP to find included files.
    .TP
    .TP
    .B \-menu
    .B \-menu
    Show the Texinfo menus; by default they are ignored.
    Show the Texinfo menus; by default they are ignored.
    .TP
    .TP
    .B \-monolithic
    .B \-monolithic
    Output only one file, including the table of contents and footnotes.
    Output only one file, including the table of contents and footnotes.
    .TP
    .TP
    .B \-number
    .B \-number
    Number the sections.
    Number the sections.
    .TP
    .TP
    .B \-split_chapter
    .B \-split_chapter
    Split the output into several HTML files (one per main section:
    Split the output into several HTML files (one per main section:
    chapter, appendix...).
    chapter, appendix...).
    .TP
    .TP
    .B \-split_node
    .B \-split_node
    Split the output into several HTML files (one per node).
    Split the output into several HTML files (one per node).
    .TP
    .TP
    .B \-usage
    .B \-usage
    Print usage instructions, listing the current available command-line options.
    Print usage instructions, listing the current available command-line options.
    .TP
    .TP
    .B \-verbose
    .B \-verbose
    Give a verbose output. Can be used with the
    Give a verbose output. Can be used with the
    .B \-check
    .B \-check
    option.
    option.
    .PP
    .PP
    .SH FILES
    .SH FILES
    By default
    By default
    .I texi2html
    .I texi2html
    creates the following files (foo being the name of the Texinfo file):
    creates the following files (foo being the name of the Texinfo file):
    .TP 16
    .TP 16
    .B foo_toc.html
    .B foo_toc.html
    The table of contents.
    The table of contents.
    .TP
    .TP
    .B foo.html
    .B foo.html
    The document's contents.
    The document's contents.
    .TP
    .TP
    .B foo_foot.html
    .B foo_foot.html
    The footnotes (if any).
    The footnotes (if any).
    .PP
    .PP
    When used with the
    When used with the
    .B \-split
    .B \-split
    option, it creates several files (one per chapter or node), named
    option, it creates several files (one per chapter or node), named
    .B foo_n.html
    .B foo_n.html
    (n being the indice of the chapter or node), instead of the single
    (n being the indice of the chapter or node), instead of the single
    .B foo.html
    .B foo.html
    file.
    file.
    .PP
    .PP
    When used with the
    When used with the
    .B \-monolithic
    .B \-monolithic
    option, it creates only one file:
    option, it creates only one file:
    .B foo.html
    .B foo.html
    .SH VARIABLES
    .SH VARIABLES
    .I texi2html
    .I texi2html
    predefines the following variables: \fBhtml\fP, \fBtexi2html\fP.
    predefines the following variables: \fBhtml\fP, \fBtexi2html\fP.
    .SH ADDITIONAL COMMANDS
    .SH ADDITIONAL COMMANDS
    .I texi2html
    .I texi2html
    implements the following non-Texinfo commands (maybe they are in Texinfo now...):
    implements the following non-Texinfo commands (maybe they are in Texinfo now...):
    .TP 16
    .TP 16
    .B @ifhtml
    .B @ifhtml
    This indicates the start of an HTML section, this section will passed through
    This indicates the start of an HTML section, this section will passed through
    without any modification.
    without any modification.
    .TP
    .TP
    .B @end ifhtml
    .B @end ifhtml
    This indicates the end of an HTML section.
    This indicates the end of an HTML section.
    .SH VERSION
    .SH VERSION
    This is \fItexi2html\fP version 1.52, 01/05/98.
    This is \fItexi2html\fP version 1.52, 01/05/98.
    .PP
    .PP
    The latest version of \fItexi2html\fP can be found in WWW, cf. URL
    The latest version of \fItexi2html\fP can be found in WWW, cf. URL
    http://wwwinfo.cern.ch/dis/texi2html/
    http://wwwinfo.cern.ch/dis/texi2html/
    .SH AUTHOR
    .SH AUTHOR
    The main author is Lionel Cons, CERN IT/DIS/OSE, Lionel.Cons@cern.ch.
    The main author is Lionel Cons, CERN IT/DIS/OSE, Lionel.Cons@cern.ch.
    Many other people around the net contributed to this program.
    Many other people around the net contributed to this program.
    .SH COPYRIGHT
    .SH COPYRIGHT
    This program is the intellectual property of the European
    This program is the intellectual property of the European
    Laboratory for Particle Physics (known as CERN). No guarantee whatsoever is
    Laboratory for Particle Physics (known as CERN). No guarantee whatsoever is
    provided by CERN. No liability whatsoever is accepted for any loss or damage
    provided by CERN. No liability whatsoever is accepted for any loss or damage
    of any kind resulting from any defect or inaccuracy in this information or
    of any kind resulting from any defect or inaccuracy in this information or
    code.
    code.
    .PP
    .PP
    CERN, 1211 Geneva 23, Switzerland
    CERN, 1211 Geneva 23, Switzerland
    .SH "SEE ALSO"
    .SH "SEE ALSO"
    GNU Texinfo Documentation Format,
    GNU Texinfo Documentation Format,
    HyperText Markup Language (HTML),
    HyperText Markup Language (HTML),
    World Wide Web (WWW).
    World Wide Web (WWW).
    .SH BUGS
    .SH BUGS
    This program does not understand all Texinfo commands (yet).
    This program does not understand all Texinfo commands (yet).
    .PP
    .PP
    TeX specific commands (normally enclosed in @iftex) will be
    TeX specific commands (normally enclosed in @iftex) will be
    passed unmodified.
    passed unmodified.
    .ex
    .ex
     
     

    powered by: WebSVN 2.1.0

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