code:
# Makefile.am for texi2html.
# Process this file with automake to produce Makefile.in
#
# Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
# 2009, 2010 Free Software Foundation, Inc.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# don't install gmo files from texi2html directories if in texinfo,
# they are also in ../po and ../po_document
if TEXI2HTML
po_subdirs = po_document po_messages
po_document_dir = .
else
po_subdirs =
po_document_dir = ..

config.rpath: $(srcdir)/../build-aux/config.rpath
	${INSTALL_DATA} $(srcdir)/../build-aux/config.rpath config.rpath

AUTHORS: $(srcdir)/../AUTHORS
	(echo "Below is a copy of the texinfo AUTHORS file, listing texi2html authors"; echo) \
	   | cat - $(srcdir)/../AUTHORS > $@
endif

SUBDIRS = $(po_subdirs) . test

imagesdir = $(datadir)/texi2html/images
#i18ndir = $(datadir)/texi2html/i18n
initdir = $(datadir)/texinfo/init

bin_SCRIPTS = texi2any
texi2html_additional_scripts = \
	MySimple.pm \
	T2h_i18n.pm \
	texi2html.pm \
	translations.pl \
	examples/l2h.init \
	T2h_l2h.pm \
	documentlanguages.pl

texi2html_formats = \
	formats/html.pm \
	formats/info.pm \
	formats/docbook.pm \
	formats/xml.pm \
	formats/plaintext.pm

dist_init_DATA = maintained_extra/book.pm \
	maintained_extra/chm.pm \
	maintained_extra/tex4ht.pm \
	maintained_extra/html32.pm \
	maintained_extra/mediawiki.pm

texi2html_sources = texi2html_configured.pl $(texi2html_additional_scripts)

noinst_SCRIPTS = manage_i18n.pl buildt2h.sh addformats.sh \
 parse_8bit_makeinfo_maps.pl gettext_to_separated.pl separated_to_hash.pl

# style_example.css comes from http://planet.gnu.org/~ams/style.css
# texinfo-bright-colors.css from http://hollmen.net/texinfo/ by Jaakko Hollmén
EXTRA_DIST = \
	configure.ac \
	config.rpath \
	autogen.sh \
	AUTHORS \
	MySimple.pod \
	$(noinst_SCRIPTS) \
	missing-texi2html \
	texi2html.pl \
	texi2html.spec.in \
	texi2html.pl \
	regenerate_documentlanguages.pl \
	$(texi2html_additional_scripts) \
	$(texi2html_formats) \
	examples/makeinfo.pm \
	examples/xhtml.pm \
	examples/noheaders.pm \
	examples/utf8.pm \
	examples/enable_encoding.pm \
	examples/roff.pm \
	examples/my-bib-macros.texi \
	examples/bib-example.texi \
	examples/glossary.texi \
	examples/style_example.css \
	examples/texinfo-bright-colors.css \
	lib \
	po_messages/Makevars.in \
	po_messages/POTFILES.in.in \
	po_document/Makevars.in \
	po_document/POTFILES.in.in \
	i18n_ref \
	translations.pl

dist_images_DATA = images/a_begin.png \
	images/a_begin_na.png \
	images/a_document.png \
	images/a_document_na.png \
	images/a_empty.png \
	images/a_end.png \
	images/a_end_na.png \
	images/a_help.png \
	images/a_help_na.png \
	images/a_index.png \
	images/a_index_na.png \
	images/a_leftdouble.png \
	images/a_leftdouble_na.png \
	images/a_left.png \
	images/a_left_na.png \
	images/a_page.png \
	images/a_page_na.png \
	images/a_rightdouble.png \
	images/a_rightdouble_na.png \
	images/a_right.png \
	images/a_right_na.png \
	images/a_searchdoc.png \
	images/a_searchdoc_na.png \
	images/a_search.png \
	images/a_search_na.png \
	images/a_tableofcon.png \
	images/a_tableofcon_na.png \
	images/a_top.png \
	images/a_top_na.png \
	images/a_up.png \
	images/a_up_na.png \
	images/bg.jpg \
	images/bg_left.png \
	images/bg_right.png \
	images/blue_dir.png \
	images/blue_down.png \
	images/blue_grab.png \
	images/blue_help.png \
	images/blue_next.png \
	images/blue_nnext.png \
	images/blue_pprev.png \
	images/blue_prev.png \
	images/blue_readme.png \
	images/blue_top.png \
	images/blue_up.png \
	images/blue_uup.png \
	images/contents_motif.png \
	images/COPYING \
	images/COPYING.Attribution-ShareAlike \
	images/GPL \
	images/README \
	images/index_motif.png \
	images/Mybg.png \
	images/next_motif.png \
	images/next_motif_gr.png \
	images/previous_motif.png \
	images/previous_motif_gr.png \
	images/spacer3.png \
	images/xy_contents.png \
	images/xy_foot.png \
	images/xy_next.png \
	images/xy_next_gr.png \
	images/xy_nextsection.png \
	images/xy_nextsection_gr.png \
	images/xy_previous.png \
	images/xy_previous_gr.png \
	images/xy_previoussection.png \
	images/xy_previoussection_gr.png \
	images/xy_up.png \
	images/xy_up_gr.png

texi2html.temp: $(texi2html_sources)
	$(SHELL) $(srcdir)/buildt2h.sh $@ $^

texi2any: texi2html.temp $(texi2html_formats)
	$(SHELL) $(srcdir)/addformats.sh $@ $^
	chmod a+x $@

texi2html.spec: texi2html.spec.in $(top_builddir)/configure
	@echo Generating $@...
	@sed -e "s/[@]PACKAGE_VERSION[@]/$(PACKAGE_VERSION)/" \
	    $(srcdir)/texi2html.spec.in >texi2html.tmp
	@cp texi2html.tmp texi2html.spec
	-@rm texi2html.tmp

$(po_document_dir)/po_document/$(PACKAGE)_document.pot:
	if test '$(USE_NLS)' = 'yes'; then \
	  cd $(po_document_dir)/po_document && $(MAKE) $(AM_MAKEFLAGS) update-po; \
	fi

# notice the
#     cat $< | sed -e 's/charset=CHARSET/charset=ascii/'
# Indeed $(po_document_dir)/po_document/$(PACKAGE)_document.pot is
# autogenerated with charset CHARSET (and no command line option for
# xgettext to change it), and msgexec doesn't like it and don't do anything.
# msgexec: present charset "CHARSET" is not a portable encoding name
# (Actually we write out the value of $<, but that's what it is.)
i18n/en.thl i18n/: $(po_document_dir)/po_document/$(PACKAGE)_document.pot
	$(MKDIR_P) i18n
	if test '$(USE_NLS)' = 'yes'; then \
	  for file in "$(srcdir)/$(po_document_dir)/po_document/"*".po"; do \
  	    lang=`basename "$$file" .po | sed 's/\..*//'`; \
	    test "$$lang" = 'en' && continue; \
	    msgexec -i "$$file" "$(srcdir)/gettext_to_separated.pl" \
	    | "$(srcdir)/separated_to_hash.pl" $$lang > i18n/$$lang.thl; \
	  done; \
	  cat $(po_document_dir)/po_document/$(PACKAGE)_document.pot \
	  | sed -e 's/charset=CHARSET/charset=ascii/' \
	  | msgexec "$(srcdir)/gettext_to_separated.pl" \
	  | "$(srcdir)/separated_to_hash.pl" en >i18n/en.thl; \
	else \
	  cp -p "$(srcdir)/i18n_ref/"*.thl i18n; \
	fi

i18n_ref:
	$(MKDIR_P) i18n_ref

