code:
Regenerate tests:
sh autogen.sh
./configure
make
make check-local
cd test
./manage_test_archives.sh get
cd ..
tar xzvf t2h_tests_files.tar.gz
cd test
./base_tests
./long_tests
./tex_html_tests
make copy-tests copy-tex-html

This file contains a list of things yet to be done:

Note
----

Remove texi2html generated files
rm -f ABOUT-NLS INSTALL aclocal.m4 config.guess config.sub configure install-sh missing

Before next release
-------------------

Later
-----

Profiling example:

perl -w -x -d:NYTProf  ../../texi2html.pl texinfo.texi
nytprofhtml
firefox nytprof/index.html

* the real macro that lead to the expanded text where an error is found
  cannot be determined since there is one information for one line, even
  if there were more than one macro expanded on the line.

* automatic menus.

* automatic nodes, if feasible (issue of unicity, mostly).

* not a priority since it involves a lot of work. It would be nice to
  have the texinfo parsing in a separate perl module (as Derek suggested).
  It would do a tree out of texinfo code, and also a tree of the
  nodes/sections in a completly output independent way. This would allow
  to bring back some info specific stuff (for info output a tree is done)
  in the main program and have maybe something simpler.

  Also remove all the modification of the texinfo.  Instead modify the
  generated tree.

* with --quiet/--silent silence tex4ht and latex2html by redirecting to
  /dev/null.

* test --headers --output, and the other order, especially when in
  info mode, such that it triggers also plaintext. Also test with
  directories and files.

* check for (both split and not split)

  --out foo/ --out bar/file.html

  --out foo/ --out file.html

* have a way to know whether a description is present or not
  when formatting the menu_entry. This could allow not having a
  colon after menu_entry when there is no description.

* call a specific function reference to format the @author for
  a quotation?

* test a mix of misc commands that should be at the begining of a line
  and those that don't need to (comment c sp refill noindent indent).
  Test a misc command that should be at the begining of a line followed
  by another one.  And also mix with other type of command.

* line breaking could happen after a full width character.
  Accordingly, in japanese.texi lines are not cut right.

* warn in all formats for @comma in node and error if in Info.
  Also many characters (. : ...) break menu entry parsing in Info files.

* images.texi, paragraph_in_samp.texi should be tested in xml too.
  Maybe they should be moved to coverage, and in coverage all the formats
  should be tested like in sectioning.

* invalid/caption_not_closed.texi some doubtful

  appears, it is empty and it isn't clear where it comes from.
  similarly in formatting/table_in_table_item.texi, some empty stuff:

* add --command command line that gives inserted lines. This should wait
  for @setfilename status to be resolved, on TeX, since otherwise there
  is the issue of inserting before or after @setfilename to be resolved.

* many FIXME in the code

* relevant makeinfo error messages not used
"Footnotes inside footnotes are not allowed"
"%cfloat environments cannot be nested"

"%s: Skipping macro expansion to stdout as Info output is going there.\n"

* Create detailed texinfo documentation (see in doc)

* add sample init files for different layouts
  - use events (onmousover, etc) for anchors
  - use style-sheets for formatting of various elements (like @example,
  etc).
  - xhtml with in line style
  - Singular manual style
  - How complicated could it be to get a creation of SGML ?
  - to LaTeX
  - to RTF
  - to open document

* Document
  The fact that there are 3 commands that may be called, and --program.

  $Texi2HTML::THISDOC{'htmlxref'}
  $Texi2HTML::THISDOC{'hyphenation'}
  $Texi2HTML::THISDOC{'do_about'}
  $Texi2HTML::THISDOC{'split_level'}
  $Texi2HTML::THISDOC{'line_nr'}
  $Texi2HTML::THISDOC{'format_from_command_line'}
  Cf the comment in the manual.

  Texi2HTML::THIS_ELEMENT
  $INDEX_ENTRY_COLON
  $MENU_ENTRY_COLON
  'childnext'

  Maybe document the following, maybe not:
  language_codes
  region_codes
  print_redirection_page
  t2h_add_text_substitutions, t2h_remove_text_substitutions,
  @text_substitutions_normal, @text_substitutions_texi,
  @text_substitutions_simple_format, @text_substitutions_pre and
  t2h_text_substitutions
  t2h_default_set_iso_symbols

* Use omhelp latex parser and mathml generator for both xhtml and
  docbook
        http://www.seanet.com/~bradbell/omhelp/latex.xml

* in LaTeX, @example and the like could be implemented as \fancyvrb
  with fontfamily=helvetica, fontsize=\small commandchars=\\\{\}

* %f$x (index in printf) appeared in perl 5.8.0, 18 jul 2002

* document the css classes:

Sectioning command headings @top, @chapter, @appendix...
h? @var{command_name}

for @display, @example, @smallexample...
pre @var{environment_name}

for @node, in case it is output as a header (which is quite rare).
h3 node-heading

For summary letters in indices
a summary-letter

For lists that should not have a bullet in front
ul no-bullet

When whole menu is in a preformatted environment
pre menu-preformatted

For the menu text between menu entries
pre menu-comment

For a whole header, depending on $HEADER_IN_TABLE:
table header
div header

Others

pre verbatim
pre verbatiminclude
div footnote
table cartouche
blockquote smallquotation
table index-@var{index_name}
div shortcontents
div contents
div float
dl listoffloats
h1 settitle
table menu

@code and @allowcodebreaks false: span nocodebreak
@w and - or _ in word: span nolinebreak

@dots small dots
@endots small enddots
@sansserif span sansserif
@r span roman
@titlefont h1 titlefont

* test stuff on 'line_command' relevant in pass 1, like @macro, @ignore...

* in chm.pm (Jose Fonseca)

[WINDOWS]

Default=,"ug.hhc","ug.hhk","ug.html","ug.html",,,,,0x22520,,0x384e,,,,,,,,0

The numbers are a bitmask of the enabled buttons. The ones here are
IMO a good default. In the future you may also add that as an
option, as the Docbook XSL stylesheets do (see in
http://docbook.sourceforge.net/release/xsl/snapshot/doc/html/rn20.html
all the CHM related parameters one can change).

* antispam @email

<tt><bug-gnulib-nospam@nospam.gnu.org></tt>

* roff is not uptodate. At least the @quote* and @guillem* and many
  others.

* texi2dvi doesn't accept @table in @format

* when there are nested complex_formats, a small format that doesn't have
  style, like smalldisplay in a format with style, like example, the
  smalldisplay will use the class of the above format, and lose the
  small font property.

* decide @documentencoding @. And maybe change regexp. (?)

* test for something along:
@setfilename ../../info/xemacs.info

* docbook: in function no style.
  replaceable is for @var or function argument. Only characters.
  Maybe replaced with parameter?

  Instead of synopsis may use specialized synopsis, funcsynopsis/funcprototype
  for deftype*, funcdef for defffn, ooclass for object oriented.
  deffn:
  <funcsynopsis><funcprototype><funcdef role=...><function>d--effn_name</function></funcdef><paramdef><parameter>args</parameter></paramdef></funcprototype></funcsynopsis>
  defvr, deftypevr: varname, and type and not returnvalue
  deftypefn:
  <funcsynopsis><funcprototype><funcdef role=...>type <function>d--eftypefn_name</function></funcdef><paramdef>a type<parameter>in var..</parameter></paramdef></funcprototype></funcsynopsis>
  deftp: structname/structfield. Both contains a replaceable. Problem with
  structfield is that there should be one by field.
  defcv: classname + property, and category in synopsis
  deftypecv: classname + type + property, and category in synopsis
    fieldsynopsis?
  defop: <classsynopsis><classsynopsisinfo>category</classsynopsisinfo><ooclass><classname>class<><><methodsynopsis><methodname><replaceable><></methodname><methodparam><parameter>...<><><>
  deftypeop: same with type in methodparam.

  also informalfigure in @float

  also use informaltable or table, for multitable?

  What is before the first sectioning command is put in <bookinfo><abstract>.

  what about @titlefont in docbook?

  maybe use simpara instead of para. Indeed, simpara is for paragraph without
  block elent within, and it should be that way in generated output.

  put <title> in <articleinfo>?

  what to do for guilsinglleft, guilsinglright? Currently < > since
  there is no ‹ nor ›

* to solve above issue (first issue), the definition arg formatted with
  simple_format should alo be passed down

* in docbook, when there is only one section
 should be better
  than book. Maybe the best way to do that would be passing the
  information that there is only one section to the functions formatting
  the page header and page footer.

* in docbook, if there are 2 nodes without anything to put an id on
  the first is forgotten. Also why no id on <para>?

* have a special debug mode where text processing is traced. It means
  that PASS_TEXT/SCAN_TEXT is shown and substitute_line (and maybe
  other like substitute_text) and shown, now that there is a nice
  context information.

* when closing @-commands with braces in first passes, the braces are not
  output in order to correct the document. However, end of formats are output
  in the first pass (and therefore these formats cannot be wrong in
  other passes, and nothing is done to close them). Also it is not clear where
  error messages should appear. Indeed in the first pass the line count
  are less precise since commands are closed at the end of file, not when
  finding a @node or @section. If error messages are done in pass_text,
  they won't be output when only macros are expanded, but it has to
  be noted that a normal processing is done with -E which should mitigate
  this issue.