# Should be done manually, otherwise it is left after make distclean
# in a out of source build directory.
regenerate_i18n_ref: i18n i18n_ref
	if test '$(USE_NLS)' = 'yes'; then \
	  cp -p i18n/*.thl i18n_ref; \
	fi

translations.pl: i18n/en.thl
	$(PERL) manage_i18n.pl -d i18n -o $@ -I . -I $(srcdir) merge

all-local: makeinfo.pl texi2any.pl

# update the po files, and install locally the .mo files for the in
# source tests
check-local: makeinfo.pl texi2any.pl
	if test '$(USE_NLS)' = 'yes'; then \
	  cd $(po_document_dir)/po_document && $(MAKE) $(AM_MAKEFLAGS) update-po; \
	fi
	rm -rf locales
	for file in "$(srcdir)/$(po_document_dir)/po_document/"*.po; do \
	  basename=`basename "$$file" .po` ; \
	  $(MKDIR_P) "locales/$$basename/LC_MESSAGES/" ; \
	  if test '$(USE_NLS)' = 'yes'; then \
	    $(MSGFMT) "$$file" -o "locales/$$basename/LC_MESSAGES/texi2html_document.mo" ; \
	  else \
	    cp -p "$(srcdir)/$(po_document_dir)/po_document/$$basename.mo" "locales/$$basename/LC_MESSAGES/texi2html_document.mo" ; \
	  fi; \
	done

makeinfo.pl texi2any.pl:
	-$(LN_S) $(srcdir)/texi2html.pl $@

makeinfo texi2html: texi2any
	-$(LN_S) texi2any $@

html-local: texi2html

distclean-local:
	-rm -rf locales i18n

install-data-local: i18n
	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)/i18n
	$(INSTALL_DATA) i18n/*.thl  $(DESTDIR)$(pkgdatadir)/i18n
	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)/lib/libintl-perl/lib/Locale/Recode \
	  $(DESTDIR)$(pkgdatadir)/lib/libintl-perl/lib/Locale/RecodeData
	$(INSTALL_DATA) $(srcdir)/lib/libintl-perl/lib/Locale/*.pm \
	  $(DESTDIR)$(pkgdatadir)/lib/libintl-perl/lib/Locale
	$(INSTALL_DATA) $(srcdir)/lib/libintl-perl/lib/Locale/Recode/*.pm \
	  $(DESTDIR)$(pkgdatadir)/lib/libintl-perl/lib/Locale/Recode
	$(INSTALL_DATA) $(srcdir)/lib/libintl-perl/lib/Locale/RecodeData/*.pm \
	  $(DESTDIR)$(pkgdatadir)/lib/libintl-perl/lib/Locale/RecodeData
	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)/lib/Unicode-EastAsianWidth/lib/Unicode
	$(INSTALL_DATA) $(srcdir)/lib/Unicode-EastAsianWidth/lib/Unicode/EastAsianWidth.pm \
	 $(DESTDIR)$(pkgdatadir)/lib/Unicode-EastAsianWidth/lib/Unicode
	$(MKDIR_P) $(DESTDIR)$(pkgdatadir)/lib/Text-Unidecode/lib/Text/Unidecode
	$(INSTALL_DATA) $(srcdir)/lib/Text-Unidecode/lib/Text/Unidecode.pm \
	  $(DESTDIR)$(pkgdatadir)/lib/Text-Unidecode/lib/Text
	$(INSTALL_DATA) $(srcdir)/lib/Text-Unidecode/lib/Text/Unidecode/*.pm \
	  $(DESTDIR)$(pkgdatadir)/lib/Text-Unidecode/lib/Text/Unidecode

uninstall-local:
	rm -rf $(DESTDIR)$(pkgdatadir)/lib/ $(DESTDIR)$(pkgdatadir)/i18n
	rm -f $(DESTDIR)$(bindir)/texi2html
	rm -f $(DESTDIR)$(bindir)/makeinfo

install-exec-hook:
	-$(LN_S) texi2any $(DESTDIR)$(bindir)/texi2html
	-$(LN_S) texi2any $(DESTDIR)$(bindir)/makeinfo

dist-hook:
	rm -rf `find $(distdir)/lib $(distdir)/i18n_ref -name .svn`

ACLOCAL_AMFLAGS = -I m4

CLEANFILES = texi2html texi2html.temp texi2any makeinfo \
	texi2any.pl makeinfo.pl

DISTCLEANFILES = po_messages/Makevars \
	po_messages/POTFILES.in \
	po_document/Makevars \
	po_document/POTFILES.in\
        translations.pl\
        translations.pl.old

repo_name: mthl/texinfo

license: mit


code:
package Getopt::MySimple;

# Name:
#	Getopt::MySimple.
#
# Documentation:
#	POD-style (incomplete) documentation is in file MySimple.pod
#
# Tabs:
#	4 spaces || die.
#
# Author:
#	Ron Savage	rpsavage@ozemail.com.au.
#	1.00	19-Aug-97	Initial version.
#	1.10	13-Oct-97	Add arrays of switches (eg '=s@').
#	1.20	 3-Dec-97	Add 'Help' on a per-switch basis.
#	1.30	11-Dec-97	Change 'Help' to 'verbose'. Make all hash keys lowercase.
#	1.40	10-Nov-98	Change width of help report. Restructure tests.
#               1-Jul-00        Modifications for Texi2html

# --------------------------------------------------------------------------
# Locally modified by obachman (Display type instead of env, order by cmp)
# $Id$

# use strict;
# no strict 'refs';

use vars qw(@EXPORT @EXPORT_OK @ISA);
use vars qw($fieldWidth $opt $VERSION);

use Exporter();
use Getopt::Long;

@ISA		= qw(Exporter);
@EXPORT		= qw();
@EXPORT_OK	= qw($opt);	# An alias for $self -> {'opt'}.

# --------------------------------------------------------------------------

$fieldWidth	= 20;
$VERSION	= '1.41';

# --------------------------------------------------------------------------

sub byOrder
{
	my($self) = @_;

	return uc($a) cmp (uc($b));
}

# --------------------------------------------------------------------------

sub dumpOptions
{
	my($self) = @_;

	print 'Option', ' ' x ($fieldWidth - length('Option') ), "Value\n";

	for (sort byOrder keys(%{$self -> {'opt'} }) )
	{
	  print "-$_", ' ' x ($fieldWidth - (1 + length) ), "${$self->{'opt'} }{$_}\n";
	}

	print "\n";

}	# End of dumpOptions.

# --------------------------------------------------------------------------
# Return:
#	0 -> Error.
#	1 -> Ok.

sub getOptions
{
	push(@_, 0) if ($#_ == 2);	# Default for $ignoreCase is 0.
	push(@_, 1) if ($#_ == 3);	# Default for $helpThenExit is 1.

	my($self, $default, $helpText, $versionText,
	   $helpThenExit, $versionThenExit, $ignoreCase) = @_;

	$helpThenExit = 1 unless (defined($helpThenExit));
	$versionThenExit = 1 unless (defined($versionThenExit));
	$ignoreCase = 0 unless (defined($ignoreCase));

	$self -> {'default'}		= $default;
	$self -> {'helpText'}		= $helpText;
	$self -> {'versionText'}        = $versionText;
	$Getopt::Long::ignorecase	= $ignoreCase;

	unless (defined($self -> {'default'}{'help'}))
	{
	  $self -> {'default'}{'help'} =
	  {
	   type => ':i',
	   default => '',
	   linkage => sub {$self->helpOptions($_[1]); sleep 5;exit (0) if $helpThenExit;},
	   verbose => "print help and exit"
	  };
	}

	unless (defined($self -> {'default'}{'version'}))
	{
	  $self -> {'default'}{'version'} =
	  {
	   type => '',
	   default => '',
	   linkage => sub {print $self->{'versionText'};  exit (0) if $versionThenExit;},
	   verbose => "print version and exit"
	  };
	}

	for (keys(%{$self -> {'default'} }) )
	{
	  next unless (ref(${$self -> {'default'} }{$_}) eq 'HASH');
	  my $type = ${$self -> {'default'} }{$_}{'type'};
	  push(@{$self -> {'type'} }, "$_$type");
	  my $key = $_;
	  # get rid of aliases, if any
	  $key =~ s/\|.*//;
	  $self->{'opt'}->{$key} =  ${$self -> {'default'} }{$_}{'linkage'}
            if ${$self -> {'default'} }{$_}{'linkage'};
	}

	my($result) = &GetOptions($self -> {'opt'}, @{$self -> {'type'} });

        return $result unless $result;

	for (keys(%{$self -> {'default'} }) )
	{
 	   if (! defined(${$self -> {'opt'} }{$_})) #{
            {
 	     ${$self -> {'opt'} }{$_} = ${$self -> {'default'} }{$_}{'default'};
            }
	}

	$result;
}	# End of getOptions.

# --------------------------------------------------------------------------

sub helpOptions
{
	my($self) = shift;
	my($noHelp) = shift;
	$noHelp = 0 unless $noHelp;
	my($optwidth, $typewidth, $defaultwidth, $maxlinewidth, $valind, $valwidth)
	  = (10, 5, 9, 78, 4, 11);

	print "$self->{'helpText'}" if ($self -> {'helpText'});

	print ' Option', ' ' x ($optwidth - length('Option') -1 ),
		'Type', ' ' x ($typewidth - length('Type') + 1),
		'Default', ' ' x ($defaultwidth - length('Default') ),
	        "Description\n";

	for (sort byOrder keys(%{$self -> {'default'} }) )
	{
	  my($line, $help, $option, $val);
	  $option = $_;
	  next if (ref(${$self -> {'default'} }{$_}) ne 'HASH' or (${$self->{'default'} }{$_}{'noHelp'} && ${$self->{'default'} }{$_}{'noHelp'} > $noHelp));
          #$line = " -$_" . ' ' x ($optwidth - (2 + length) ) .
          #      	"${$self->{'default'} }{$_}{'type'} ".
          #      	' ' x ($typewidth - (1+length(${$self -> {'default'} }{$_}{'type'}) ));
		$line = " --$_" . "${$self->{'default'} }{$_}{'type'}".
			' ' x ($typewidth - (1+length(${$self -> {'default'} }{$_}{'type'}) ));

                 $val = ${$self->{'default'} }{$_}{'linkage'};
                if ($val)
                {
                  if ((ref($val) eq 'SCALAR') and (defined($$val)))
		  {
		    $val = $$val;
		  }
		  else
		  {
		    $val = '';
		  }
                }
		elsif (defined(${$self->{'default'} }{$_}{'default'}))
		{
		  $val = ${$self->{'default'} }{$_}{'default'};
		}
		else
		{
		  $val = '';
		}
	        $line .= "$val  ";
		$line .= ' ' x ($optwidth + $typewidth + $defaultwidth + 1 - length($line));

		if (defined(${$self -> {'default'} }{$_}{'verbose'}) &&
		  ${$self -> {'default'} }{$_}{'verbose'} ne '')
	      {
		$help = "${$self->{'default'} }{$_}{'verbose'}";
	      }
	      else
	      {
		$help = ' ';
	      }
	      if ((length("$line") + length($help)) < $maxlinewidth)
	      {
		print $line , $help, "\n";
	      }
	      else
	      {
		print $line, "\n", ' ' x $valind, $help, "\n";
	      }
	      for $val (sort byOrder keys(%{${$self->{'default'}}{$option}{'values'}}))
	      {
	        print ' ' x ($valind + 2);
                print $val, '  ', ' ' x ($valwidth - length($val) - 2);
	        print ${$self->{'default'}}{$option}{'values'}{$val}, "\n";
	      }
	}

	print <<EOT;
Note: 'Options' may be abbreviated. -- prefix may be replaced by a single -.
'Type' specifications mean:
 <none>| !    no argument: variable is set to 1 on -foo (or, to 0 on -nofoo)
    =s | :s   mandatory (or, optional)  string argument
    =i | :i   mandatory (or, optional)  integer argument
EOT
}	# End of helpOptions.

#-------------------------------------------------------------------

sub new
{
	my($class)				= @_;
	my($self)				= {};
	$self -> {'default'}	= {};
	$self -> {'helpText'}	= '';
	$self -> {'opt'}		= {};
	$opt					= $self -> {'opt'};	 # An alias for $self -> {'opt'}.
	$self -> {'type'}		= ();

	return bless $self, $class;

}	# End of new.

# --------------------------------------------------------------------------

1;

# End MySimple.pm


code:
=head1 NAME

C<Getopt::MySimple> - Provide a simple wrapper around Getopt::Long.

=head NOTE

Based on GetOpt::Simple, with some (here undocumented) modifications
to fit texi2hml  needs.

=head1 SYNOPSIS

	use Getopt::MySimple;

	# Or ...
	# use Getopt::MySimple qw($opt);

	my($options) =
	{
	'help' =>
		{
		'type'		=> '',
		'default'	=> '',
#		'verbose'	=> '',	# Not needed on every key.
		},
	'username' =>
		{
		'type'		=> '=s',			# As per Getopt::Long.
		'default'	=> $ENV{'USER'} || 'RonSavage',	# In case $USER is undef.
		'verbose'	=> 'Specify the username on the remote machine',
		},
	'password' =>
		{
		'type'		=> '=s',
		'default'	=> 'password',
		'verbose'	=> 'Specify the password on the remote machine',
		},
	};

	my($option) = new Getopt::MySimple;

	if (! $option -> getOptions($options, "Usage: testMySimple.pl [options]") )
	{
		exit(-1);	# Failure.
	}

	print "username: $option->{'opt'}{'username'}. \n";
	print "password: $option->{'opt'}{'password'}. \n";

	# Or, after 'use Getopt::MySimple qw($opt);' ...
	# print "username: $opt->{'username'}. \n";
	# print "password: $opt->{'password'}. \n";

=head1 DESCRIPTION

The C<Getopt::MySimple> module provides a simple way of specifying:

=over 4

=item *

Command line options

=item *

Type information for option values

=item *

Default values for the options

=item *

Help text per option

=back

=head1 The C<getOptions()> function

The C<getOptions()> function takes 4 parameters:

=over 4

=item *

A hash defining the command line options

=item *

A string to display as a help text heading

=item *

A Boolean. 0 = (Default) Use case-sensitive option names. 1 = Ignore case

=item *

A Boolean. 0 = Return after displaying help. 1 = (Default) Terminate with exit(0)
after displaying help

=back

=head1 The $classRef -> {'opt'} hash reference

Command line option values are accessed in your code by dereferencing
the hash reference $classRef -> {'opt'}. Two examples are given above,
under synopsis.

Alternately, you can use the hash reference $opt. See below.

=head1 The $opt hash reference

Command line option values are accessed in your code by dereferencing
the hash reference $opt. Two examples are given above,
under synopsis.