* @anchor{} should always ignore following whitespace (including newlines).
  Karl insists on that for backward compatibility.

* ignore spaces after @ command, before {, like texi2dvi does? Karl
  insists on that because TeX has to do it like that.

* in info, @. @! and @? should always be followed by at least 2 spaces
  even in text, not only on end of lines. Also the number of spaces after
  a . in the text may be adjusted to 2. It is not sure, though, whether
  we should do it or leave it  to the user. There is a bug:
  https://savannah.gnu.org/bugs/?20444

* add tests for -o - and input coming from stdin, including check of
  out file names.
  also -o /dev/null and similar.
  There is also a check in layout/formatting_exotic with
  --internal-links=/dev/null which is not portable

* Perhaps we should also make an option -Werror which turns all warnings
  into errors.

* when determining the different letters and later sorting them, there
  perl sorting and i18n stuff should be used at least when
  --enable-encoding is set. Cf testcases in encoding/encoding_index*.
  Currently, for example for encoding_index-latin1 accented letters are
  at the end. And degree is at o...

* formatting/indicateurl_paragraph.texi there should be a warning that
  a simple_style was cut by a paragraph.

* invalid/node_in_copying there is no error message

* info/long_uref_after_item.texi report from Kevin Ryde,
  it would be logical to treat the space after the itemize mark as
  a tie instead of a breakpoint.

* in sectioning/first_section_no_node in _html, the @unnumbered is included
  in the first node, while makeinfo outputs it before the first node, and
  the header is only output when there is a @node.

* in formatting/table_in_table_item.texi, some lines maybe have too much
  leading spaces (precisely in @code in @table in @table @item, line
in nested table line

* formatting/float_copying index entries in insertcopying are not right.
  Maybe it is because they are in footnotes. Or maybe because they are
  in a caption.

* in examples/chm.pm use main::open_out to open files.

* examples/mediawiki.pm: end of lines within lists leads to empty lines
  that may not be what the user wanted. Maybe this could be ameliorated.

* mediawiki: external links, in node directions, in menus, in @refs
  aren't correct. Not exactly sure what should be correct.

* mediawiki: Cite extension is required for footnotes
  $wgUseTeX = true; required for math

* in xml have documentencoding have an argument.

* for https://savannah.gnu.org/bugs/?25820 it is unclear whether &
  is correct for & or not

* from https://savannah.gnu.org/bugs/?22696, encodings/chinese_mixed_with_en
  the info output is not good with Chinese texts only, not aligned in source
  and a mix of English and Chinese texts.

* Maybe put a lone anchor in a
 for strict html (Noah Slater).

* drop color from body and put in css (Noah Slater).

* maybe put lang= in  and not , though I am not convinced.

* MENU_ENTRY_COLON and INDEX_ENTRY_COLON maybe could be generalized
  to other formats than html

Misc info and boring stuff
--------------------------

* use Unicode::LineBreak if detected for line breaking and character
  width computation.

* texi2html is immune to https://savannah.gnu.org/bugs/?25822

* the following is erroneous, but maybe it could be better handled anyway
-> error with @item on same line than @table
@xref{node,
@table @emph
@item line
text
@end table
}

* test @printindex in diverse contexts and handle right, or complain about
  things like
@code{
@printindex cp
}

* @macro definition in @ifset is parsed but ignored. So in the following, the
@end ifset appearing in the macro is ignored if 'a' is not set, and the
macro isn't defined.

@ifset a
@macro bidule
@end ifset
@end macro
@end ifset

* certainly not a big deal, but in invalid/verb_not_closed @verb content
  is not output

* certainly not a big deal, but in invalid/bad_tab_nesting, the @code quotes
  are not surrounding the @tab, although there is no error message

* @insertcopying in @copying doesn't lead to error message with
  INLINE_INSERTCOPYING. See invalid/recursive_copying

* In indices/makeinfo_index_nodes there is no elements, and thus no
  [Index] link since it uses the index chapter (or @top), and there is
  no chapter nor @top.

* in index_split the section associated with indices is the numbered section
  not the associated node where the @cindex are. Good or bad?

* @chapter following a @appendix still uses a number for numbering, and
  is not affected by the @appendix number. Karl is ok with that.

* manuals/mini_ker result is not valid, because tex4ht and latex2html
  open paragraphs in tex rendering while the whole is already in a
  paragraph.

* utf8.pm doesn't work with info.pm (see encodings/nodetest_to_utf8_latin1)

* menu_description is menucomment in xml.
  menuentry is the menunode+menutitle+menucomment
  menu_comment in makeinfo --xml treated as normal text.
  the documentation, however uses the same words than in texi2html.

* enable_encoding.pm is certainly dependent on USE_UNICODE through
the use of non 8 bit representation of characters.

* code_style is used for code_style style @-commands in remove_texi.
  However since -- is removed to have strict html comments, it looks like
  it isn't.

* empty lines in @hyphenation are not valid for texi2dvi

* @-commands in @node, @ref and @chapter for texi2dvi:
  No @<SPC> @<TAB> at the end of a @node line. But ok in @ref and @anchor and
  within the line.

  @} @{ @- not ok in @anchor, @node, @ref.
  @geq{} @leq{} @arrow{} not ok in @anchor, @node, @ref.
  @abbr @image @verb not ok in @chapter and @ref.
  @env @code @option @samp @command @file @indicateurl @kbd @key @sansserif
    @slanted 8.27@dmn{in} not ok in @ref
  @indicateurl not ok in @chapter.

* in indices/index_special_region.texi, there is the error message
index_special_region.texi:8: Anchor `Copying information' previously defined (l. 8)
This is right since it is used in @insertcopying a lot, but it looks
weird since the line of definition and redefinition are the same.

* simple quotes and @set txicodequoteundirected and txicodequotebacktick
info:
 ' -> ' always

html:
 ' -> '             in code_style and preformatted
 ' -> [lr]squo      otherwise

tex, default:
 ' -> [lr]squo      always

tex + txicodequote*:
 ' -> '             in code_style
 ' -> [lr]squo      otherwise

So things are right as is, but in formats that always set the quotes to
a special font should honor  txicodequote* like tex. There is an example
of such code commented out in texi2html.pm in normal_text.


code:
#! /bin/sh
# Build texi2html.pl from texi2html.temp and $(texi2html_formats).
#
# 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.

if test -z "$7"; then
  echo "$0: expected seven arguments, see Makefile.am." >&2
  exit 1
fi

echo "generating $1 from $2 and $3 $4 $5 $6 $7"

sed -e '4a\
'"# $1: generated by `basename $0` from $2 and $3 $4 $5 $6 $7" \
    -e "/@INIT_HTML@/r $3" \
    -e "/@INIT_INFO@/r $4" \
    -e "/@INIT_DOCBOOK@/r $5" \
    -e "/@INIT_XML@/r $6" \
    -e "/@INIT_PLAINTEXT@/r $7" \
    $2 >$1

if test $? -ne 0; then
  echo "$0: failed to generate $1, moving to -bad, goodbye." >&2
  mv $1 $1-bad
  exit 1
fi

repo_name: mthl/texinfo

license: mit


code:
#! /bin/sh
# Run this to generate all the initial makefiles, etc.

test -f Makefile.am || cd "`dirname \"$0\"`"

#autopoint -f
#cp po/* po_messages
#cp po/* po_document
#rm -rf po

#gettextize -f --no-changelog --po-dir=po_messages
#gettextize -f --no-changelog --po-dir=po_document

# Create `aclocal.m4'.
mkdir -p m4
aclocal -I m4

# Create `Makefile.in' from `Makefile.am', and symlink `install-sh',
# `missing' and `mkinstalldirs' from /usr/share/automake.
automake --add-missing -c

# Create `configure' from `configure.in'.
autoconf


code:
#! /bin/sh
# Build texi2html.temp from $(texi2html_sources).
#
# 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.

if test -z "$9"; then
  echo "$0: expected nine arguments, see Makefile.am." >&2
  exit 1
fi

echo "generating $1 from $2 and $3 $4 $5 $6 $7 $8 $9"

sed -e '4a\
'"# $1: generated by `basename $0` from $2 and $3 $4 $5 $6 $7 $8 $9" \
    -e "/@MYSIMPLE@/r $3" \
    -e "/@T2H_I18N@/r $4" \
    -e "/@INIT@/r $5" \
    -e "/@T2H_TRANSLATIONS_FILE@/r $6" \
    -e "/@T2H_L2H_INIT@/r $7" \
    -e "/@T2H_L2H@/r $8" \
    -e "/@T2H_DOCUMENT_LANGUAGES@/r $9" \
    $2 >$1

if test $? -ne 0; then
  echo "$0: failed to generate $1, moving to -bad, goodbye." >&2
  mv $1 $1-bad
  exit 1
fi


code:
#! @PERL@
#+##############################################################################
#
# check_texinfo.pl: Extract texinfo commands from files
#
#    Copyright (C) 2002 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/>.
#
# Code taken from the texi2html file in 2003.
#
#-##############################################################################

# This requires perl version 5 or higher
require 5.0;

use strict;
use Getopt::Long;
my $verbose;
if (!GetOptions ("verbose"  => \$verbose))
{
    die "usage: $0 [-v] file...\n";
}

die "Need file to check\n" unless @ARGV > 0;

my (%seen, %context);

while (<>)
{
    if (/\@(\*|\.|\:|\@|\{|\})/)
    {
        $seen{$&}++;
        $context{$&} .= "> $_" if $verbose;
        $_ = "$`XX$'";
        redo;
    }
    if (/\@(\w+)/)
    {
        my ($before, $match, $after);
        ($before, $match, $after) = ($`, $&, $');
        if ($before =~ /\b[-\w]+$/ && $after =~ /^[-\w.]*\b/)
        {                   # e-mail address
            $seen{'e-mail address'}++;
            $context{'e-mail address'} .= "> $_" if $verbose;
        }
        else
        {
            $seen{$match}++;
            $context{$match} .= "> $_" if $verbose;
        }
        $match =~ s/^\@/X/;
        $_ = "$before$match$after";
        redo;
    }
}

foreach (sort(keys(%seen)))
{
    if ($verbose)
    {
        print "$_\n";
        print $context{$_};
    }
    else
    {
        print "$_ ($seen{$_})\n";
    }
}


code:
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
#   Copyright 1996-2013 Free Software Foundation, Inc.
#   Taken from GNU libtool, 2001
#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
#   This file is free software; the Free Software Foundation gives
#   unlimited permission to copy and/or distribute it, with or without
#   modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.

# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
#   than 256 bytes, otherwise the compiler driver will dump core. The only
#   known workaround is to choose shorter directory names for the build
#   directory and/or the installation directory.

# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so

host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`

# Code taken from libtool.m4's _LT_CC_BASENAME.

for cc_temp in $CC""; do
  case $cc_temp in
    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
    \-*) ;;
    *) break;;
  esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`

# Code taken from libtool.m4's _LT_COMPILER_PIC.

wl=
if test "$GCC" = yes; then
  wl='-Wl,'
else
  case "$host_os" in
    aix*)
      wl='-Wl,'
      ;;
    mingw* | cygwin* | pw32* | os2* | cegcc*)
      ;;
    hpux9* | hpux10* | hpux11*)
      wl='-Wl,'
      ;;
    irix5* | irix6* | nonstopux*)
      wl='-Wl,'
      ;;
    linux* | k*bsd*-gnu | kopensolaris*-gnu)
      case $cc_basename in
        ecc*)
          wl='-Wl,'
          ;;
        icc* | ifort*)
          wl='-Wl,'
          ;;
        lf95*)
          wl='-Wl,'
          ;;
        nagfor*)
          wl='-Wl,-Wl,,'
          ;;
        pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
          wl='-Wl,'
          ;;
        ccc*)
          wl='-Wl,'
          ;;
        xl* | bgxl* | bgf* | mpixl*)
          wl='-Wl,'
          ;;
        como)
          wl='-lopt='
          ;;
        *)
          case `$CC -V 2>&1 | sed 5q` in
            *Sun\ F* | *Sun*Fortran*)
              wl=
              ;;
            *Sun\ C*)
              wl='-Wl,'
              ;;
          esac
          ;;
      esac
      ;;
    newsos6)
      ;;
    *nto* | *qnx*)
      ;;
    osf3* | osf4* | osf5*)
      wl='-Wl,'
      ;;
    rdos*)
      ;;
    solaris*)
      case $cc_basename in
        f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
          wl='-Qoption ld '
          ;;
        *)
          wl='-Wl,'
          ;;
      esac
      ;;
    sunos4*)
      wl='-Qoption ld '
      ;;
    sysv4 | sysv4.2uw2* | sysv4.3*)
      wl='-Wl,'
      ;;
    sysv4*MP*)
      ;;
    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
      wl='-Wl,'
      ;;
    unicos*)
      wl='-Wl,'
      ;;
    uts4*)
      ;;
  esac
fi

# Code taken from libtool.m4's _LT_LINKER_SHLIBS.

hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no

case "$host_os" in
  cygwin* | mingw* | pw32* | cegcc*)
    # FIXME: the MSVC++ port hasn't been tested in a loooong time
    # When not using gcc, we currently assume that we are using
    # Microsoft Visual C++.
    if test "$GCC" != yes; then
      with_gnu_ld=no
    fi
    ;;
  interix*)
    # we just hope/assume this is gcc and not c89 (= MSVC++)
    with_gnu_ld=yes
    ;;
  openbsd*)
    with_gnu_ld=no
    ;;
esac

ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
  # Set some defaults for GNU ld with shared library support. These
  # are reset later if shared libraries are not supported. Putting them
  # here allows them to be overridden if necessary.
  # Unlike libtool, we use -rpath here, not --rpath, since the documented
  # option of GNU ld is called -rpath, not --rpath.
  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  case "$host_os" in
    aix[3-9]*)
      # On AIX/PPC, the GNU linker is very broken
      if test "$host_cpu" != ia64; then
        ld_shlibs=no
      fi
      ;;
    amigaos*)
      case "$host_cpu" in
        powerpc)
          ;;
        m68k)
          hardcode_libdir_flag_spec='-L$libdir'
          hardcode_minus_L=yes
          ;;
      esac
      ;;
    beos*)
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    cygwin* | mingw* | pw32* | cegcc*)
      # hardcode_libdir_flag_spec is actually meaningless, as there is
      # no search path for DLLs.
      hardcode_libdir_flag_spec='-L$libdir'
      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    haiku*)
      ;;
    interix[3-9]*)
      hardcode_direct=no
      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
      ;;
    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    netbsd*)
      ;;
    solaris*)
      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
        ld_shlibs=no
      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
      case `$LD -v 2>&1` in
        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
          ld_shlibs=no
          ;;
        *)
          if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
            hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
          else
            ld_shlibs=no
          fi
          ;;
      esac
      ;;
    sunos4*)
      hardcode_direct=yes
      ;;
    *)
      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
        :
      else
        ld_shlibs=no
      fi
      ;;
  esac
  if test "$ld_shlibs" = no; then
    hardcode_libdir_flag_spec=
  fi
else
  case "$host_os" in
    aix3*)
      # Note: this linker hardcodes the directories in LIBPATH if there
      # are no directories specified by -L.
      hardcode_minus_L=yes
      if test "$GCC" = yes; then
        # Neither direct hardcoding nor static linking is supported with a
        # broken collect2.
        hardcode_direct=unsupported
      fi
      ;;
    aix[4-9]*)
      if test "$host_cpu" = ia64; then
        # On IA64, the linker does run time linking by default, so we don't
        # have to do anything special.
        aix_use_runtimelinking=no
      else
        aix_use_runtimelinking=no
        # Test if we are trying to use run time linking or normal
        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
        # need to do runtime linking.
        case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
          for ld_flag in $LDFLAGS; do
            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
              aix_use_runtimelinking=yes
              break
            fi
          done
          ;;
        esac
      fi
      hardcode_direct=yes
      hardcode_libdir_separator=':'
      if test "$GCC" = yes; then
        case $host_os in aix4.[012]|aix4.[012].*)
          collect2name=`${CC} -print-prog-name=collect2`
          if test -f "$collect2name" && \
            strings "$collect2name" | grep resolve_lib_name >/dev/null
          then
            # We have reworked collect2
            :
          else
            # We have old collect2
            hardcode_direct=unsupported
            hardcode_minus_L=yes
            hardcode_libdir_flag_spec='-L$libdir'
            hardcode_libdir_separator=
          fi
          ;;
        esac
      fi
      # Begin _LT_AC_SYS_LIBPATH_AIX.
      echo 'int main () { return 0; }' > conftest.c
      ${CC} ${LDFLAGS} conftest.c -o conftest
      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
}'`
      if test -z "$aix_libpath"; then
        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
}'`
      fi
      if test -z "$aix_libpath"; then
        aix_libpath="/usr/lib:/lib"
      fi
      rm -f conftest.c conftest
      # End _LT_AC_SYS_LIBPATH_AIX.
      if test "$aix_use_runtimelinking" = yes; then
        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
      else
        if test "$host_cpu" = ia64; then
          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
        else
          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
        fi
      fi
      ;;
    amigaos*)
      case "$host_cpu" in
        powerpc)
          ;;
        m68k)
          hardcode_libdir_flag_spec='-L$libdir'
          hardcode_minus_L=yes
          ;;
      esac
      ;;
    bsdi[45]*)
      ;;
    cygwin* | mingw* | pw32* | cegcc*)
      # When not using gcc, we currently assume that we are using
      # Microsoft Visual C++.
      # hardcode_libdir_flag_spec is actually meaningless, as there is
      # no search path for DLLs.
      hardcode_libdir_flag_spec=' '
      libext=lib
      ;;
    darwin* | rhapsody*)
      hardcode_direct=no
      if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
        :
      else
        ld_shlibs=no
      fi
      ;;
    dgux*)
      hardcode_libdir_flag_spec='-L$libdir'
      ;;
    freebsd2.2*)
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      ;;
    freebsd2*)
      hardcode_direct=yes
      hardcode_minus_L=yes
      ;;
    freebsd* | dragonfly*)
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      ;;
    hpux9*)
      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
      hardcode_libdir_separator=:
      hardcode_direct=yes
      # hardcode_minus_L: Not really in the search PATH,
      # but as the default location of the library.
      hardcode_minus_L=yes
      ;;
    hpux10*)
      if test "$with_gnu_ld" = no; then
        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
        hardcode_libdir_separator=:
        hardcode_direct=yes
        # hardcode_minus_L: Not really in the search PATH,
        # but as the default location of the library.
        hardcode_minus_L=yes
      fi
      ;;
    hpux11*)
      if test "$with_gnu_ld" = no; then
        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
        hardcode_libdir_separator=:
        case $host_cpu in
          hppa*64*|ia64*)
            hardcode_direct=no
            ;;
          *)
            hardcode_direct=yes
            # hardcode_minus_L: Not really in the search PATH,
            # but as the default location of the library.
            hardcode_minus_L=yes
            ;;
        esac
      fi
      ;;
    irix5* | irix6* | nonstopux*)
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    netbsd*)
      hardcode_libdir_flag_spec='-R$libdir'
      hardcode_direct=yes
      ;;
    newsos6)
      hardcode_direct=yes
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    *nto* | *qnx*)
      ;;
    openbsd*)
      if test -f /usr/libexec/ld.so; then
        hardcode_direct=yes
        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
        else
          case "$host_os" in
            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
              hardcode_libdir_flag_spec='-R$libdir'
              ;;
            *)
              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
              ;;
          esac
        fi
      else
        ld_shlibs=no
      fi
      ;;
    os2*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_minus_L=yes
      ;;
    osf3*)
      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      hardcode_libdir_separator=:
      ;;
    osf4* | osf5*)
      if test "$GCC" = yes; then
        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
      else
        # Both cc and cxx compiler support -rpath directly
        hardcode_libdir_flag_spec='-rpath $libdir'
      fi
      hardcode_libdir_separator=:
      ;;
    solaris*)
      hardcode_libdir_flag_spec='-R$libdir'
      ;;
    sunos4*)
      hardcode_libdir_flag_spec='-L$libdir'
      hardcode_direct=yes
      hardcode_minus_L=yes
      ;;
    sysv4)
      case $host_vendor in
        sni)
          hardcode_direct=yes # is this really true???
          ;;
        siemens)
          hardcode_direct=no
          ;;
        motorola)
          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
          ;;
      esac
      ;;
    sysv4.3*)
      ;;
    sysv4*MP*)
      if test -d /usr/nec; then
        ld_shlibs=yes
      fi
      ;;
    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
      ;;
    sysv5* | sco3.2v5* | sco5v6*)
      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
      hardcode_libdir_separator=':'
      ;;
    uts4*)
      hardcode_libdir_flag_spec='-L$libdir'
      ;;
    *)
      ld_shlibs=no
      ;;
  esac
fi

# Check dynamic linker characteristics
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec=      # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
  aix3*)
    library_names_spec='$libname.a'
    ;;
  aix[4-9]*)
    library_names_spec='$libname$shrext'
    ;;
  amigaos*)
    case "$host_cpu" in
      powerpc*)
        library_names_spec='$libname$shrext' ;;
      m68k)
        library_names_spec='$libname.a' ;;
    esac
    ;;
  beos*)
    library_names_spec='$libname$shrext'
    ;;
  bsdi[45]*)
    library_names_spec='$libname$shrext'
    ;;
  cygwin* | mingw* | pw32* | cegcc*)
    shrext=.dll
    library_names_spec='$libname.dll.a $libname.lib'
    ;;
  darwin* | rhapsody*)
    shrext=.dylib
    library_names_spec='$libname$shrext'
    ;;
  dgux*)
    library_names_spec='$libname$shrext'
    ;;
  freebsd* | dragonfly*)
    case "$host_os" in
      freebsd[123]*)
        library_names_spec='$libname$shrext$versuffix' ;;
      *)
        library_names_spec='$libname$shrext' ;;
    esac
    ;;
  gnu*)
    library_names_spec='$libname$shrext'
    ;;
  haiku*)
    library_names_spec='$libname$shrext'
    ;;
  hpux9* | hpux10* | hpux11*)
    case $host_cpu in
      ia64*)
        shrext=.so
        ;;
      hppa*64*)
        shrext=.sl
        ;;
      *)
        shrext=.sl
        ;;
    esac
    library_names_spec='$libname$shrext'
    ;;
  interix[3-9]*)
    library_names_spec='$libname$shrext'
    ;;
  irix5* | irix6* | nonstopux*)
    library_names_spec='$libname$shrext'
    case "$host_os" in
      irix5* | nonstopux*)
        libsuff= shlibsuff=
        ;;
      *)
        case $LD in
          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
          *) libsuff= shlibsuff= ;;
        esac
        ;;
    esac
    ;;
  linux*oldld* | linux*aout* | linux*coff*)
    ;;
  linux* | k*bsd*-gnu | kopensolaris*-gnu)
    library_names_spec='$libname$shrext'
    ;;
  knetbsd*-gnu)
    library_names_spec='$libname$shrext'
    ;;
  netbsd*)
    library_names_spec='$libname$shrext'
    ;;
  newsos6)
    library_names_spec='$libname$shrext'
    ;;
  *nto* | *qnx*)
    library_names_spec='$libname$shrext'
    ;;
  openbsd*)
    library_names_spec='$libname$shrext$versuffix'
    ;;
  os2*)
    libname_spec='$name'
    shrext=.dll
    library_names_spec='$libname.a'
    ;;
  osf3* | osf4* | osf5*)
    library_names_spec='$libname$shrext'
    ;;
  rdos*)
    ;;
  solaris*)
    library_names_spec='$libname$shrext'
    ;;
  sunos4*)
    library_names_spec='$libname$shrext$versuffix'
    ;;
  sysv4 | sysv4.3*)
    library_names_spec='$libname$shrext'
    ;;
  sysv4*MP*)
    library_names_spec='$libname$shrext'
    ;;
  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
    library_names_spec='$libname$shrext'
    ;;
  tpf*)
    library_names_spec='$libname$shrext'
    ;;
  uts4*)
    library_names_spec='$libname$shrext'
    ;;