Alternately, you can use the hash reference $classRef -> {'opt'}. See above.

=head1 The C<dumpOptions()> function

C<dumpOptions()> prints all your option's keys and their current values.

=head1 The C<helpOptions()> function

C<helpOptions()> prints nicely formatted help text.

=head1 WARNING re Perl bug

As always, be aware that these 2 lines mean the same thing, sometimes:

=over 4

=item *

$self -> {'thing'}

=item *

$self->{'thing'}

=back

The problem is the spaces around the ->. Inside double quotes, "...", the
first space stops the dereference taking place. Outside double quotes the
scanner correctly associates the $self token with the {'thing'} token.

I regard this as a bug.

=head1 REQUIRED MODULES

=over 4

=item *

Exporter

=item *

Getopt::Long

=back

=head1 RETURN VALUES

=over 4

=item *

C<dumpOptions()> returns nothing

=item *

C<helpOptions()> returns nothing

=item *

C<getOptions()> returns 0 for failure and 1 for success

=back

=head1 AUTHOR

C<Getopt::MySimple> was written by Ron Savage I<E<lt>rpsavage@ozemail.com.auE<gt>> in 1997.

Modifications for texi2html by Olaf Bachmann
I<E<lt>obachman@mathtematik.uni-kl.deE<gt>> in 2000.
=head1 LICENCE

This program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.


code:
This file records noteworthy changes.

X.X ()

* COMPATIBILITY
  -------------

* don't show menu with --no-headers as said in the makeinfo documentation.

* obsolete the --iso command line option.

* obsolete texi2html specific variables. Here is the list with the associated
  configuration variables that may be set instead, with --set-init-variable:
  --toc-links               TOC_LINKS
  --short-ext               SHORTEXTN
  --prefix                  PREFIX
  --short-ref               SHORT_REF
  --idx-sum                 IDX_SUMMARY
  --def-table               DEF_TABLE
  --ignore-preamble-text    IGNORE_PREAMBLE_TEXT
  --html-xref-prefix        EXTERNAL_DIR
  --l2h                     L2H
  --l2h-l2h                 L2H_L2H
  --l2h-skip                L2H_SKIP
  --l2h-tmp                 L2H_TMP
  --l2h-file                L2H_FILE
  --l2h-clean               L2H_CLEAN
  --use-nodes               USE_NODES
  --monolithic              MONOLITHIC
  --top-file                TOP_FILE
  --toc-file                TOC_FILE
  --frames                  FRAMES
  --menu                    SHOW_MENU
  --debug                   DEBUG
  --doctype                 DOCTYPE
  --frameset-doctype        FRAMESET_DOCTYPE
  --test                    TEST
  --dump-texi               DUMP_TEXI

* remove completly $INVISIBLE_MARK, $USE_GLOSSARY, $CHECK, $EXPAND,
  $ENCODING, $CENTER_IMAGE, $HREF_DIR_INSTEAD_FILE, $USE_MENU_DIRECTIONS,
  they have been obsolete, sometimes for many years.

* DATE is now set as today, DOCUMENT_ENCODING as documentencoding,
  extension as EXTENSION and DOCUMENT_DESCRIPTION as documentdescription.

* Don't use perl variables for configuration variables anymore. Instead,
  they should be set by
  set_from_init_file('VARIABLE', value);
  For example
    $SPLIT = 'node';
  should be replaced by
    set_from_init_file('SPLIT', 'node');

* configuration variables are not in Texi2HTML::THISDOC directly anymore,
  but in Texi2HTML::THISDOC{'variables'}->{$var}. they should be accessed
  through get_conf($var).

* remove $Texi2HTML::THISDOC{'program_authors'}. $Texi2HTML::THISDOC{'program_and_version'}
  holds the program and version, while $Texi2HTML::THISDOC{'program'} is only
  the program name.

* remove $Texi2HTML::THISDOC{'out_dir'}.

5.0 (2010-06-27)

* NEW FEATURES
  ------------

* The program may be called as makeinfo, with a handling of options
  and defaults matching makeinfo.
  It may also be called as texi2any, with makeinfo defaults and all
  the texi2html command-line arguments that are not obsolete.

* new info and plaintext backends, ready for world domination!
  Corresponding test results are added.

* main program handles --xml, --docbook, --info, --html and --plaintext.

* Handle @DH{}, @dh{}, @TH{}, @th{}, @headitemfont, @part and
  @allowcodebreaks false

* Handle -o /dev/null (or NUL) like makeinfo.

* Read TEXINFO_OUTPUT_FORMAT in env to determine the output format.

* add 0x7F as a comment character.

* When called as texi2html, output the title page at the beginning.

* mediawiki backend completed.

* Translations of error messages available.

* BUG FIXES
  ---------

* Handling of @itemize and @table arguments are more in line with makeinfo.

* ignore @setfilename in @include'd files, as told in the texinfo manual.

* many warning messages added, especially for Info to match makeinfo.

* Still provide the default output with --macro-expand.

* Handle correctly @w in info and html.

* COMPATIBILITY
  -------------

* complex format handling API changed. $complex_format_map is replaced by
  a real hash %complex_format_map and the begin and end are no more
  evaluated.

* If file begins with /, ./ or ../ don't search in -I.

* In the default case a gettext-like framework is now used for in document
  string translations. The old framework is still available by setting
  $I18N_PERL_HASH.

* Information that can be set by @-commands should now be accessed
  through get_conf, and also some information about the document (the
  information that can change for each manual being processed).

* $format_list_item_texi should now modify directly the @item argument
  and apply the @-command given as @table argument. Correspondingly,
  some arguments of $table_item have been removed.

* Formatting of titlepage changed, and @title, @subtitle and @author
  are now handled by $line_command.

* @verbatiminclude is now a $raw command argument distinct from @verbatim.

* @direntry is formatted like a menu and passed down to $menu_command.

* $SEPARATED_FOOTNOTES has been replaced by $FOOTNOTESTYLE, that takes the
  same argument than @footnotestyle.

* replace $LANG by $DOCUMENTLANGUAGE.

* replace $DO_CONTENTS by $CONTENTS and $DO_SCONTENTS by $SHORTCONTENTS.

* replace $TRANSLITERATE_NODE by $TRANSLITERATE_FILE_NAMES.

* replace $SECTION_NAVIGATION by $HEADERS.

* add $NODE_FILENAMES to use node names for files associated with nodes,
  such that $NODE_FILES only means creating redirection files.

* Remove the user from footer, and the corresponding USER variable and
  $Texi2HTML::THISDOC{user}.

* Don't do anything special anymore when the top element is empty. Also
  don't treat especially top element headings.

* Don't skip top element heading if there was a @titlefont.

* Don't treat _setfilename as a value set. It should be available through
  get_conf. Same for all the other @-commands previously available as
  values.

* Changes in class attribute in html elements:
  Change class "toc" for ul to class "no-bullet" ($NO_BULLET_LIST_ATTRIBUTE).
  @top and @centerchap have now their command name as class.
  @node heading class is now "node-heading", instead of "node".
  The whole header is in an element with class "header" (was "node" when
  !$HEADER_IN_TABLE).

* print_element_header is obsoleted, things should be directly done in
  element_heading.

* Add 'inline_attribute' for an XML attribute that should be closed at
  paragraph end and reopened at paragraph begin. Consequently the closing
  and opening of 'attribute' isn't done anymore in paragraph and
  preformatted.

* USE_ISO now only determines if '', `` --- and -- are transformed
  into entities. t2h_default_set_iso_symbols sets or unsets USE_ISO,
  %things_map/%pre_map/%simple_format_simple_map_texi,
  $OPEN_QUOTE_SYMBOL and $CLOSE_QUOTE_SYMBOL.
  %iso_symbols is unused now.

* change in the normal_text function reference API, now there is an
  input variable true if in @math.

* change the external_ref API, fourth argument is now the file name and
  add the node as an extra argument.

* only install init files from maintained_extra/, they are considered
  to be interesting enough and maintained.

* rename $Texi2HTML::THISDOC{css_lines} as $Texi2HTML::THISDOC{css_rule_lines}

1.82 (2009-01-05)

* NEW FEATURES
  ------------

* Add new hooks for user functions, for simple @-commands, and at the start and
  end of special regions.

* BUG FIXES
  ---------

* Tests are now more cross-platform and more tolerant of missing optional
  dependencies.

* Don't use unidecode on unicode characters that are known not to have a good
  transliteration.  This corresponds with characters with an @-command that
  don't have a transliteration, like @exclamdown...

* Misc minor bug fixes.

1.80 (2009-01-01)

* NEW FEATURES
  ------------

* handle @alias, @quote*, @guillem*, @textdegree, @allowcodebreaks,
  @fonttextsize, @hyphenation, @click, @clickstyle, @click, @arrow,
  @clicksequence, @geq, @leq, @*headingmarks, @*footingmarks, @smallquotation,
  @ogonek.
  Handle @columnfractions and row prototypes in @multitable better.

* @documentlanguage is used to set the language each time it is seen (except
  if the language was set on the command line).

* new option --css-ref, generate reference to a CSS URL.

* new option --transliterate-file-names, produce file names in ASCII
  transliteration (set in the default case).

* use accesskey and rel attributes, use link element if set in the init file.

* use node id as targets for sections.

* COMPATIBILITY
  -------------

* the API for the formatting of menus completly changed. $simple_menu_link
  is removed, everything should be done in $menu_link.

* change handling of @detailmenu and menu comments, with (among other changes)
  the menu function reference replaced by the menu_command function reference
  also handling @detailmenu.

* tex4ht.init now may use a different external program for @tex and for
  @math, and therefore the configuration variables were doubled and
  their name changed.

* change in the interface, a new function reference print_element_header
  has been added, that should print the heading navigation of an element.
  Previously it was done in print_section.

* change in the normal_text function reference API, now there is an
  input variable true if in simple text.

* change in the menu_entry and simple_menu_entry function reference API,
  the name is always passed, and a new argument tells if there was an
  explicit name.

* change in unknown function reference API, now there is a pass argument
  to be able to handle unknown macros in other passes than the last.
  Report from Reinhold Kainhofer.

* in table_item the text is not formatted with the format command,
  the text_formatted argument is.

* definition index entries are now formatted with $definition_index_entry,
  not with $definition_category anymore.

* $Texi2HTML::THISDOC{copying} is now $Texi2HTML::THISDOC{copying_comment}.

* TOC_LIST_ATTRIBUTE is now called NO_BULLET_LIST_ATTRIBUTE.

* TOC_LIST_STYLE is now called NO_BULLET_LIST_STYLE.

* changes in command line switches to synchronize with makeinfo:
  --number becomes --number-sections
  --separated-footnotes becomes --footnote-style
  --sec-nav becomes --header
  --Verbose becomes --verbose
  --lang becomes --document-language

* everything before @setfilename is not outputted, like makeinfo. The previous
  behaviour can be restored with $IGNORE_BEFORE_SETFILENAME = 0;

* Now there is an argtype possibility for definition specification
  and the arg meaning changed. The whole definition parsing is now more
  like makeinfo.

* internal_ref and external_ref don't change inforef to xref anymore.