esac

sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`

LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF

# How to pass a linker flag through the compiler.
wl="$escaped_wl"

# Static library suffix (normally "a").
libext="$libext"

# Shared library suffix (normally "so").
shlibext="$shlibext"

# Format of library name prefix.
libname_spec="$escaped_libname_spec"

# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"

# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"

# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"

# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"

# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"

EOF


code:
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT([texi2html], [5.0], [bug-texinfo@gnu.org])
dnl 1.9 because we need tar-ustar, and tar-ustar because we have long
dnl filenames for some test files
AM_INIT_AUTOMAKE([gnu 1.9 dist-bzip2 dist-zip tar-ustar])

dnl Disable Autoconf, Automake, and some other maintainer tools without the
dnl --enable-maintainer-mode argument.
AM_MAINTAINER_MODE

AM_CONDITIONAL([TEXI2HTML],[true])

AM_GNU_GETTEXT([external])
dnl it is not completly clear that we need that or not, since gettext is
dnl not fully used. Set to whatever gettextize inserts.
AM_GNU_GETTEXT_VERSION([0.18.3])

dnl Misc variable settings
dnl PACKAGE_DATE=`${SHELL} "$srcdir"/mdate-sh "$srcdir"/configure.ac`
dnl AC_SUBST([PACKAGE_DATE])

dnl Checks for programs.
AC_PROG_LN_S
AC_PROG_MKDIR_P

AC_ARG_VAR([PERL], [The path to the 'perl' executable.])
AC_PATH_PROG([PERL], [perl], [/usr/bin/env perl], [/opt/perl5/bin:"$PATH"])

USE_EXTERNAL_LIBINTL=no
AC_ARG_WITH([external-libintl-perl],
   AC_HELP_STRING([--with-external-libintl-perl],
      [use external libintl-perl if found (default: no)]),
   [if test $withval = 'yes'; then
      USE_EXTERNAL_LIBINTL=yes
   fi]
)
AC_SUBST([USE_EXTERNAL_LIBINTL])

USE_UNICODE=unknown
AC_ARG_WITH([encode],
    AC_HELP_STRING([--with-encode],
           [use encode (default: runtime detection)]),
    [if test $withval = 'no'; then
         USE_UNICODE=0
     else
         USE_UNICODE=1
     fi],
    [])

USE_EXTERNAL_EASTASIANWIDTH=no
AC_ARG_WITH([external-Unicode-EastAsianWidth],
   AC_HELP_STRING([--with-external-Unicode-EastAsianWidth],
      [use external Unicode-EastAsianWidth if found (default: no)]),
   [if test $withval = 'yes'; then
      USE_EXTERNAL_EASTASIANWIDTH=yes
   fi]
)
AC_SUBST([USE_EXTERNAL_EASTASIANWIDTH])

USE_EXTERNAL_UNIDECODE=no
AC_ARG_WITH([external-Text-Unidecode],
    AC_HELP_STRING([--with-external-Text-Unidecode],
           [use external Text::Unidecode if found (default: no)]),
   [if test $withval = 'yes'; then
      USE_EXTERNAL_UNIDECODE=yes
   fi]
)

AC_SUBST([USE_UNICODE])
AC_SUBST([USE_EXTERNAL_UNIDECODE])

t2h_try_translations=
AC_ARG_ENABLE([translations],
    AC_HELP_STRING([--enable-translations],
        [try to rebuild translation files (default: detected)]),
    [if test $enableval = 'no'; then
       t2h_try_translations='no'
     else
       t2h_try_translations='yes'
     fi],
    [ if $PERL -e "use 5.0; use Data::Dumper;" > /dev/null 2>&1;
     then
       t2h_try_translations='yes'
     else
       t2h_try_translations='no'
     fi
    ])

if test "z$t2h_try_translations" = 'zyes'; then
    USE_DATA_DUMPER=1
    REQUIRE_DATA_DUMPER="use Data::Dumper"
else
    USE_DATA_DUMPER=0
    REQUIRE_DATA_DUMPER=1
fi
AC_SUBST([USE_DATA_DUMPER])
AC_SUBST([REQUIRE_DATA_DUMPER])

# top_builddir and subdir differs between standalone texi2html and
# texi2html in texinfo
t2h_po_dir=
AC_SUBST([t2h_po_dir])
t2h_po_top_builddir='..'
AC_SUBST([t2h_po_top_builddir])

AC_PROG_INSTALL

dnl Checks for libraries.

dnl Checks for header files.

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.
# For teTeX and TeX Live.

AC_CANONICAL_HOST
AC_ARG_ENABLE(multiplatform,
  [  --enable-multiplatform  put executables in bin/PLATFORM])
test "x$enable_multiplatform" = xyes \
&& test "x$bindir" = 'x${exec_prefix}/bin' \
&& bindir="$bindir/$host"

dnl The bulk config files.
AC_CONFIG_FILES([ po_messages/Makefile.in po_document/Makefile.in \
                 po_messages/POTFILES.in \
                 po_document/POTFILES.in \
                 po_messages/Makevars \
                 po_document/Makevars \
                 Makefile \
                 test/Makefile \
                 test/contents/Makefile \
                 test/coverage/Makefile \
                 test/info_coverage/Makefile \
                 test/formatting/Makefile \
                 test/indices/Makefile \
                 test/invalid/Makefile \
                 test/misc/Makefile \
                 test/encodings/Makefile \
                 test/macros/Makefile \
                 test/manuals/Makefile \
                 test/nested_formats/Makefile \
                 test/sectioning/Makefile \
                 test/htmlxref/Makefile \
                 test/htmlxref-only_mono/Makefile \
                 test/htmlxref-only_split/Makefile \
                 test/xemacs_manual/Makefile \
                 test/texi2html_manual/Makefile \
                 test/tar_manual/Makefile \
                 test/singular_manual/Makefile \
                 test/layout/Makefile \
                 test/tex_html/Makefile \
                 test/tex_html_manuals/Makefile \
                 test/tex_html_singular/Makefile \
                 test/many_input_files/Makefile \
                 test/path_separator
                 ])

dnl scripts
AC_CONFIG_FILES([texi2html_configured.pl:texi2html.pl],
   [chmod +x texi2html_configured.pl])
AC_CONFIG_FILES([check_texinfo.pl], [chmod +x check_texinfo.pl])
AC_CONFIG_FILES([manage_i18n.pl], [chmod +x manage_i18n.pl])

AC_OUTPUT


code:
\input texinfo   @c -*-texinfo-*-
@c % Copyright (C) 2004  Aaron S. Hawley

@c % Author: Aaron S. Hawley <ashawley@gnu.uvm.edu>
@c % Keywords: docs, texinfo, extensions, bib

@c % This file is free software; you can redistribute it and/or modify
@c % it under the terms of the GNU General Public License as published by
@c % the Free Software Foundation; either version 2, or (at your option)
@c % any later version.

@c % This file is distributed in the hope that it will be useful,
@c % but WITHOUT ANY WARRANTY; without even the implied warranty of
@c % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@c % GNU General Public License for more details.

@c % You should have received a copy of the GNU General Public License
@c % along with texi2html; see the file COPYING.  If not, write to
@c % the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
@c % Boston, MA 02111-1307, USA.

@comment %**start of header
@setfilename my-file-with-bib.info
@settitle Texinfo with a Bibliography and References

@include my-bib-macros.texi
@mybibuselist{References}

@comment %**end of header

@node Top
@top Top

@menu
* Introduction::
* @mybibnode{}::

@end menu

@node Introduction
@chapter Introduction

The ability of a documentation format to make cross references to a
bibliography, a feature of LaTeX @mybibcite{LaTeX2e}, isn't
currently supported in Texinfo.

@node @mybibnode{}
@chapter References

@itemize @asis

@mybibitem{LaTeX2e} Leslie Lamport, LaTeX User's Guide and
Reference Manual, 2nd edition, Addison-Wesley, Reading,
Massachusetts, 1994.

@end itemize

@bye


code:
# -*-perl-*-
#+##############################################################################
#
# enable_encoding.pm: mimics --enable-encoding
# This is now directly handled in the main program. It is, however different
# from the main program implementation snce this init file is much more
# intrusive (for example it wouldn't work with info, but it would work
# better for a simple output format when entities are not used).
#
#    Copyright (C) 2008 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/>.
#
# Originally written by Patrice Dumas.
#
#-##############################################################################

use strict;

my $enable_encoding_default_init_out = $init_out;
$init_out = \&enable_encoding_init_out;

# badly interact with --enable-encoding support in info.pm
set_from_init_file('ENABLE_ENCODING', 0);

sub enable_encoding_init_out()
{
  &$enable_encoding_default_init_out();
  # like utf8.pm
  if (get_conf('ENCODING_NAME') eq 'utf-8')
  {
    $normal_text       = \&t2h_utf8_normal_text unless (get_conf('ENABLE_ENCODING_USE_ENTITY'));
    foreach my $key (keys(%unicode_accents), 'dotless')
    {
      $style_map{$key}->{'function'} = \&t2h_utf8_accent;
      $style_map_texi{$key}->{'function'} = \&t2h_utf8_accent;
      $style_map_pre{$key}->{'function'} = \&t2h_utf8_accent;
    }

    foreach my $key (%things_map)
    {
      if (exists($unicode_map{$key}) and ($unicode_map{$key} ne ''))
      {
        $things_map{$key} = chr(hex($unicode_map{$key})) unless (t2h_encoding_is_entity($things_map{$key}));
        $texi_map{$key} = chr(hex($unicode_map{$key})) unless (t2h_encoding_is_entity($texi_map{$key}));
        $sorting_things_map{$key} = chr(hex($unicode_map{$key})) unless (t2h_encoding_is_entity($sorting_things_map{$key}));
        $pre_map{$key} = chr(hex($unicode_map{$key})) unless (t2h_encoding_is_entity($pre_map{$key}));
      }
    }
  }
  elsif (exists($makeinfo_encoding_to_map{get_conf('ENCODING_NAME')}))
  {
    my $enc_map = $makeinfo_encoding_to_map{get_conf('ENCODING_NAME')};
    foreach my $key (keys(%unicode_accents), 'dotless')
    {
      $t2h_enable_encoding_default_accent{'normal'}->{$key} = $style_map{$key}->{'function'};
      $t2h_enable_encoding_default_accent{'texi'}->{$key} = $style_map_texi{$key}->{'function'};
      $t2h_enable_encoding_default_accent{'pre'}->{$key} = $style_map_pre{$key}->{'function'};
      $style_map{$key}->{'function'} = \&t2h_enable_encoding_normal_accent;
      $style_map_texi{$key}->{'function'} = \&t2h_enable_encoding_texi_accent;
      $style_map_pre{$key}->{'function'} = \&t2h_enable_encoding_pre_accent;
    }

    foreach my $key (%things_map)
    {
      if (exists($unicode_map{$key}) and ($unicode_map{$key} ne '') and
        exists($makeinfo_unicode_to_eight_bit{$enc_map}->{$unicode_map{$key}}))
      { # we let perl handle the conversion
        $things_map{$key} = chr(hex($unicode_map{$key})) unless (t2h_encoding_is_entity($things_map{$key}));
        $texi_map{$key} = chr(hex($unicode_map{$key})) unless (t2h_encoding_is_entity($texi_map{$key}));
        $sorting_things_map{$key} = chr(hex($unicode_map{$key})) unless (t2h_encoding_is_entity($sorting_things_map{$key}));
        $pre_map{$key} = chr(hex($unicode_map{$key})) unless (t2h_encoding_is_entity($pre_map{$key}));
      }
    }
  }
}

1;


code:
\input texinfo.tex

@setfilename glossary

@macro glossarytext
@table @asis
@end macro

@macro glossary
@glossarytext
@end table

@end macro

@macro gentry {id, name, text}
@ifhtml
@ref{\id\,\name\}
@end ifhtml
@ifnothtml
\name\ (@pxref{\id\})
@end ifnothtml
@unmacro expandglossary
@macro expandglossary{glossary}
@unmacro glossarytext
@macro glossarytext
\\glossary\\
@item \name\ @anchor{\id\}
\text\
@end macro
@end macro
@expandglossary {@glossarytext}
@end macro

@node Top
@top Top

@menu
* glossary::
@end menu

The @gentry{id1, name1, text1\, arg1 } is used in many cases while
@gentry{id2, name2, text2} is quite specific

@node glossary
@chapter glossary
@glossary


code:
######################################################################
# from here on, its l2h init stuff
#

## initialization for latex2html as for Singular manual generation
## obachman 3/99

#
# Options controlling Titles, File-Names, Tracing and Sectioning
#
$TITLE = '';

$SHORTEXTN = 0;

$LONG_TITLES = 0;

#$DESTDIR = '';

$NO_SUBDIR = 1;

#$PREFIX = '';

$AUTO_PREFIX = 0;

$AUTO_LINK = 0;

$SPLIT = 0;

$MAX_LINK_DEPTH = 0;

#$TMP = '';

$DEBUG = 0;

$VERBOSE = 1;

#
# Options controlling Extensions and Special Features
#
#$HTML_VERSION = "3.2";         # set by command line

$TEXDEFS = 1;                   # we absolutely need that

$EXTERNAL_FILE = '';

$SCALABLE_FONTS = 1;

$NO_SIMPLE_MATH = 1;

$LOCAL_ICONS = 1;

$SHORT_INDEX = 0;

$NO_FOOTNODE = 1;

$ADDRESS = '';

$INFO = '';

#
# Switches controlling Image Generation
#
$ASCII_MODE = 0;

$NOLATEX = 0;

$EXTERNAL_IMAGES = 0;

$PS_IMAGES = 0;

$NO_IMAGES = 0;

$IMAGES_ONLY = 0;

$REUSE = 2;

$ANTI_ALIAS = 1;

$ANTI_ALIAS_TEXT = 1;

#
#Switches controlling Navigation Panels
#
$NO_NAVIGATION = 1;
$ADDRESS = '';
$INFO = 0;                      # 0 = do not make a "About this document..." section

#
#Switches for Linking to other documents
#
# currently -- we don't care

$MAX_SPLIT_DEPTH = 0;           # Stop making separate files at this depth

$MAX_LINK_DEPTH = 0;            # Stop showing child nodes at this depth

$NOLATEX = 0;                   # 1 = do not pass unknown environments to Latex

$EXTERNAL_IMAGES = 0;           # 1 = leave the images outside the document

$ASCII_MODE = 0;                # 1 = do not use any icons or internal images

# 1 =  use links to external postscript images rather than inlined bitmap
# images.
$PS_IMAGES = 0;
$SHOW_SECTION_NUMBERS = 0;

### Other global variables ###############################################

# put dvips stderr on stdout since latex2html is alread very verbose
$DVIPS = "$DVIPS ".' 2>&1';

$CHILDLINE = "";

# This is the line width measured in pixels and it is used to right justify
# equations and equation arrays;
$LINE_WIDTH = 500;

# Used in conjunction with AUTO_NAVIGATION
$WORDS_IN_PAGE = 300;

# The value of this variable determines how many words to use in each
# title that is added to the navigation panel (see below)
#
$WORDS_IN_NAVIGATION_PANEL_TITLES = 0;

# This number will determine the size of the equations, special characters,
# and anything which will be converted into an inlined image
# *except* "image generating environments" such as "figure", "table"
# or "minipage".
# Effective values are those greater than 0.
# Sensible values are between 0.1 - 4.
$MATH_SCALE_FACTOR = 1.5;

# This number will determine the size of
# image generating environments such as "figure", "table" or "minipage".
# Effective values are those greater than 0.
# Sensible values are between 0.1 - 4.
$FIGURE_SCALE_FACTOR = 1.6;

#  If both of the following two variables are set then the "Up" button
#  of the navigation panel in the first node/page of a converted document
#  will point to $EXTERNAL_UP_LINK. $EXTERNAL_UP_TITLE should be set
#  to some text which describes this external link.
$EXTERNAL_UP_LINK = "";
$EXTERNAL_UP_TITLE = "";

# If this is set then the resulting HTML will look marginally better if viewed
# with Netscape.
$NETSCAPE_HTML = 1;

# Valid paper sizes are "letter", "legal", "a4","a3","a2" and "a0"
# Paper sizes has no effect other than in the time it takes to create inlined
# images and in whether large images can be created at all ie
#  - larger paper sizes *MAY* help with large image problems
#  - smaller paper sizes are quicker to handle
$PAPERSIZE = "a4";

# Replace "english" with another language in order to tell LaTeX2HTML that you
# want some generated section titles (eg "Table of Contents" or "References")
# to appear in a different language. Currently only "english" and "french"
# is supported but it is very easy to add your own. See the example in the
# file "latex2html.config"
$TITLES_LANGUAGE = "english";

1;                              # This must be the last non-comment line

# End File l2h.init
######################################################################


code:
# -*-perl-*-
#+##############################################################################
#
# makeinfo.pm: output html in the makeinfo style.
#
# This is obsoleted and irrelevant now, in 2010 (though still used in some
# tests) since a makeinfo-like default is used when called as makeinfo or
# texi2any.
#
#    Copyright (C) 2003, 2005, 2008 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/>.
#
# Originally written by Patrice Dumas.
#
#-##############################################################################

#html_default_load();
t2h_default_load_format('html');

set_default('TOP_FILE', 'index.html');

set_default('SHOW_MENU', 1);

set_default('USE_NODES', 1);

set_default('SPLIT', 'node');

set_default('NODE_FILES', 1);

set_default('USE_SETFILENAME', 1);

set_default('HEADERS', 1);

set_default('SHORT_REF', 1);

set_default('NODE_NAME_IN_MENU', 1);

set_default('NODE_NAME_IN_INDEX', 0);

set_default('AVOID_MENU_REDUNDANCY', 0);

set_default('SPLIT_INDEX', 0);

$MENU_SYMBOL = '*';

set_default('WORDS_IN_PAGE', 200);

set_default('footnotestyle', 'end');

set_default('USE_ACCESSKEY', 1);

set_default('USE_REL_REV', 1);

set_default('USE_LINKS', 1);

set_default('INLINE_CONTENTS', 1);

set_default('OVERVIEW_LINK_TO_TOC', 1);

if (get_conf('HEADER_IN_TABLE'))
{
    @SECTION_BUTTONS =
    (
     \"node: ", \$Texi2HTML::NODE{This}, [ 'NodeNext', \$Texi2HTML::NODE{NodeNext} ] , \",", [ 'NodePrev', \$Texi2HTML::NODE{NodePrev} ], \",", [ 'NodeUp', \$Texi2HTML::NODE{NodeUp} ], 'NodeForward'
    );

    @TOP_BUTTONS = @SECTION_BUTTONS;
    @MISC_BUTTONS = @SECTION_BUTTONS;
}

push @command_handler_process, \&makeinfo_like_initialize_variables;

my $makekinfo_like_footnote_absolute_number;
my %makekinfo_like_paragraph_in_footnote_nr;

sub makeinfo_like_initialize_variables()
{
   $makekinfo_like_footnote_absolute_number = 0;
   %makekinfo_like_paragraph_in_footnote_nr = ();
}

my $default_init_out = $init_out;
$init_out = \&makeinfo_like_init_out;

sub makeinfo_like_init_out()
{
   &$default_init_out();
   $NAVIGATION_TEXT{'NodeForward'} = ' > ';
}

# FIXME: images not in paragraphs are in

$foot_line_and_ref  = \&makeinfo_like_foot_line_and_ref;
$foot_section       = \&makeinfo_like_foot_lines;
$paragraph          = \&makeinfo_like_paragraph;
$index_summary      = \&makeinfo_like_index_summary;
$summary_letter     = \&makeinfo_like_summary_letter;
$index_entry        = \&makeinfo_like_index_entry;
$index_letter       = \&makeinfo_like_index_letter;
$print_index        = \&makeinfo_like_print_index;
$listoffloats       = \&makeinfo_like_listoffloats;
$listoffloats_entry = \&makeinfo_like_listoffloats_entry;
$menu_link          = \&makeinfo_like_menu_link;
$menu_description   = \&makeinfo_like_menu_description;
$menu_comment       = \&makeinfo_like_menu_comment;
$menu               = \&makeinfo_like_menu;

sub makeinfo_like_foot_line_and_ref($$$$$$$$)
{
    my $foot_num = shift;
    my $relative_num = shift;
    my $footid = shift;
    my $docid = shift;
    my $from_file = shift;
    my $footnote_file = shift;
    my $lines = shift;
    my $state = shift;

    $makekinfo_like_footnote_absolute_number++;

    # this is a bit obscure, this allows to add an anchor only if formatted
    # as part of the document.
    $docid = '' if ($state->{'outside_document'} or $state->{'multiple_pass'});

    if ($from_file eq $footnote_file)
    {
        $from_file = $footnote_file = '';
    }

    my $foot_anchor = "" . &$anchor($docid, "$footnote_file#$footid", $relative_num) . "";
    $foot_anchor = &$anchor($docid, "$footnote_file#$footid", "($relative_num)") if ($state->{'preformatted'});

    return ($lines, $foot_anchor);
}

sub makeinfo_like_foot_lines($)
{
    my $lines = shift;
    unshift @$lines, "
\n
\n
". gdt('Footnotes') ."
\n";
    push (@$lines, "
\n");
    return $lines;
}

sub makeinfo_like_paragraph ($$$$$$$$$$$$$)
{
    my $text = shift;
    my $align = shift;
    my $indent = shift;
    my $paragraph_command = shift;
    my $paragraph_command_formatted = shift;
    my $paragraph_number = shift;
    my $format = shift;
    my $item_nr = shift;
    my $enumerate_style = shift;
    my $number = shift;
    my $command_stack_at_end = shift;
    my $command_stack_at_begin = shift;
    my $state = shift;
#print STDERR "format: $format\n" if (defined($format));
#print STDERR "paragraph @$command_stack_at_end; @$command_stack_at_begin\n";
    #$paragraph_command_formatted = '' if (!defined($paragraph_command_formatted) or
    #      exists($special_list_commands{$format}->{$paragraph_command}));
    return '' if ($text =~ /^\s*$/);
    if (defined($paragraph_number) and defined($$paragraph_number))
    {
         $$paragraph_number++;
         return $text  if (($format eq 'itemize' or $format eq 'enumerate') and
            ($$paragraph_number == 1));
    }
    my $open = '
[0]) and $command_stack_at_begin->[0] eq 'footnote')
    {
        my $state = $Texi2HTML::THISDOC{'state'};
        $makekinfo_like_paragraph_in_footnote_nr{$makekinfo_like_footnote_absolute_number}++;
        if ($makekinfo_like_paragraph_in_footnote_nr{$makekinfo_like_footnote_absolute_number} <= 1)
        {
           $open.=' class="footnote"';
           my $document_file = $state->{'footnote_document_file'};
           if ($document_file eq $state->{'footnote_footnote_file'})
           {
               $document_file = '';
           }
           my $docid = $state->{'footnote_place_id'};
           my $doc_state = $state->{'footnote_document_state'};
           $docid = '' if ($doc_state->{'outside_document'} or $doc_state->{'multiple_pass'});
           my $foot_label = &$anchor($state->{'footnote_footnote_id'},
                 $document_file . "#$state->{'footnote_place_id'}",
                 "$state->{'footnote_number_in_page'}");
           $footnote_text = "[${foot_label}] ";
        }
    }

    $text = $footnote_text.$text;

    my $top_stack = '';
    $top_stack = $command_stack_at_begin->[-1] if (scalar (@$command_stack_at_begin));
    if ($top_stack eq 'multitable')
# FIXME
# paragraph_number is not by cell, so it is not possible to know if it
# is the first paragraph in cell. Also currently there is no hook for a
# cell beginning which means that it is not possible to reset the cell
# paragraph count at a cell beginning
# and (!defined($paragraph_number) or !defined($$paragraph_number) or $$paragraph_number == 1))
    {
       return $text;
    }

    return $open.'>'.$text.'
';
}

sub makeinfo_like_index_summary
{
    return '';
}

sub makeinfo_like_summary_letter
{
    return '';
}

sub makeinfo_like_index_entry($$$$$$$$$$)
{
    my $text_href = shift;
    my $entry = shift;
    my $element_href = shift;
    my $element_text = shift;
    my $entry_file = shift;
    my $current_element_file = shift;
    my $entry_target = shift;
    my $entry_element_target = shift;
    my $in_region_not_in_output = shift;
    my $index_entry_ref = shift;

    return '' if ($entry !~ /\S/);
    my $element = $index_entry_ref->{'real_element'};
    if (defined($element))
    {
       my $element_set = 0;
       if (get_conf('NODE_NAME_IN_INDEX'))
       {
           if ($element->{'node'})
           {
               $element_set = 1;
           }
           elsif ($element->{'with_node'})
           {
               $element = $element->{'with_node'};
               $element_set = 1;
           }
       }
       elsif (defined(get_conf('NODE_NAME_IN_INDEX')))
       {
           if (!$element->{'node'})
           {
               $element_set = 1;
           }
           elsif ($element->{'with_section'})
           {
               $element = $element->{'with_section'};
               $element_set = 1;
           }
       }
       if ($element_set)
       {
           $element_href = main::href($element, $Texi2HTML::THIS_ELEMENT->{'file'},
                 $Texi2HTML::THISDOC{'line_nr'});
           $element_text = $element->{'text'};
       }
    }

    return '
' . $entry . ': ' .  &$anchor('', $element_href, $element_text)
    . "
\n";
}

sub makeinfo_like_index_letter($$$)
{
     my $letter = shift;
     my $id = shift;
     my $text = shift;
     return $text;
}

sub makeinfo_like_print_index($$)
{
    my $text = shift;
    my $name = shift;
    return '' if (!defined($text));
    return "
\n" . $text . "
\n";
}

sub makeinfo_like_listoffloats_entry($$$$)
{
    my $style_texi = shift;
    my $float = shift;
    my $float_style = shift;
    my $caption = shift;
    my $href = shift;

    if ($caption ne '')
    {
        return '
' . gdt('{href}: {caption}', { 'href' => &$anchor('', $href, $float_style), 'caption' => $caption }) . "
\n";
    }
    else
    {
        return '
' . &$anchor('', $href, $float_style) . "
\n";
    }
}

sub makeinfo_like_listoffloats($$$)
{
    my $style_texi = shift;
    my $style = shift;
    my $float_entries = shift;

    my $result = "
\n" ;
    foreach my $float_entry (@$float_entries)
    {
         $result .= $float_entry;
    }
    return $result . "
\n";
}

# a whole menu
#
# argument:
# the whole menu text (entries and menu comments)
#
# argument:
# whole menu text.
sub makeinfo_like_menu($)
{
    my $text = shift;
    $menu_entry_index=0;
    if ($text =~ /\S/)
    {
        return "
\n"
        . $text . "
\n";
    }
}

# formats a menu entry link pointing to a node or section
#
# arguments:
# the entry text
# the state, a hash reference holding informations about the context, with a
#     usefull entry, 'preformatted', true if we are in a preformatted format
#     (a format keeping space between words). In that case a function
#     of the main program, main::do_preformatted($text, $state) might
#     be used to format the text with the current format style.
# href is optionnal. It is the reference to the section or the node anchor
#     which should be used to make the link (typically it is the argument
#     of a href= attribute in a  element).
sub makeinfo_like_menu_link($$$$$$$)
{
    my $entry = shift;
    my $state = shift;
    my $href = shift;
    my $node = shift;
    my $title = shift;
    my $ending = shift;
    my $has_title = shift;
    $title = '' unless ($has_title);
    if (($entry eq '') or get_conf('NODE_NAME_IN_MENU') or $state->{'preformatted'})
    {

        $title .= ':' if ($title ne '');
        $entry = "$title$node";
    }
    $menu_entry_index++;
    my $accesskey;
    $accesskey = "accesskey=\"$menu_entry_index\"" if (get_conf('USE_ACCESSKEY') and ($menu_entry_index < 10));
    $entry = &$anchor ('', $href, $entry, $accesskey) if (defined($href));
#    if ($state->{'preformatted'})
#    {
#        return '
' . main::do_preformatted($entry . $ending, $state);
#    }
    return "
 $entry";
}

# formats a menu entry description, ie the text appearing after the node
# specification in a menu entry an spanning until there is another
# menu entry, an empty line or some text at the very beginning of the line
# (we consider that text at the beginning of the line begins a menu comment)
#
# arguments:
# the description text
# the state. See menu_entry.
sub makeinfo_like_menu_description($$)
{
    my $text = shift;
    my $state = shift;
#    if ($state->{'preformatted'})
#    {
#        return main::do_preformatted($text, $state) . '
';
#    }
    return "$text
\n";
}

1;


code:
@c \input texinfo   @c -*-texinfo-*-
@c %% my-bib-macros.texi --- Texinfo macros providing a crude
@c %% bibliography and citation capability.

@c % Copyright (C) 2004  Aaron S. Hawley

@c % Author: Aaron S. Hawley <ashawley@gnu.uvm.edu>
@c % Keywords: docs, texinfo, extensions, bib

@c % This file is free software; you can redistribute it and/or modify
@c % it under the terms of the GNU General Public License as published by
@c % the Free Software Foundation; either version 2, or (at your option)
@c % any later version.

@c % This file is distributed in the hope that it will be useful,
@c % but WITHOUT ANY WARRANTY; without even the implied warranty of
@c % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@c % GNU General Public License for more details.

@c % You should have received a copy of the GNU General Public License
@c % along with texi2html; see the file COPYING.  If not, write to
@c % the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
@c % Boston, MA 02111-1307, USA.

@c %% Commentary:

@c %%% Introduction

@c %% Creates references to a ``Bibliography'' or ``References''
@c %% section of a Texinfo document, using Texinfo's
@c %% macro system.  Although not as terse a way to cite systems as is
@c %% found in document systems like TeX, the format is simpler and
@c %% the rendering  is easier for non-academic readers.

@c %

@c %%% Usage

@c %% References to cited works can be put in any section of a document.
@c %% The cited works must be put in either a Texinfo table (for
@c %% instance with ``@table @asis ... @end table'') or within a
@c %% Texinfo list (something like ``@enumerate ... @end enumerate''
@c %% or ``@itemize @bullet ... @end itemize'').  They are created
@c %% with the command ``@mybibitem{REF-NAME}''.  To cite a reference
@c %% with a @mybibitem use ``@mybibcite{REF-NAME}''.

@c %% The beginning of a document must include (using the @include
@c %% command) the file my-bib-macros.texi, which should be made
@c %% available in the current directory of the parent file.  A single
@c %% call should be made to choose to use a list or a table.  The
@c %% command to chose is called @mybibuselist{NODE}, where NODE is
@c %% the node containing the location where the references are listed.

@c %

@c %%% Example

@c %% \input texinfo   @c -*-texinfo-*-
@c %% @comment %**start of header
@c %% @setfilename my-file-with-bib.info
@c %% @settitle Texinfo with a Bibliography and References
@c %%
@c %% @include my-bib-macros.texi
@c %% @mybibuselist{References}
@c %%
@c %% @comment %**end of header
@c %%
@c %% @node Top
@c %% @top Top
@c %%
@c %% @menu
@c %% * Introduction::
@c %% * @mybibnode{}::
@c %%
@c %% @end menu
@c %%
@c %% @node Introduction
@c %% @chapter Introduction
@c %%
@c %% The ability of a documentation format to make cross references to a
@c %% bibliography, a feature of LaTeX @mybibcite{LaTeX2e}, isn't
@c %% currently supported in Texinfo.
@c %%
@c %% @node @mybibnode{}
@c %% @chapter References
@c %%
@c %% @itemize @asis
@c %%
@c %% @mybibitem{LaTeX2e} Leslie Lamport, LaTeX User's Guide and
@c %% Reference Manual, 2nd edition, Addison-Wesley, Reading,
@c %% Massachusetts, 1994.
@c %%
@c %% @end itemize
@c %%
@c %% @bye

@c %%

@c %% This example produces (in Info):

@c %%       1 Introduction
@c %%       **************
@c %%
@c %%       The ability of a documentation format to make cross
@c %%       references to a bibliography, a feature of LaTeX (See item
@c %%       [LaTeX2e] in *Note LaTeX2e: References.), is not currently
@c %%       supported in Texinfo.
@c %%
@c %%
@c %%       2 References
@c %%       ************
@c %%
@c %%       [LaTeX2e] Leslie Lamport, LaTeX User's Guide and Reference
@c %%       Manual, 2nd edition, Addison-Wesley, Reading,
@c %%       Massachusetts, 1994.

@c %% and (in printed output):

@c %%       1 Introduction
@c %%       **************
@c %%
@c %%       The ability of a documentation format to make cross
@c %%       references to a bibliography, a feature of LaTeX (See item
@c %%       [LaTeX2e] in Chapter 2 [References], page 3.), is not
@c %%       currently supported in Texinfo.
@c %%
@c %%
@c %%       2 References
@c %%       ************
@c %%
@c %%       [LaTeX2e] Leslie Lamport, LaTeX User's Guide and Reference
@c %%       Manual, 2nd edition, Addison-Wesley, Reading,
@c %%       Massachusetts, 1994.

@c %

@c %%% Notes

@c %% The pointers to references will be functional in hypertext
@c %% documentation (info, HTML, XML and others) and properly rendered
@c %% in print documents, because they are implemented with Texinfo's
@c %% cross referencing capabilities (using @anchor and @ref).  Failures
@c %% by an author to make proper references with ``my-bib-macros'' in
@c %% their document will give cross referencing errors by Texinfo
@c %% conversion tools.

@c %% Only one ``Reference'' section is allowed per document.

@c %% An improvement of this system would create cross references
@c %% (with @xref) at each cited work to all the originating cross
@c %% refererences.

@c %

@c %% Code:

@c % Configuration Options

@c %% @mybibsetrefnode : Defines the name of the node to contain
@c %% references.

@macro mybibsetrefnode{node}
@set mybibrefnode \node\
@end macro

@c %% @mybibnode{} : Macro to be placed at node containing references
@c %% and calls to @mybibcite{}

@macro mybibnode{}
@value{mybibrefnode}
@end macro

@c %% @mybibusetable : Whether each @mybibitem will be put in a
@c %% table.

@macro mybibusetable{node}
@set mybibtable true
@ifset mybiblist
@clear mybiblist
@end ifset
@mybibsetrefnode{\node\}
@end macro

@c %% @mybibuselist : Whether each @mybibitem will be put in a
@c %% list.

@macro mybibuselist{node}
@set mybiblist true
@ifset mybibtable
@clear mybibtable
@end ifset
@mybibsetrefnode{\node\}
@end macro

@c %% @mybibcite{REF} : Cites the cross reference REF.

@macro mybibcite{ref}
@ifclear mybibrefnode
@mybibmakeref{mybibsetrefnode was not used, \ref\}
@end ifclear
@c %**else if
@ifset mybibrefnode
@mybibmakeref{@mybibnode{}, \ref\}
@end ifset

@end macro

@macro mybibmakeref{node, ref}
(See item [\ref\] in @ref{\node\, \ref\}.)
@end macro

@c %% @mybibcite{REF} : Creates a cross referenced citation REF.

@macro mybibitem{ref}
@ifclear mybiblist
@ifclear mybibtable
@set mybiblist true
@end ifclear
@end ifclear
@ifset mybiblist
@item
@anchor{\ref\}[\ref\]
@end ifset
@c %**else if
@ifset mybibtable
@item @anchor{\ref\}[\ref\]
@end ifset

@end macro

@c %% my-bib-macros.texi ends here


code:
# -*-perl-*-
#+##############################################################################
#
# noheaders.pm: output html without headers. Obsoleted by --no-header
#
#    Copyright (C) 2004, 2007 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/>.
#
# Originally written by Patrice Dumas.
#
#-##############################################################################
#
# does nothing in case of info (at least in the test suite)

$print_section            = \&T2H_NOHEAD_print_section;
$end_section              = \&T2H_NOHEAD_end_section;
$one_section              = \&T2H_NOHEAD_one_section;
$print_Top_footer	      = \&T2H_NOHEAD_print_Top_footer;
$print_misc_footer	      = \&T2H_NOHEAD_print_misc_footer;
$print_head_navigation    = \&T2H_NOHEAD_noop;
$print_navigation            = \&T2H_NOHEAD_noop;
$about_body		      = \&T2H_NOHEAD_about_body;

sub T2H_NOHEAD_noop
{
  return '';
}

########################################################################
# Layout for html for every sections
#

sub T2H_NOHEAD_print_section
{
    my $fh = shift;
    my $first_in_page = shift;
    my $previous_is_top = shift;
    my $nw = main::print_lines($fh);
}

sub T2H_NOHEAD_one_section($$)
{
    my $fh = shift;
    my $element = shift;
    main::print_lines($fh);
    print $fh "$DEFAULT_RULE\n" if ($DEFAULT_RULE ne '');
    &$print_page_foot($fh);
}

###################################################################
# Layout of top-page I recommend that you use @ifnothtml, @ifhtml,
# @html within the Top texinfo node to specify content of top-level
# page.
#
# If you enclose everything in @ifnothtml, then title, subtitle,
# author and overview is printed
# Texi2HTML::HREF of Next, Prev, Up, Forward, Back are not defined
# if $T2H_SPLIT then Top page is in its own html file
sub T2H_NOHEAD_print_Top_footer($$)
{
    my $fh = shift;
    print $fh "$DEFAULT_RULE\n" if ($DEFAULT_RULE ne '');
}

###################################################################
# Layout of Toc, Overview, and Footnotes pages
# By default, we use "normal" layout
# Texi2HTML::HREF of Next, Prev, Up, Forward, Back, etc are not defined
# use: my $buttons = [...] to redefine navigation buttons
sub T2H_NOHEAD_print_misc_header
{
    my $fh = shift;
    &$print_page_head($fh) if (get_conf('SPLIT'));
}
sub T2H_NOHEAD_print_misc_footer
{
    my $fh = shift;
    print $fh "$DEFAULT_RULE\n" if ($DEFAULT_RULE ne '');
    if (get_conf('SPLIT'))
    {
        &$print_page_foot($fh);
    }

}

sub T2H_NOHEAD_end_section($)
{
    my $fh = shift;
    print $fh "$DEFAULT_RULE\n" if ($DEFAULT_RULE ne '');
}

###################################################################
# Layout of navigation panel

sub T2H_NOHEAD_about_body
{
}