* change in the heading API. THIS_HEADER is not used anymore.
  New function reference, element_heading  to format a node or a section
  heading, including navigation and label. Accordingly, print_Top and
  one_section don't print the element header anymore. Also it is
  reported if the element is a new element, is the main element and
  more arguments, and top element heading is always done in heading.

* print_element_header and print_navigation now return their result.

* new argument for print_misc and print_misc_header, the misc page name.

* printindex is called if it appears, even if the index is not defined or
  there are no index entries.

* image API completly changed. The current behaviour is not stable, so
  is not documented.

* new argument (@@-command name) for quotation and quotation_prepend_text.

* image file paths are not completed anymore in the default case. The previous
  behaviour can be restored with $COMPLETE_IMAGE_PATHS set to true.

* there is a new 'style' key in $complex_format_map, to be able to
  differentiate complex formats inheriting fonts and code_style (like
  @format, @display).

* $EXTENSION should be undef if one doesn't want an extension to be added.

* THISDOC{'title'} and similar are now for @title since only one @title
  should appear in the document. @settitle is tried first to set fulltitle.

* Configuration variables are not modified anymore, instead the variable
  value is put in $Texi2HTML::THISDOC{'VAR'}. This is the case for
  DO_CONTENTS, DO_SCONTENTS, CSS_LINES, BODYTEXT, DOCUMENT_DESCRIPTION,
  DOCUMENT_ENCODING, IN_ENCODING, ENCODING_NAME, OUT_ENCODING.

  For example, if $CSS_LINES is defined, the value is put in
  $Texi2HTML::THISDOC{'CSS_LINES'} which is used for formatting, and if
  $CSS_LINES is not defined, $Texi2HTML::THISDOC{'CSS_LINES'} is
  autodetected.

* When there is no section and $USE_NODES is not set don't split by node.
  This behaviour and the previous aren't documented, so it could change
  in the future.

* BUG FIXES
  ---------

* --no-monolithic is reenabled.

* @, followed by an argument without brace is now handled. Report from
  Jorge Barros de Abreu.

* @, is kept with --macro-expand.

* @math is more compatible with makeinfo/texi2dvi when no external program
  is used. Using tex4ht for html generation should also lead to a correct
  result.

* Handle right @end block commands followed by something else than a
  spacing character.

* Remove trailing end of line in @html block.

* @itemize should produce bullets by default. Report from Reinhold Kainhofer.

* handle frame files like other files. Report from Reinhold Kainhofer.

1.78 (2007-06-05)

* NEW FEATURES
  ------------

* Transliterate accented characters in file names. Use Text::Unidecode
  if detected.

* Handle @frenchspacing, @tie, @indent, @setcontentsaftertitlepage,
  @setshortcontentsaftertitlepage and the obsolete @allow-recursion
  and @quote-arg.

* With book style the Table of Contents is put where it is set.

* Use more numeric entities, especially for accented letters.

* The `examples' directory now contains an init file for Mediawiki output.
  Mediawiki is the GPL'd wiki used by Wikipedia.

* new init file tex4ht.init. With this init file, httex or htlatex from
  tex4ht is used to format @tex and @math.

* Init files now have a chance to override all file names, rather than just
  page names.

* Put the images under a double licence by adding back their original GPL
  licence.

* If SIMPLE_MENU is true the menu is simply enclosed in a preformatted
  environment.

* The user can bypass the texi2html functions and provide his own function
  to do things similar that what is done for interfacing with LaTeX2HTML
  or tex4ht.

* LaTeX2HTML stuff is moved out of texi2html.pl, to T2h_l2h.pm.

* Add $USER and $DATE variables to override the defaults detected for the
  footer.

* COMPATIBILITY
  -------------

* $TOP_FILE and $TOC_FILE are only set if set by the user. The elements
  file names are in the hash reference $Texi2HTML::THISDOC{'filename'}
  for use in init files.

* The API for image, normal_text, paragraph and node_file_name has changed.

* The $ENCODING variable is deprecated, replaced by $ENCODING_NAME
  and $OUT_ENCODING.

* utf8 is used as default out file encoding. This should allow for utf8
  translations for languages which cannot use @-commands for non ascii
  characters.

* Use entities for ``, '', ---, -- and quotes used for some formatting
  @-commands if $USE_ISO is set.

* don't set unset MENU-ENTRY-NAME if it is similar with the NODE-NAME,
  it is useless as it is a construct that shouldn't happen.

* avoid menu entry and description redundancy in the formatting function
  and not in the main program.

* accept - in @-command names (compatibility with makeinfo)

* in user-defined macro arguments a comma in brace is escaped (compatibility
  with makeinfo from texinfo 4.8.90)

* don't add the section title to the html title when the document isn't split

* BUG FIXES
  ---------

* When the file extension is set to the empty string, a trailing `.' will not
  be automatically added to file names.

* The texi2html script is now created by make and not configure.

* It is possible to build the translation files from outside of the
  build directory.

* When configure detects that no Data::Dumper is present, the build scripts
  will simply copy the files instead of breaking.

* remove handling of quotation second arg, quotation has only one arg.

* handle nested ifset/ifclear.

* Improved handling of @sc and @centerchap.

* More flexible normal_text.

* style_stack really contains the formatting @-commands.

* caching of html generated by latex2html reenabled.

* when not split and no section navigation is output, the about page and
  navigation direction are not output for all the elements.

* FOR DEVELOPERS
  --------------

* Standardized on Automake 1.10.0

1.76 (February  3 2005)

* BUG FIXES
  ---------

* Perl no longer needs to be installed at build time, but when it is not, the
  path to `perl' that will be used at run time must be passed to the
  `configure' script.

1.74 (January 31 2005)

* COMPATIBILITY
  -------------

* The argument on def like commands line (@deffn and friends) may be
  bracketed, therefore there is no difference between this element and
  others. There is no need of items with { in front in the %def_map
  anymore.

* NEW FEATURES
  ------------

* More @-commands are available to the user, that were ignored before.
  Most of these @-commands are those related with structure or printed
  output.

* BUG FIXES
  ---------

* many deffn and friends line parsing bugs fixed.

1.72 (December 29 2004)

* NEW FEATURES
  ------------

* Handle texinfo 4.7 constructs:
  @caption, @shortcaption, @ordf, @ordm, @registeredsymbol, @deftypecv,
  @LaTeX, @indicateurl, @docbook, @ifdocbook, @ifnotdocbook, @comma,
  @headitem, @quotation second arg, @acronym second arg.
  @url is now a synonym for @uref. @ at the end of a @def* line continues the
  line.
  Handle texinfo 4.8 constructs:
  @abbr, @slanted, @euro and @sansserif.
* Cross refs are done according to the specification presented in the texinfo
  manual in the node HTML Xref.

* BUG FIXES
  ---------

* Re enable compatibility with perl older that 5.6.

1.70 (March 24 2004)

* BUG FIXES
  ---------

* use i18n files even when translations.pl is not included. Include
  translations.pl.

* COMPATIBILITY
  -------------

* install html manual in $datadir/texinfo/html.

* NEW FEATURES
  ------------

* Add a spec file, usefull to build a rpm.

* FOR DEVELOPERS
  --------------

* Standardized on Autoconf 2.59 & Automake 1.8.3

1.68 (March 20 2004)

* COMPATIBILITY
  -------------

* When the manual is split the default is to put resulting files in a
  directory with name the manual file basename (previously they were left in
  the current directory). To avoid that, call texi2html with '-output .'.

*  The main configuration files are now ./Config, ~/.texi2html/Config,
  $sysconfdir/texi2html/Config and last $datadir/texi2html/Config. They are
  sourced in that order.
  In the future `/etc/texi2htmlrc' and `~/.texi2htmlrc' will no longer be
  sourced and any existing site or user configuration should be moved to the
  new locations if you wish it to be used by newer versions of Texi2HTML.

* Translation files are now stored in $datadir/texi2html/i18n/*,
  $sysconfdir/texi2html/i18n/*, ~/.texi2html/i18n/*, and sourced in that order.
  The translated strings are now associated with the english strings.
  Please see the documentation for the format of the new translation files.

* First index page is the first page with a non empty index (with @printindex).

* The glossary and bibliography terms aren't searched anymore. You should use
  @macro to simulate these features (look at Tests/macros/glossary.texi for
  an example).

* We've standardized on GNU-style `--' prefixed long options, rather than the
  old single-dash prefixed long options in the help, but the single-dash style
  is still accepted on the command line for the time being.
  We also changed `_' to `-' in option names.

* @setref handling is removed as the right corresponding @-command is @anchor.

* No more global variables outside of namespaces.
  Global variables are now in the Texi2HTML namespace.
  leading T2H_ is stripped from variable, hashes and array names. You should
  change your variable names for the new release. As the global variables
  (%THISDOC, $THIS_SECTION...) are in the Texi2HTML namespace you should use,
  for example, $Texi2HTML::THISDOC{'fulltitle'} now.
  functions from the main program should now be qualified in the main
  namespace. t2h_ is stripped from the function names too.
  t2h_anchor is now a function reference in init file, and thus should
  be called like &$anchor(...).
  toc file and main file are arguments for print_frame, overview lines are
  arguments for print_toc_frame (instead of global variables).

* $THISPROG, $T2H_HOMEPAGE, $T2H_AUTHORS, $T2H_TODAY, $T2H_USER are now
  values associated with the following keys in %Texi2HTML::THISDOC:
  `program', `program_homepage', `today', `user'.

* Changes in the function reference used for the page layout:
  print_section don't do the end of page or section anymore (except when
  split at node), end_section does the end of a section, and print_*_footer
  does the end of page.
  the print_*_header, print_*_footer... functions take a ref on the buttons
  array as argument, instead of using the $T2H_BUTTONS global variable.
  Have a look at the texi2html.init file to update your configuration files.

* T2H_InitGlobals is not used anymore. Use the function reference init_out
  to define $BODYTEXT dynamically and %Texi2HTML::THISDOC values in
  print_page_foot and about_body to recreate the address instead of the
  $T2H_ADDRESS.
  You can have a look at program_string in texi2html.init which recreates
  the address. $T2H_ADDRESS isn't used anymore.

* variables for latex2html are not in texi2html init file anymore but in
  l2h.init.

* don't expand @ifinfo regions by default.

* option --output obsoletes -out_file and -subdir. It is the same than
  --out_file when output is not split, and the same than --subdir when it is
  split.

* If not split, the resulting file has a leading directory, and the directory
  doesn't exist, it is created.

* If a directory creation fails the program aborts.

* Don't use T2H_CENTER_IMAGE, @center should be used.

* the init_out function redefines dynamically %NAVIGATION_TEXT, %BUTTONS_GOTO
  and $BODYTEXT. You should redefine the hash values in that function. If you
  want to reuse the values of the default values set by init_out,
  you could do something like:

  my $default_init_out = $init_out;
  $init_out = \&makeinfo_like_init_out;
  sub makeinfo_like_init_out()
  {
     my $encoding = &$default_init_out();
     $NAVIGATION_TEXT{'Following'} = ' > ';
     return $encoding;
  }

* NEW FEATURES
  ------------

* Many changes towards output of stricter HTML.

* initialization files for html 3.2, xhtml, html 4.0 with inline style,
  no header, utf8 characters outputted, makeinfo style, book style, conversion
  to chm files and conversion to roff. Initialization files are searched
  in ./, ~/.texi2html, $sysconfdir/texi2html and last $datadir/texi2html.
  The file names are html32.init, xhtml.init, inlinestyle.init,
  noheaders.init, utf8.init, makeinfo.init, book.init, chm.init and roff.init.

* The test suite is much more comprehensive and uses validate and tidy to
  assess the correctness of the HTML.

* Handling of @html, @verbatim, @verb, @sp, @=, @copying, @insertcopying,
  @cartouche, @titlefont, @dircategory, @direntry, @shorttitlepage, @\,
  @afourlatex, @afourwide, @firstparagraphindent, @exampleindent, @novalidate,
  @definfoenclose, @kbdinputstyle, @centerchap, @documentdescription,
  @documentencoding, @contents, @shortcontents, @verbatiminclude.

* With --no-validate node cross-reference validation is suppressed (like
  @novalidate).

* --expand may be specified more than once such that more than one additional
  region could be expanded. --noexpand does the reverse. --iftex, --ifinfo...
  and --no-ifinfo... can be used instead.

* add http-equiv="Content-Type" tag for the charset declaration.

* HTML formatting is isolated in customizable functions located in the
  initialization files.

* menu comments are in a preformatted context.

* Any combination of caps for `top' leads to the top node.

* @ref{(perl)Top} leads to a ref to the info manual.

* References to external manual in @ref and menus are links to the html
  pages (with the same convention than makeinfo --html use).
  --html-xref-prefix is the base dir for external manual references.

* With --node-files do a file per node which can be used as a target for
  cross references from other manuals (including manuals generated with
  makeinfo --html).

* With --use-nodes nodes are sectioning commands whe they are not associated
  with a structuring command.

* With --toc-links create links from headings to toc entries.

* distinct directions (next, prev...) for nodes and sections, more directions.

* split at chapter, section or for every node.

* new possibilities for buttons. If this is a ref to a scalar, the text
  appears in navigation. If it is an array, the first element is a direction
  used for the href, the second element is a scalar ref for the text.

* With --noseparated-footnotes the footnotes are in the same page than the
  text.

* %NO_TEXI hash similar with %HREF but without texinfo commands,
  %THISDOC{'title_no_texi'}

* "-U value" does the same than "@clear value".

* -P option prepends directory for include files before the document directory.

* -macro-expand generates a file with expanded macros and @include.

* pass $L2H_HTML_VERSION for the html version to latex2html.

* support for css. The --css-include option does the same than in makeinfo
  (parse the file, and echo the @import part before the texi2html css rules,
  the rules part after the texi2html css rules).
  The texi2html css commands may be customized too.

* Text before the first @node or sectioning command is part of the first
  section unless -ignore-preamble-text is set.

* if `-' is given to the -output option, output on STDOUT.

* Add images from the Singular project.

* All the strings appearing in the HTML are internationalized.

* centering and flushing is really handled.

* Format titlepage (even though the formatted text isn't used by default).

* Handle all the encodings perl knows about.

* BUG FIXES
  ---------

* @multitable size determination, out of bounds columns ignored.

* In @table and @itemize, @item is replaced by the @-command argument.

* nested @-commands are better handled.

* in index keys @-commands are replaced by the right symbols.

* files are omitted in hrefs when they points to the same file.

* $value{_title}... are expanded during HTML generation.

* @H{a} leads to a'' and not á

* cedilla are accepted in node names.

* Any characters are accepted in menu comments.

* frame target is the top file, and not the toc file.

* rewriting of the @macro code completely. This likely fixed some bugs but
  this hasn't been verified by running the new, more complex test cases
  against the old code.

* rewriting of the document structure resolution.
  unnumbered regions are at the right level and splitted indices don't break
  the document structure anymore.
  index entries and footnotes are more precisely located.

* @-commands ignored are ignored with the line, the arg or following spaces
  like makeinfo does.

* FOR DEVELOPERS
  --------------

* Standardized on Autoconf 2.59 & Automake 1.8.2

* The --enable-maintainer-mode option is now required by configure to enable
  what is considered the maintainer-specific portions of Makefiles.  This
  includes the portions which automatically rebuild the configure and build
  files (configure, aclocal, Makefile.in, etc) when configure.in or other
  dependencies are changed.

* The config is in the Texi2HTML::Config namespace. The latex2html related
  functions are in the Texi2HTML::LaTeX2HTML namespace. The
  internationalization functions are in the Texi2HTML::I18n namespace in
  T2h_i18n.pm.

1.66 (June 8 2002)
* Many bug fixes.

1.65 (August 26 2001)
* Many bug fixes.
* The operation of the previously broken << (FastBack) and >> (FastForward)
  buttons has changed slightly.  FastBack now returns to the beginning of the
  current chapter and FastForward now jumps to the beginning of the next
  chapter.

1.64 (July 3 2000)
* Incorporated first  version of Texi2html Texinfo manual, authored by
  Karl Heinz Marbaise <khmarbaise@gmx.de>
* New handling of command line options:
  - can be abbreviated to shortest unique prefix
  -help now works and is up-to-date

1.63 (June 23 2000)
* New customization variable:
   $T2H_HREF_DIR_INSTEAD_FILE:
       if set (e.g., to index.html) replace hrefs to this file
        (i.e., to index.html) by ./
* New command-line option:
  -toc_file FILE
       for those who want the TOC to be in FILE
* bug fixes related to macro invocation

1.62 (12 April 2000)
* New customization variables:
   $T2H_SPLIT_INDEX [default: = 100]
     index pages are split at next letter, if more than that many entries
   $T2H_NODE_NAME_IN_MENU [default = 0]
      for enforcing node names in meny entries
   $T2H_AVOID_MENU_REDUNDANCY [default = 1]
      to avoid display of duplicate meny entry information
   $T2H_INDEX_CHAPTER [default = '']
      if set, use chapter of this name for 'Index' Button in
      navigation bars, else use first chapter whose name matches
      "index" (case insensitive).
   $T2H_TOP_HEADING [ default = '']
      if non-empty, and no heading is in Top node, then use this as heading
      for top node/section; otherwise, use @settitle, @shorttitle.
* index generation: observes typesetting in fixed-width font, @ftable,
  @vtable implemented
* Peter Moulder & Teun Burgers: Misc documentation and distribution
  changes
* numerous small bugs fixed (handling of menu entries, paragraphs in
  lists/tables, etc).

1.61 (31 March 2000)
* By default, $T2H_TOP_FILE is not set, and so $docu_name.html is used.
* Added T2H_print_chapter_header, T2H_print_chapter_footer for more
  fine-grained control of T2H_SPLIT eq 'chapter', added option
  -section_navigation, $T2H_SECTION_NAVIGATION to supress output of
  navigation panels per section
* naming scheme and calling convention of customizable subs changed:
  prefix T2H_, call &$T2H_, assignment $T2H_<name> = \&T2H_DEFAULT_<name>
* mailinglist created: texi2html@mathematik.uni-kl.de
* conversion to standard gnu package with Makefile.am, README,
  AUTHORS, etc. (Peter Moulder  <reiter@netspace.net.au>)
* Initialization as suggested by Peter Moulder:
   1. /usr/local/etc/texi2htmlrc (or whatever given by --sysconfdir to
     configure)
   2. $HOME/.texi2htmlrc
   3. command-line options, including -init_file
  where later options override previous ones.
* incoporated patches from Peter Moulder (backward-compatible
  command-line options, separate man-page, etc).
* Automatic node pointer creation added
* @enddots, @exclamdown, @pounds, and relatives added.

Major Changes from 1.58 to 1.60
* primitve foreign language support
* support of all "Umlaute"
* anchors, macros
* latex2html incooperation
* customizable page layout (texi2html.init)
* index as table with corresponding sections


code:
texinfo/texi2html/README

  Copyright (C) 2010, 2015 Free Software Foundation, Inc.

  Copying and distribution of this file, with or without modification,
  are permitted in any medium without royalty provided the copyright
  notice and this notice are preserved.

texi2html is part of GNU Texinfo, http://www.gnu.org/software/texinfo.
It used to be a separate project, http://www.nongnu.org/texi2html.

texi2html converts texinfo documents to HTML, Info, plain text, Docbook
and XML.  The HTML output is extremely configurable, at several levels.
One highly customized example is at http://www.singular.uni-kl.de/Manual/html.

For information about the arrangement of the sources, see README.dev.

texi2html is no longer developed; it has been replaced by a new
implementation, texi2any: see ../tp.


code:
This README.dev file gives some information about developing texi2html.

  Copyright 2010, 2015 Free Software Foundation, Inc.

  Copying and distribution of this file, with or without modification,
  are permitted in any medium without royalty provided the copyright
  notice and this notice are preserved.

[incomplete]

Customizing texi2html
=====================

Initialisation options are read first from
'/usr/local/etc/texi2html/Config' (the exact location being changeable with
the '--sysconfdir=dir' option to the configure script), then from
$HOME/.texi2html/Config, then any command-line options including --init-file
options; with later settings overriding earlier ones.

The default initialisation options are defined in the
'texi2html.pm' and built-in formats files in formats/*.pm files
contained in the Texi2html distribution (in fact, a script pastes
those files into the beginning of the perl file generated by
`./configure' from texi2html.pl and generates the actual 'texi2html'
script this way.).

To customize 'texi2html' it is best if you copy the appropriate
sections from the 'texi2html.pm' file into an appropriate local
initialization file, make the necessary changes there, and then have
'texi2html' read this initialisation file by one of the means described
above.

Documentation of texi2html
==========================

The texi2html Texinfo manual is lagging behind the development. In
addition, you might want to have a look at the comments in the
'texi2html.pm' file for explanations about customizable parameters
and at the (not up-to-date) texi2html man page for an overview of
texi2html's synopsis.

Files
=====

This distribution includes the following files, among others:
    README                      This file.

    NEWS                        Summary of new features by release.

    INSTALL			Generic installation instructions.

    TODO			Things which are yet to be done.

Texi2html source files:

    texi2html                   Actual script to run. Generated by
                                make, `buildt2h.sh' and `addformats.sh'
                                from texi2html.pl, texi2html.pm,
                                MySimple.pm, T2h_i18n.pm, examples/l2h.init,
                                translations.pl and formats/*.pm.

    texi2html.pl                Main source file of the converter.

    texi2html_configured.pl     File generated by `./configure' from
                                texi2html.pl.

    texi2html.pm                Default values of configurable
                                parameters. `buildt2h.sh' inserts this
                                file into texi2html_configured.pl when
                                it generates the actual `texi2html' script.

    MySimple.pm                 Perl module which handles the
                                processing of command-line options.
                                `buildt2h.sh' inserts this file into
                                texi2html_configured.pl when it generates
                                the actual `texi2html' script.

    T2h_i18n.pm                 Code used to handle strings
                                internationalization (obsolete).

    translations.pl             translations of strings generated by
                                the script `manage_i18n.pl' from source
                                files and files in the `i18n' directory
                                (obsolete).

    po_document/                Directory containing po files used for
                                translation of strings. The primary source
                                for the file are outside of texi2html,
                                in the texinfo po_document/ directory.

    po_messages/                Directory containing po files used for
                                translation of strings. The primary source
                                for the file are outside of texi2html,
                                in the texinfo po/ directory.

    i18n/                       Directory containing one file per language
                                with translation of strings (obsolete,
                                generated from po_document/ files).

Helper scripts

    gettext_to_separated.pl     Helper scripts used to convert gettext po
    separated_to_hash.pl        files to the former format used by texi2html
                                up to version 1.82.

    manage_i18n.pl              Helper script used to regenerate translations
                                from the source files and the files in the
                                `i18n/' directory.

    buildt2h.sh                 Helper script used to regenerate the texi2html
                                script. A simple wrapper around a sed
                                one-liner.

    addformats.sh               Other helper script used to regenerate the
                                texi2html script, for all the built-in formats.
                                A simple wrapper around a sed one-liner.

Documentation files:

   texi2html.texi               Texinfo manual of texi2html.

   texi2html.1.in               Template for generation of man pages
                                of texi2html (`texi2html.1').  This man
                                page is incomplete.

Installation files:

    configure                   This file creates creates a Makefile
                                which in turn creates the other files.

    configure.ac                This is a template for creating
                                `configure' using Autoconf.

    Makefile.in                 This is a template for `configure'
                                to use to make a Makefile.  Created by
                                Automake.

    Makefile.am                 This is a template for Automake
                                to use to make a Makefile.in.


code:
#+##############################################################################
#
# T2h_i18n.pm: Internationalization for texi2html
#
#    Copyright (C) 1999, 2000, 2003, 2007, 2009 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License,
# or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# hashes were taken from texi2html.init in 2003.
# Code originally written by Patrice Dumas.
#
#-##############################################################################

# This requires perl version 5 or higher
require 5.0;

package Texi2HTML::I18n;

use strict;

use vars qw(
@ISA
@EXPORT
);

use Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(pretty_date);

my $language;
my $i18n_dir = 'i18n'; # name of the directory containing the per language files
#my $translation_file = 'translations.pl'; # file containing all the translations
#my @known_languages = ('de', 'nl', 'es', 'no', 'pt', 'fr'); # The supported
                                               # languages

########################################################################
# Language dependencies:
# To add a new language extend the WORDS hash and create $T2H_<...>_WORDS hash
# To redefine one word, simply do:
# $T2h_i18n::T2H_LANGUAGES->{<language>}->{<word>} = 'whatever' in your personal init file.
#

# Those hashes are obsolete but retained here for reference

my $T2H_WORDS_EN =
{
 # titles  of pages
 #'Table of Contents'       => 'Table of Contents',
 #'Short Table of Contents'  => 'Short Table of Contents',
 #'Index'     => 'Index',
 #'About This Document'     => 'About This Document',
 #'Footnotes' => 'Footnotes',
 #'See'             => 'See',
 #'see'             => 'see',
 #'section'         => 'section',
 'About This Document'       => '',
 'Table of Contents'         => '',
 'Short Table of Contents',  => '',
 'Index'                     => '',
 'Footnotes'                 => '',
 'See'                       => '',
 'see'                       => '',
 'section'                   => '',
 'Top'                       => '',
 'Untitled Document'         => '',
 # If necessary, we could extend this as follows:
 #  # text for buttons
 #  'Top_Button' => 'Top',
 #  'ToC_Button' => 'Contents',
 #  'Overview_Button' => 'Overview',
 #  'Index_button' => 'Index',
 #  'Back_Button' => 'Back',
 #  'FastBack_Button' => 'FastBack',
 #  'Prev_Button' => 'Prev',
 #  'Up_Button' => 'Up',
 #  'Next_Button' => 'Next',
 #  'Forward_Button' =>'Forward',
 #  'FastWorward_Button' => 'FastForward',
 #  'First_Button' => 'First',
 #  'Last_Button' => 'Last',
 #  'About_Button' => 'About'
 'January' => '',
 'February' => '',
 'March' => '',
 'April' => '',
 'May' => '',
 'June' => '',
 'July' => '',
 'August' => '',
 'September' => '',
 'October' => '',
 'November' => '',
 'December' => '',
 'T2H_today' => '%s, %d %d',
};

my $T2H_WORDS_DE =
{
 'Table of Contents'       => 'Inhaltsverzeichniss',
 'Short Table of Contents'  => 'Kurzes Inhaltsverzeichniss',
 'Index'     => 'Index',
 'About This Document'     => 'Über dieses Dokument',
 'Footnotes' => 'Fußnoten',
 'See'             => 'Siehe',
 'see'             => 'siehe',
 'section'         => 'Abschnitt',
 'January' => 'Januar',
 'February' => 'Februar',
 'March' => 'März',
 'April' => 'April',
 'May' => 'Mai',
 'June' => 'Juni',
 'July' => 'Juli',
 'August' => 'August',
 'September' => 'September',
 'October' => 'Oktober',
 'November' => 'November',
 'December' => 'Dezember',
};

my $T2H_WORDS_NL =
{
 'Table of Contents'       => 'Inhoudsopgave',
 'Short Table of Contents'  => 'Korte inhoudsopgave',
 'Index'     => 'Index',      #Not sure ;-)
 'About This Document'     => 'No translation available!', #No translation available!
 'Footnotes' => 'No translation available!', #No translation available!
 'See'             => 'Zie',
 'see'             => 'zie',
 'section'         => 'sectie',
 'January' => 'Januari',
 'February' => 'Februari',
 'March' => 'Maart',
 'April' => 'April',
 'May' => 'Mei',
 'June' => 'Juni',
 'July' => 'Juli',
 'August' => 'Augustus',
 'September' => 'September',
 'October' => 'Oktober',
 'November' => 'November',
 'December' => 'December',
};

my $T2H_WORDS_ES =
{
 'Table of Contents'       => 'índice General',
 'Short Table of Contents'  => 'Resumen del Contenido',
 'Index'     => 'Index',      #Not sure ;-)
 'About This Document'     => 'No translation available!', #No translation available!
 'Footnotes' => 'Fußnoten',
 'See'             => 'Véase',
 'see'             => 'véase',
 'section'         => 'sección',
 'January' => 'enero',
 'February' => 'febrero',
 'March' => 'marzo',
 'April' => 'abril',
 'May' => 'mayo',
 'June' => 'junio',
 'July' => 'julio',
 'August' => 'agosto',
 'September' => 'septiembre',
 'October' => 'octubre',
 'November' => 'noviembre',
 'December' => 'diciembre',
};

my $T2H_WORDS_NO =
{
 'Table of Contents'       => 'Innholdsfortegnelse',
 'Short Table of Contents'  => 'Kort innholdsfortegnelse',
 'Index'     => 'Indeks',     #Not sure ;-)
 'About This Document'     => 'No translation available!', #No translation available!
 'Footnotes' => 'No translation available!',
 'See'             => 'Se',
 'see'             => 'se',
 'section'         => 'avsnitt',
 'January' => 'januar',
 'February' => 'februar',
 'March' => 'mars',
 'April' => 'april',
 'May' => 'mai',
 'June' => 'juni',
 'July' => 'juli',
 'August' => 'august',
 'September' => 'september',
 'October' => 'oktober',
 'November' => 'november',
 'December' => 'desember',
};

my $T2H_WORDS_PT =
{
 'Table of Contents'       => 'Sumário',
 'Short Table of Contents'  => 'Breve Sumário',
 'Index'     => 'Índice', #Not sure ;-)
 'About This Document'     => 'No translation available!', #No translation available!
 'Footnotes' => 'No translation available!',
 'See'             => 'Veja',
 'see'             => 'veja',
 'section'         => 'Seção',
 'January' => 'Janeiro',
 'February' => 'Fevereiro',
 'March' => 'Março',
 'April' => 'Abril',
 'May' => 'Maio',
 'June' => 'Junho',
 'July' => 'Julho',
 'August' => 'Agosto',
 'September' => 'Setembro',
 'October' => 'Outubro',
 'November' => 'Novembro',
 'December' => 'Dezembro',
};

my $T2H_WORDS_FR =
{
 'Table of Contents'       => 'Table des matières',
 'Short Table of Contents'  => 'Résumée du contenu',
 'Index'     => 'Index',
 'About This Document'     => 'A propos de ce document',
 'Footnotes' => 'Notes de bas de page',
 'See'             => 'Voir',
 'see'             => 'voir',
 'section'         => 'section',
 'January' => 'Janvier',
 'February' => 'Février',
 'March' => 'Mars',
 'April' => 'Avril',
 'May' => 'Mai',
 'June' => 'Juin',
 'July' => 'Juillet',
 'August' => 'Août',
 'September' => 'Septembre',
 'October' => 'Octobre',
 'November' => 'Novembre',
 'December' => 'Décembre',
 'T2H_today' => 'le %2$d %1$s %3$d'
};

#$T2H_LANGUAGES =
#{
# 'en' => $T2H_WORDS_EN,
# 'de' => $T2H_WORDS_DE,
# 'nl' => $T2H_WORDS_NL,
# 'es' => $T2H_WORDS_ES,
# 'no' => $T2H_WORDS_NO,
# 'pt' => $T2H_WORDS_PT,
# 'fr' => $T2H_WORDS_FR,
#};

sub set_language($)
{
    my $lang = shift;
    if (defined($lang) && exists($Texi2HTML::Config::LANGUAGES->{$lang}) && defined($Texi2HTML::Config::LANGUAGES->{$lang}))
    {
         $language = $lang;
         return 1;
    }
    else
    {
         return 0;
    }
}

sub get_language()
{
    return $language;
}

my @MONTH_NAMES =
    (
     'January', 'February', 'March', 'April', 'May',
     'June', 'July', 'August', 'September', 'October',
     'November', 'December'
    );

# This is not used as code, but used to mark months as strings to be
# translated
if (0)
{
    my @mark_month_for_translation = (
     gdt('January'),
     gdt('February'),
     gdt('March'),
     gdt('April'),
     gdt('May'),
     gdt('June'),
     gdt('July'),
     gdt('August'),
     gdt('September'),
     gdt('October'),
     gdt('November'),
     gdt('December')
    );
}

my $I = \&get_string;

sub pretty_date($)
{
    my $lang = shift;
    my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);

    ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
    $year += ($year < 70) ? 2000 : 1900;
    return main::gdt('{month} {day}, {year}', { 'month' => main::gdt($MONTH_NAMES[$mon]),
          'day' => $mday, 'year' => $year });
}

my $error_no_en = 0;

my %missing_strings;

# arguments should already be converted
sub get_string($;$$)
{
    my $string = shift;
    my $arguments = shift;
    $arguments = undef if (!ref($arguments));
    my $state = shift;
    # if duplicate is passed, it means that we are in the text and so should
    # use the main state
    if (defined($state) and $state->{'duplicate'} and defined($Texi2HTML::THISDOC{'state'}))
    {
        $state = main::duplicate_formatting_state($Texi2HTML::THISDOC{'state'});
    }

    my $translated_string;
    my $T2H_LANGUAGES = $Texi2HTML::Config::LANGUAGES;
    if (! exists($T2H_LANGUAGES->{'en'}))
    {
        unless($error_no_en)
        {
            print STDERR "i18n: no LANGUAGES->{'en'} hash\n";
            $error_no_en = 1;
        }
    }
    else
    {
        unless (exists ($T2H_LANGUAGES->{'en'}->{$string}))
        {
            unless (exists($missing_strings{$string}))
            {
                #print STDERR "i18n: missing string $string\n";
                $missing_strings{$string} = 1;
            }
        }
        if (defined ($T2H_LANGUAGES->{$language}->{$string}) and
           ($T2H_LANGUAGES->{$language}->{$string} ne ''))
        {
            $translated_string = $T2H_LANGUAGES->{$language}->{$string};
        }
        elsif (defined ($T2H_LANGUAGES->{'en'}->{$string}) and
            ($T2H_LANGUAGES->{'en'}->{$string} ne ''))
        {
            $translated_string = $T2H_LANGUAGES->{'en'}->{$string};
        }
        else
        {
            $translated_string = $string;
        }
    }
    return main::substitute_line($translated_string, "translation",  $state) unless (defined($arguments) or !keys(%$arguments));

    # taken from libintl perl, copyright Guido. sub __expand
    my %args = %$arguments;
    my $re = join '|', map { quotemeta $_ } keys %args;

    if ($state->{'keep_texi'})
    {
        $translated_string =~ s/\{($re)\}/defined $args{$1} ? $args{$1} : "{$1}"/ge;
        return $translated_string;
    }

    # if there are arguments, we must protect the {arg} constructs before
    # doing substitute_line. So there is a first pass here to change {arg}
    # to %@internal_translation_open_brace{}arg@internal_translation_close_brace{}
    $translated_string =~ s/\{($re)\}/\@internal_translation_open_brace\{\}$1\@internal_translation_close_brace\{\}/g;
    foreach my $map (\%Texi2HTML::Config::things_map, \%Texi2HTML::Config::pre_map,  \%Texi2HTML::Config::texi_map, \%Texi2HTML::Config::simple_format_texi_map)
    {
         $map->{'internal_translation_open_brace'} = '{';
         $map->{'internal_translation_close_brace'} = '}';
    }
    $translated_string = main::substitute_line($translated_string, "translation", $state);
    $translated_string =~ s/\{($re)\}/defined $args{$1} ? $args{$1} : "{$1}"/ge;
    foreach my $map (\%Texi2HTML::Config::things_map, \%Texi2HTML::Config::pre_map,  \%Texi2HTML::Config::texi_map, \%Texi2HTML::Config::simple_format_texi_map)
    {
         delete $map->{'internal_translation_open_brace'};
         delete $map->{'internal_translation_close_brace'};
    }
    return $translated_string;

}

1;


code:
#+##############################################################################
#
# T2h_l2h.pm: interface to LaTeX2HTML
#
#    Copyright (C) 1999, 2000, 2003, 2005, 2006, 2009 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License,
# or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# This code was taken from the main texi2html file in 2006.
# Certainly originally written by Olaf Bachmann.
#
#-##############################################################################

require 5.0;
use strict;

package Texi2HTML::LaTeX2HTML;
use Cwd;

# latex2html conversions consist of three stages:
# 1) to latex: Put "latex" code into a latex file
#                    (init, to_latex, finish_to_latex)
# 2) to html: Use latex2html to generate corresponding html code and images
#                    (to_html)
# 3) from html: Extract generated code and images from latex2html run
#                    (init_from_html, do_tex)

# init l2h defaults for files and names

# global variable used for caching
# FIXME there is no reason for this variable to be global
use vars qw(
            %l2h_cache
           );

my ($l2h_name, $l2h_latex_file, $l2h_cache_file, $l2h_html_file, $l2h_prefix);

# holds the status of latex2html operations. If 0 it means that there was
# an error
my $status = 0;

my $debug;
my $verbose;
my $docu_rdir;
my $docu_name;

# init_from_html
my $extract_error_count;
my $invalid_counter_count;

# change_image_file_names
my %l2h_img;            # associate src file to destination file
                        # such that files are not copied twice
my $image_count;

# do_tex
my $html_output_count = 0;   # html text outputed in html result file

##########################
#
# First stage: Generation of Latex file
# Initialize with: init
# Add content with: to_latex ($text) --> HTML placeholder comment
# Finish with: finish_to_latex
#

my $l2h_latex_preamble = <<EOT;
% This document was automatically generated by the l2h extenstion of texi2html
% DO NOT EDIT !!!
\\documentclass{article}
\\usepackage{html}
\\begin{document}
EOT

my $l2h_latex_closing = <<EOT;
\\end{document}
EOT

my %l2h_to_latex = ();         # associate a latex text with the index in the
                               # html result array.
my @l2h_to_latex = ();         # array used to associate the index with
                               # the original latex text.
my $latex_count = 0;           # number of latex texts really stored
my $latex_converted_count = 0; # number of latex texts passed through latex2html
my $to_latex_count = 0;        # total number of latex texts processed
my $cached_count = 0;          # number of cached latex texts
%l2h_cache = ();               # the cache hash. Associate latex text with
                               # html from the previous run
my @l2h_from_html;             # array of resulting html

my %global_count = ();         # associate a command name and the
                               # corresponding counter to the index in the
                               # html result array

# set $status to 1, if l2h could be initalized properly, to 0 otherwise
sub init()
{

   %l2h_to_latex = ();         # associate a latex text with the index in the
                               # html result array.
   @l2h_to_latex = ();         # array used to associate the index with
                               # the original latex text.
   $latex_count = 0;           # number of latex texts really stored
   $latex_converted_count = 0; # number of latex texts passed through latex2html
   $to_latex_count = 0;        # total number of latex texts processed
   $cached_count = 0;          # number of cached latex texts
   %l2h_cache = ();            # the cache hash. Associate latex text with
                               # html from the previous run
   @l2h_from_html = ();        # array of resulting html

   %global_count = ();         # associate a command name and the
                               # corresponding counter to the index in the
                               # html result array
   $extract_error_count = 0;
   $invalid_counter_count = 0;
   %l2h_img = ();       # associate src file to destination file
                        # such that files are not copied twice
   $image_count = 1;

   $html_output_count = 0;   # html text outputed in html result file
   $status = 0;
   return if ($Texi2HTML::Config::null_device_file{$Texi2HTML::THISDOC{'filename'}->{'top'}});

    $docu_name = $Texi2HTML::THISDOC{'file_base_name'};
    $docu_rdir = $Texi2HTML::THISDOC{'destination_directory'};
    $docu_rdir = '' if (!defined($docu_rdir));
    $l2h_name =  "${docu_name}_l2h";
    $l2h_latex_file = "$docu_rdir${l2h_name}.tex";
    $l2h_cache_file = "${docu_rdir}${docu_name}-l2h_cache.pm";
    # destination dir -- generated images are put there, should be the same
    # as dir of enclosing html document --
    $l2h_html_file = "$docu_rdir${l2h_name}.html";
    $l2h_prefix = "${l2h_name}_";
    $debug = $Texi2HTML::THISDOC{'debug_l2h'};
    $verbose = Texi2HTML::Config::get_conf('VERBOSE');

    unless (Texi2HTML::Config::get_conf('L2H_SKIP'))
    {
        unless (open(L2H_LATEX, ">$l2h_latex_file"))
        {
            main::document_error ("l2h: Can't open latex file '$l2h_latex_file' for writing: $!");
            $status = 0;
            return;
        }
        warn "# l2h: use ${l2h_latex_file} as latex file\n" if ($verbose);
        print L2H_LATEX $l2h_latex_preamble;
    }
    # open the database that holds cached text
    init_cache() if (!defined(Texi2HTML::Config::get_conf('L2H_SKIP')) or Texi2HTML::Config::get_conf('L2H_SKIP'));
    $status = 1;
}

# print text (2nd arg) into latex file (if not already there nor in cache)
# which can be later on replaced by the latex2html generated text.
#
sub to_latex($$$)
{
    my $command = shift;
    my $text = shift;
    my $counter = shift;
    return unless ($status);
    if ($command eq 'tex')
    {
        $text .= ' ';
    }
    elsif ($command eq 'math')
    {
        $text = "\$".$text."\$";
    }
    $to_latex_count++;
    $text =~ s/(\s*)$//;
    # try whether we have text already on things to do
    my $count = $l2h_to_latex{$text};
    unless ($count)
    {
        $latex_count++;
        $count = $latex_count;
        # try whether we can get it from cache
        my $cached_text = from_cache($text);
        if (defined($cached_text))
        {
             $cached_count++;
             # put the cached result in the html result array
             $l2h_from_html[$count] = $cached_text;
        }
        else
        {
             $latex_converted_count++;
             unless (Texi2HTML::Config::get_conf('L2H_SKIP'))
             {
                 print L2H_LATEX "\\begin{rawhtml}\n\n";
                 print L2H_LATEX "<!-- l2h_begin $l2h_name $count -->\n";
                 print L2H_LATEX "\\end{rawhtml}\n";

                 print L2H_LATEX "$text\n";

                 print L2H_LATEX "\\begin{rawhtml}\n";
                 print L2H_LATEX "<!-- l2h_end $l2h_name $count -->\n\n";
                 print L2H_LATEX "\\end{rawhtml}\n";
            }
        }
        $l2h_to_latex[$count] = $text;
        $l2h_to_latex{$text} = $count;
    }
    $global_count{"${command}_$counter"} = $count;
    return 1;
}

# print closing into latex file and close it
sub finish_to_latex()
{
    my $reused = $to_latex_count - $latex_converted_count - $cached_count;
    unless (Texi2HTML::Config::get_conf('L2H_SKIP'))
    {
        print L2H_LATEX $l2h_latex_closing;
        close (L2H_LATEX);
    }
    warn "# l2h: finished to latex ($cached_count cached, $reused reused, $latex_converted_count to process)\n" if ($verbose);
    unless ($latex_count)
    {
        # no @tex nor @math
        finish();
        return 0;
    }
    return 1;
}

###################################
# Second stage: Use latex2html to generate corresponding html code and images
#
# to_html([$l2h_latex_file, [$l2h_html_dir]]):
#   Call latex2html on $l2h_latex_file
#   Put images (prefixed with $l2h_name."_") and html file(s) in $l2h_html_dir
#   Return 1, on success
#          0, otherwise
#
sub to_html()
{
    my ($call, $dotbug);
    # when there are no tex constructs to convert (happens in case everything
    # comes from the cache), there is no latex2html run
    if (Texi2HTML::Config::get_conf('L2H_SKIP') or ($latex_converted_count == 0))
    {
        warn "# l2h: skipping latex2html run\n" if ($verbose);
        return 1;
    }
    # Check for dot in directory where dvips will work
    if (Texi2HTML::Config::get_conf('L2H_TMP'))
    {
        if (Texi2HTML::Config::get_conf('L2H_TMP') =~ /\./)
        {
            main::document_warn ("l2h: l2h_tmp dir contains a dot.");
            $dotbug = 1;
        }
    }
    else
    {
        if (cwd() =~ /\./)
        {
            main::document_warn ("l2h: current dir contains a dot.");
            $dotbug = 1;
        }
    }
    # fix it, if necessary and hope that it works
    #$Texi2HTML::Config::L2H_TMP = "/tmp" if ($dotbug);
    return 0 if ($dotbug);

    $call = Texi2HTML::Config::get_conf('L2H_L2H');
    # use init file, if specified
    #my $init_file = main::locate_init_file(Texi2HTML::Config::get_conf('L2H_FILE'));
    my $init_file = Texi2HTML::Config::get_conf('L2H_FILE');
    $call = $call . " -init_file " . $init_file if (defined($init_file) and $init_file ne '' and -f $init_file and -r $init_file);
    # set output dir
    $call .=  (($docu_rdir ne '') ? " -dir $docu_rdir" : " -no_subdir");
    # use l2h_tmp, if specified
    $call .= " -tmp ".Texi2HTML::Config::get_conf('L2H_TMP')
         if (defined(Texi2HTML::Config::get_conf('L2H_TMP')) and Texi2HTML::Config::get_conf('L2H_TMP') ne '');
    # use a given html version if specified
    $call .= " -html_version ".Texi2HTML::Config::get_conf('L2H_HTML_VERSION')
      if (defined(Texi2HTML::Config::get_conf('L2H_HTML_VERSION')) and Texi2HTML::Config::get_conf('L2H_HTML_VERSION') ne '');
    # options we want to be sure of
    $call .= " -address 0 -info 0 -split 0 -no_navigation -no_auto_link";
    $call .= " -prefix $l2h_prefix $l2h_latex_file";

    warn "# l2h: executing '$call'\n" if ($verbose);
    if (system($call))
    {
        main::document_error ("l2h: '${call}' did not succeed");
        return 0;
    }
    else
    {
        warn "# l2h: latex2html finished successfully\n" if ($verbose);
        return 1;
    }
}

##########################
# Third stage: Extract generated contents from latex2html run
# Initialize with: init_from_html
#   open $l2h_html_file for reading
#   reads in contents into array indexed by numbers
#   return 1,  on success -- 0, otherwise
# Finish with: finish
#   closes $l2h_html_dir/$l2h_name.".$docu_ext"

# the images generated by latex2html have names like ${docu_name}_l2h_img?.png
# they are copied to ${docu_name}_?.png, and html is changed accordingly.

# FIXME is it really necessary to bother doing that? Looks like an unneeded
# complication to me (pertusus, 2009), and it could go bad if there is some
# SRC="(.*?)" in the text (though the regexp could be made more specific).

# %l2h_img;            # associate src file to destination file
                        # such that files are not copied twice
sub change_image_file_names($)
{
    my $content = shift;
    my @images = ($content =~ /SRC="(.*?)"/g);
    my ($src, $dest);

    for $src (@images)
    {
        $dest = $l2h_img{$src};
        unless ($dest)
        {
            my $ext = '';
            if ($src =~ /.*\.(.*)$/ and (!defined(Texi2HTML::Config::get_conf('EXTENSION')) or $1 ne Texi2HTML::Config::get_conf('EXTENSION')))
            {
                $ext = ".$1";
            }
            else
            { # A warning when the image extension is the same than the
              # document extension. copying the file could result in
              # overwriting an output file (almost surely if the default
              # texi2html file names are used).
                main::document_warn ("L2h image $src has invalid extension");
                next;
            }
            while (-e "$docu_rdir${docu_name}_${image_count}$ext")
            {
                $image_count++;
            }
            $dest = "${docu_name}_${image_count}$ext";
            if ($debug)
            {
               # not portable, but only used with debug.
               system("cp -f $docu_rdir$src $docu_rdir$dest");
            }
            else
            {
               # FIXME error condition not checked.
               rename ("$docu_rdir$src", "$docu_rdir$dest");
            }
            $l2h_img{$src} = $dest;
            #unlink "$docu_rdir$src" unless ($debug);
        }
        $content =~ s/SRC="$src"/SRC="$dest"/g;
    }
    return $content;
}

sub init_from_html()
{
    # when there are no tex constructs to convert (happens in case everything
    # comes from the cache), the html file that was generated by previous
    # latex2html runs isn't reused.
    if ($latex_converted_count == 0)
    {
        return 1;
    }

    if (! open(L2H_HTML, "<$l2h_html_file"))
    {
        main::document_warn ("l2h: Can't open $l2h_html_file for reading");
        return 0;
    }
    warn "# l2h: use $l2h_html_file as html file\n" if ($verbose);

    my $html_converted_count = 0;   # number of html resulting texts
                                    # retrieved in the file

    my ($count, $h_line);
    while ($h_line = <L2H_HTML>)
    {
        if ($h_line =~ /!-- l2h_begin $l2h_name ([0-9]+) --/)
        {
            $count = $1;
            my $h_content = '';
            my $h_end_found = 0;
            while ($h_line = <L2H_HTML>)
            {
                if ($h_line =~ /!-- l2h_end $l2h_name $count --/)
                {
                    $h_end_found = 1;
                    chomp $h_content;
                    chomp $h_content;
                    $html_converted_count++;
                    # transform image file names and copy image files
                    $h_content = change_image_file_names($h_content);
                    # store result in the html result array
                    $l2h_from_html[$count] = $h_content;
                    # also add the result in cache hash
                    $l2h_cache{$l2h_to_latex[$count]} = $h_content;
                    last;
                }
                $h_content = $h_content.$h_line;
            }
            unless ($h_end_found)
            { # couldn't found the closing comment. Certainly  a bug.
                main::msg_debug ("l2h: l2h_end $l2h_name $count not found");
                close(L2H_HTML);
                return 0;
            }
        }
    }

    # Not the same number of converted elements and retrieved elements
    if ($latex_converted_count != $html_converted_count)
    {
        main::msg_debug ("l2h: waiting for $latex_converted_count elements found $html_converted_count");
    }

    warn "# l2h: Got $html_converted_count of $latex_count html contents\n"
        if ($verbose);

    close(L2H_HTML);
    return 1;
}

# $html_output_count = 0;   # html text outputed in html result file

# called each time a construct handled by latex2html is encountered, should
# output the corresponding html
sub do_tex($$$$)
{
    my $style = shift;
    my $counter = shift;
    my $state = shift;
    return unless ($status);
    my $count = $global_count{"${style}_$counter"};
    ################################## begin debug section (incorrect counts)
    if (!defined($count))
    {
         # counter is undefined
         $invalid_counter_count++;
         main::msg_debug ("l2h: undefined count for ${style}_$counter");
         return ("<!-- l2h: ". __LINE__ . " undef count for ${style}_$counter -->")
                if ($debug);
         return '';
    }
    elsif(($count <= 0) or ($count > $latex_count))
    {
        # counter out of range
        $invalid_counter_count++;
        main::msg_debug ("l2h: Request of $count content which is out of valide range [0,$latex_count)");
         return ("<!-- l2h: ". __LINE__ . " out of range count $count -->")
                if ($debug);
         return '';
    }
    ################################## end debug section (incorrect counts)

    # this seems to be a valid counter
    my $result = '';
    $result = "<!-- l2h_begin $l2h_name $count -->" if ($debug);
    if (defined($l2h_from_html[$count]))
    {
         $html_output_count++;
         # maybe we could also have something if simple_format
         # with Texi2HTML::Config::protect_text in case there
         # was some @math on a line passed through simple_format.
         # This would certainly be illegal texinfo, however.
         if ($state->{'remove_texi'})
         {# don't protect anything
             $result .= $l2h_to_latex[$count];
         }
         else
         {
             $result .= $l2h_from_html[$count];
         }
    }
    else
    {
    # if the result is not in @l2h_from_html, there is an error somewhere.
        $extract_error_count++;
        main::msg_debug ("l2h: can't extract content $count from html");
        # try simple (ordinary) substitution (without l2h)
        $result .= "<!-- l2h: ". __LINE__ . " use texi2html -->" if ($debug);
        $result .= main::substitute_text({}, undef, 'error in l2h', $l2h_to_latex[$count]);
    }
    $result .= "<!-- l2h_end $l2h_name $count -->" if ($debug);
    return $result;
}

# store results in the cache and remove temporary files.
sub finish()
{
    return unless($status);
    if ($verbose)
    {
        if ($extract_error_count + $invalid_counter_count)
        {
            warn "# l2h: finished from html ($extract_error_count extract and $invalid_counter_count invalid counter errors)\n";
        }
        else
        {
            warn "# l2h: finished from html (no error)\n";
        }
        if ($html_output_count != $latex_converted_count)
        { # this may happen if @-commands are collected at some places
          # but @-command at those places are not expanded later. For
          # example @math on @multitable lines.
             warn "# l2h: $html_output_count html outputed for $latex_converted_count converted\n";
        }
    }
    store_cache();
    if (Texi2HTML::Config::get_conf('L2H_CLEAN'))
    {
        local ($_);
        warn "# l2h: removing temporary files generated by l2h extension\n"
            if $verbose;
        while (<"$docu_rdir$l2h_name"*>)
        {
# FIXME error condition not checked
            unlink $_;
        }
    }
    warn "# l2h: Finished\n" if $verbose;
    return 1;
}

# the driver of end of first pass and second pass
#
sub latex2html()
{
    return unless($status);
    return unless ($status = finish_to_latex());
    return unless ($status = to_html());
}

##############################
# stuff for l2h caching
#
# FIXME it is clear that l2h stuff takes very long compared with texi2html
# which is already quite long. However this also adds some complexity

# I tried doing this with a dbm data base, but it did not store all
# keys/values. Hence, I did as latex2html does it
sub init_cache
{
    if (-r "$l2h_cache_file")
    {
        my $rdo = do "$l2h_cache_file";
        main::document_error ("l2h: could not load $docu_rdir$l2h_cache_file: $@")
            unless ($rdo);
    }
}

# store all the text obtained through latex2html
sub store_cache
{
    return unless $latex_count;
    my ($key, $value);
    unless (open(FH, ">$l2h_cache_file"))
    {
        main::document_error ("l2h: could not open $docu_rdir$l2h_cache_file for writing: $!");
        return;
    }
    #while (($key, $value) = each %l2h_cache)
    foreach my $key(sort(keys(%l2h_cache))) {
        $value = $l2h_cache{$key};
        # escape stuff
        $key =~ s|/|\\/|g;
        $key =~ s|\\\\/|\\/|g;
        # weird, a \ at the end of the key results in an error
        # maybe this also broke the dbm database stuff
        $key =~ s|\\$|\\\\|;
        $value =~ s/\|/\\\|/go;
        $value =~ s/\\\\\|/\\\|/go;
        $value =~ s|\\\\|\\\\\\\\|g;
        print FH "\n\$l2h_cache_key = q/$key/;\n";
        print FH "\$l2h_cache{\$l2h_cache_key} = q|$value|;\n";
    }
    print FH "1;";
    close (FH);
}

# return cached html, if it exists for text, and if all pictures
# are there, as well
sub from_cache($)
{
    my $text = shift;
    my $cached = $l2h_cache{$text};
    if (defined($cached))
    {
        while ($cached =~ m/SRC="(.*?)"/g)
        {
            unless (-e "$docu_rdir$1")
            {
                return undef;
            }
        }
        return $cached;
    }
    return undef;
}

1;