code:
Date: Sun, 09 Jun 2002 00:40:14 -0400
From: Stephen Gildea
To: karl@freefriends.org (Karl Berry)
cc: jgay@gnu.org
Subject: Re: Texinfo fonts

I used to like to use Adobe Times, Helvetica, and Courier because a
major output format for us is PDF, and bitmapped fonts in a PDF file
look ugly with acroread.  I don't use this as much as I used to now that
I can get Type 1 CM fonts.

There are parts of this patch that look ugly, but it works for me.
It would be great to see something like this support in the Texinfo
distribution.

 < Stephen

*** texinfo.tex	Mon Apr 19 17:13:00 1999
--- ps_texinfo.tex	Mon Apr 19 17:17:50 1999
***************
*** 58,69 ****
  % It is possible to adapt texinfo.tex for other languages.  You can get
  % the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.

! \message{Loading texinfo [version \texinfoversion]:}

  % If in a .fmt file, print the version number
  % and turn on active characters that we couldn't do earlier because
  % they might have appeared in the input file name.
! \everyjob{\message{[Texinfo version \texinfoversion]}%
    \catcode`+=\active \catcode`\_=\active}

  % Save some parts of plain tex whose names we will redefine.
--- 58,69 ----
  % It is possible to adapt texinfo.tex for other languages.  You can get
  % the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.

! \message{Loading texinfo [version \texinfoversion ps]:}

  % If in a .fmt file, print the version number
  % and turn on active characters that we couldn't do earlier because
  % they might have appeared in the input file name.
! \everyjob{\message{[Texinfo version \texinfoversion ps]}%
    \catcode`+=\active \catcode`\_=\active}

  % Save some parts of plain tex whose names we will redefine.
***************
*** 858,890 ****
  \newcount\mainmagstep
  \mainmagstep=\magstephalf

  % Set the font macro #1 to the font named #2, adding on the
  % specified font prefix (normally `cm').
  % #3 is the font's design size, #4 is a scale factor
! \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}

  % Use cm as the default font prefix.
  % To specify the font prefix, you must define \fontprefix
  % before you read in texinfo.tex.
  \ifx\fontprefix\undefined
! \def\fontprefix{cm}
  \fi
  % Support font families that don't use the same naming scheme as CM.
! \def\rmshape{r}
! \def\rmbshape{bx}               %where the normal face is bold
! \def\bfshape{b}
! \def\bxshape{bx}
! \def\ttshape{tt}
! \def\ttbshape{tt}
! \def\ttslshape{sltt}
! \def\itshape{ti}
! \def\itbshape{bxti}
! \def\slshape{sl}
! \def\slbshape{bxsl}
! \def\sfshape{ss}
! \def\sfbshape{ss}
! \def\scshape{csc}
! \def\scbshape{csc}

  \ifx\bigger\relax
  \let\mainmagstep=\magstep1
--- 858,916 ----
  \newcount\mainmagstep
  \mainmagstep=\magstephalf

+ % expand #1, a control sequence, without the leading escape char
+ \def\csstringname#1{\expandafter\csstrcdr\string#1;}
+ \def\csstrcdr#1#2;{#2}
+
+
  % Set the font macro #1 to the font named #2, adding on the
  % specified font prefix (normally `cm').
  % #3 is the font's design size, #4 is a scale factor
! \def\setfont#1#2#3#4{\dimen255=#3pt\divide\dimen255by1000
!    \multiply\dimen255by#4%
!    \global\expandafter\font\csname f/\csstringname#1\endcsname=\fontprefix#2\fontencoding\space at\dimen255
!    \global\def#1{\csname f/\csstringname#1\endcsname
! 		\def\fcurshape{#2}%
! 		\def\fcursize{#3}%
! 		\def\fcurscale{#4}}}
!

  % Use cm as the default font prefix.
  % To specify the font prefix, you must define \fontprefix
  % before you read in texinfo.tex.
  \ifx\fontprefix\undefined
! \def\fontprefix{p}
  \fi
  % Support font families that don't use the same naming scheme as CM.
! \def\fontencoding{7t}
! \def\rmshape{tmr}
! \def\rmbshape{tmb}            %where the normal face is bold
! \def\bfshape{tmb}
! \def\bxshape{tmb}
! \def\ttshape{crr}
! \def\ttbshape{crb}
! \def\ttslshape{crro}
! \def\itshape{tmri}
! \def\itbshape{tmbi}
! \def\slshape{tmro}
! \def\slbshape{tmbo}
! \def\sfshape{hvr}
! \def\sfbshape{hvb}
! \def\scshape{tmrc}
! \def\scbshape{tmbc}
!
! % the reason we save all the \fcur* stuff in \setfont
! % is so we can do some nice symbols:
!
! \def\setcurtextsymbolfont{\def\fontencoding{8r}%
!        \expandafter\setfont
!           \csname\fontname\font/\fontencoding\endcsname
! 	  \fcurshape\fcursize\fcurscale
!        \csname\fontname\font/\fontencoding\endcsname}
!
! \def\copyright{{\setcurtextsymbolfont\char'251}}
! \def\bullet{{\setcurtextsymbolfont\char'225}}
!

  \ifx\bigger\relax
  \let\mainmagstep=\magstep1
***************
*** 1052,1059 ****
  \textfonts

  % Define these so they can be easily changed for other fonts.
! \def\angleleft{$\langle$}
! \def\angleright{$\rangle$}

  % Count depth in font-changes, for error checks
  \newcount\fontdepth \fontdepth=0
--- 1078,1092 ----
  \textfonts

  % Define these so they can be easily changed for other fonts.
!
! \def\setcursymbolfont{\def\fontencoding{}%
!        \expandafter\setfont
!           \csname\fontname\font/syr\endcsname
! 	  {syr}\fcursize\fcurscale
!        \csname\fontname\font/syr\endcsname}
!
! \def\angleleft{{\setcursymbolfont\char'341}}
! \def\angleright{{\setcursymbolfont\char'361}}

  % Count depth in font-changes, for error checks
  \newcount\fontdepth \fontdepth=0

repo_name: mthl/texinfo

license: mit


code:
Building and installing GNU Texinfo with DJGPP v2.x
===================================================

This directory holds files required for building Texinfo with DJGPP
tools for MS-DOS and MS-Windows.  If you got this file with a binary
distribution, look for the "Installation" section below.

1. Building Texinfo
   ----------------

   a. To compile Texinfo, you will need the following tools:

      - basic DJGPP development environment: GCC, Binutils and djdev;
      - a DJGPP port of GNU Make version 3.78 or later;
      - a DJGPP port of Bash 2.04 or later;
      - a port of GNU Sed 3.02 or later;
      - DJGPP ports of Fileutils, Textutils, Sh-utils, Diffutils,
        Gawk and Grep;
      - etags (from the Emacs distribution) and mkid (from ID-utils)
        if you need the TAGS and ID targets of the Makefile's.

      All of the above are available from the DJGPP ftp sites on
      SimTel.NET mirrors, in the v2gnu directory.

   b. From the root of your DJGPP installation, unzip the source package:

      - if you are unpacking the official GNU source distribution:

	 tar -xvzf texinfo-X.YZ.tar.gz

	 or

	 djtar -x texinfo-X.YZ.tar.gz

        where X.YZ is the version number.  (Users of MS-DOS and
        MS-Windows 3.X, which don't support long file names, will need
        to rename the archive to something like texi-XYZ.tgz.)

      - if you are unpacking a source distribution from a DJGPP ftp
        site:

         unzip txiXYZs

	 or

	 pkunzip -d txiXYZs

      If you build Texinfo on Windows 9X, Windows ME, Windows 2000 or
      Windows XP, you are advised to use a version of Unzip which
      supports long filenames, so that the original long filenames of
      the source files will be preserved.  Otherwise, the build
      procedure will most probably fail.

      Do NOT use an unzip program which supports long file names on
      Windows NT 4, as DJGPP doesn't support long names there.

      The program unzip32.exe, available from the SimTel.NET site,
      will deal correctly with long file names on any platform, so it
      is the recommended way of unzipping txiXYZs.zip archives.

   c. If the source distribution comes with a ready Makefile (this is
      usually the case with archives downloaded from the DJGPP sites),
      and all you need is to build Texinfo, you may skip the configure
      step below and go directly to step e.

   d. To build the official GNU distribution, or to configure Texinfo
      for any environment but stock DJGPP v2.x, run djgpp\config.bat
      first, like this:

	SRCDIR\djgpp\config SRCDIR

      Here SRCDIR is the directory where you unpacked the sources.  If
      you are configuring from the source directory itself, you may
      omit the argument to the config.bat file.  If you do supply the
      argument, you MUST use forward slashes in it, or else the batch
      file might fail.

      config.bat sets some environment variables, then invokes the
      configure script.  The script will run for a few minutes and
      create Makefile's in all the directories, and the config.h file.

   e. Run `Make'.  This builds the programs and the Info files.

2. Installation
   ------------

   a. If you are installing the binary distribution, then go to your
      main DJGPP directory and unzip the files.  For instance, if your
      DJGPP installation is rooted on C:\DJGPP, then type this (XYZ is
      the version number):

        cd c:\djgpp
        unzip txiXYZb

      or, if you prefer `pkunzip':

        pkunzip -d txiXYZb

   b. If you downloaded and built Texinfo from sources, install by
      invoking Make:

        make install

      This requires a port of Unix-like program `install.exe'.  It is
      available from the DJGPP port of GNU Fileutils on SimTel.NET.

   c. Info needs a file named DIR with the top-level menu of all the
      Info files installed on your system.  If you installed the DJGPP
      development environment (djdevNN.zip), then you already have
      this file in the info/ subdirectory of your DJGPP installation.
      Otherwise, you will need to create it.  A minimal DIR file is
      available in this distribution under the name `dir-example',
      which you can use as a starting point.  Copy it to the directory
      where you install the Info files from this distribution.

      Even if you already have a DIR file, you should review it to
      make sure it is consistent with the names of the Info file you
      are installing.  Here's how your Texinfo-related entries in DIR
      should look like:

      * Info: (info).
	      Documentation browsing system.  This topic teaches you about
	      how to use the online help information.

      * Info-Standalone: (info-stnd).
	      This topic helps you use the standalone Info-Program (info.exe)

      * infokey: (info-stnd)Invoking infokey.
	      Compile Info key customizations.

      * Makeinfo: (texinfo)Invoking makeinfo.
	      Convert a .texinfo file (.txi) to an info file suitable for the
	      info reader or Emacs, into plain ASCII, into HTML, into XML,
	      or into DocBook.

      * Texinfo: (texinfo).
	      With one source file, make either a printed manual (through TeX)
	      or an on-line manual (through makeinfo).  This topic includes
	      a full description of the Texinfo language and related
	      facilities, including Emacs commands to work with Texinfo files.

      * install-info: (texinfo)Invoking install-info.
	      How to update info/dir entries when installing GNU packages.

      * texi2dvi: (texinfo)Format with texi2dvi.
	      Printing Texinfo documentation with TeX.

      * texindex: (texinfo)Format with tex/texindex.
	      Sorting Texinfo index files automatically.

      Note that the asterisk `*' should be flushed all the way to the
      left, it is indented here just to make reading more convenient.

      If your DIR file entries differ from these, I suggest to edit them
      so they are as shown above.  Otherwise, Info might not be able to
      find some of the files.  You HAVE been warned!

   d. Optionally, set up environment variables for Info.  These are:

       * INFO_LINES   -- screen size for Info.
       * INFO_COLORS  -- screen colors for Info.

      (If you have DJGPP installed on your system, the file djgpp.env
      which comes with it already has entries for Info, see the [info]
      section there.)

      INFO_LINES can be one of 25 (the default), 28, 35, 40, 43, or 50
      (that's if you have a VGA; EGAs only support 25, 35 and 43 lines).
      I recommend 40 if your monitor is 17" or larger, and at least 28
      lines for smaller monitors (I work with 40 lines even on 14"
      monitors).

      INFO_COLORS should have the following syntax:

		set INFO_COLORS=XX.YY

      where XX is the text attribute for text displayed in the text
      windows and the echo area, and YY is the text attribute for the
      modeline (aka the status line).  Each attribute is a numeric
      value of a byte which describes the desired combination of
      foreground and background colors.  The individual bits in the
      attribute byte are defined as follows:

			bBBBFFFF

      where `b' is the blink bit, `BBB' are the 3 bits for background
      color and `FFFF' are the 4 bits for the foreground color.  This is
      the usual PC text attribute byte structure, and is further explained
      in any standard reference on text-mode programming for the PC.

      My favorite setting for INFO_COLORS is `0x1e.0x31'.  This makes
      Info use yellow foreground on blue background for the text and
      blue foreground on cyan background for the modelines.

      After you've played with these variables and have chosen the values
      you like, it's a good idea to put them on the DJGPP.ENV file, in the
      [info] section.

   e. Beginning with version 3.6, GNU Info can read Unix man pages.  If
      you have a `man' clone on your system and would like to be able to
      read man pages with Info, read the chapter ``Reading Man Pages''
      below.  One such clone is available as v2apps/manXYb.zip from
      the DJGPP sites (XY is the version number).

   f. This port supports compressed Info files, like what Info under Unix
      gives you.  For this to work, you will need to install a DOS port of
      GNU `Gzip' package and to observe certain rules of file naming, so
      that Info will find the compressed files working around the DOS 8.3
      filename restriction.  The chapter ``Compressed Info Files'' below
      explains the details of this.

   g. If you need to use the `print-node' command, read the chapter
      ``Printing Nodes'' below.

   h. That's it!  You are now ready to use Info, Makeinfo, and Texindex.
      To learn about them, type `Info' and press [Enter].  You will be
      presented with the top-level menu of GNU/DJGPP hypertext
      documentation.  If you are unfamiliar with Info, press `?' to see
      the available commands.  Pressing `h' will cause Info to take you on
      a guided tour through its features (recommended for first-time
      users).

   i. If you are used to Info ports of versions before 3.6, you should
      know that the command bindings to PC-specific keys has changed: the
      numeric keypad keys invoke the same commands as their extended
      namesakes.  That is, e.g., the key `PgUp' on the numeric keypad
      invokes the same command as the grey `PgUp' key on the extended
      keypad.  This was done at DJ's request, because laptop machines
      don't have extended keys.  Commands to move between nodes
      (previously bound to numeric keypad) are now bound to Ctrl-
      varieties of numeric keypad keys (e.g., `next-node' is on
      `Ctrl-PgDn', `prev-node' is on `Ctrl-PgUp', etc.).  You can use
      the `Alt-x describe-key' command to see which command is invoked
      by a particular key.

   j. There are several MSDOS-specific changes in Texinfo, relative to
      previous Texinfo ports (for other changes, see the file NEWS):

        * Full support for both forward and backslashes in all file
          names.  Previously, Info was sensitive to the style of
          slashes in directories mentioned in the INFOPATH environment
          variable.

        * The default operation of the `print-node' command has been
          changed so that it automatically prints to the local printer
          device connected to the PRN port.  (If your printer is
          connected to another port, set the INFO_PRINT_COMMAND
          environment variable like this:

		set INFO_PRINT_COMMAND=>LPT2

          In other words, if the value of INFO_PRINT_COMMAND begins
          wih a `>' character, Info will write to the file or device
          whose name follows the `>' character.  (Don't leave any
          blanks between `>' and the device name!).

	  Note that some old versions of stock DOS shell won't let you
	  use the `>' character in environment variables set from the
	  DOS prompt or batch files, but you can set it in the [info]
	  section of your DJGPP.ENV file.

        * The `set-screen-height' command now actually changes the
          screen dimensions from within Info if you specify one of the
          sizes supported by your video hardware.

        * If you don't have a `man' clone installed, and you invoke
          Info with a name of a document which Info cannot find, it
          will no longer wait for 15 seconds.

        * Several bugs in handling of man pages were corrected.

        * Info opens the dribble and input files in BINARY mode.  This
	  allows to record keystrokes and restore them in another Info
	  session, thus using dribble files as a startup or init file
	  which changes default behavior, binds keys, etc.

	* Info recognizes a new DOS-specific command-line option `-b'
	  or `--speech-friendly'.  This option causes Info to use DOS
	  I/O functions (`printf', `puts', etc.) instead of direct
	  screen writes, which is required to enable speech
	  synthesizer software (used by visually-impaired people) to
	  grab the output.  When this option is given, the screen
	  colors defined by the `INFO_COLORS' environment variable and
	  the visible-bell feature will be disabled, because stdio
	  functions don't support neither color text nor inverting
	  screen colors.  This improvement was suggested and
	  originally implemented by Hans-Bernhard Broeker
	  <Broeker@physik.rwth-aachen.de>.

        * Makeinfo now generates full .info-NN filenames when long
	  filenames are supported (e.g. on Win9x) and short .iNN
	  filenames otherwise.  When the Texinfo source or the
	  command-line parameter -o specify an output file with no
	  extension (like `texinfo'), and long filenames aren't
	  supported, Makeinfo will make sure the generated names will
	  be unique (it will create e.g. `texinf-1', `texin-10' etc.).

        * The texi2dvi script is now fully compatible with
          MS-DOS/MS-Windows and with the DJGPP port of TeX.

3. Reading Man Pages
   -----------------

   Yes, Info can now read man pages!  This port supports that feature,
   but for it to work, you will have to make sure your `man' clone is
   set up correctly:

   a. You should have an executable file named `man.exe', `man.com'
      etc. somewhere on your PATH.

   b. When invoked with redirected stdout, that executable should
      print the contents of the file it gets as its argument to stdout
      and exit.  If your man command calls some pager, that pager
      should have this behavior (various ports of Unix command `more'
      and the DJGPP port of GNU Less behave that way).

   One `man' clone is available as v2apps/manNNb.zip from the DJGPP
   sites on SimTel.NET.

4. Compressed Info Files
   ---------------------

   Info allows you to hold your Info files in compressed form, to save
   disk space.  When a file Info wants cannot be found, it will
   automatically try to find that file in compressed form.  Info does
   this by trying to find the original file with specific extensions.
   Each extension tells Info which program should be called to
   decompress the file.

   This port supports compression by the GNU Gzip program.  When Info
   cannot find a file `foo', it will first try to find `foo.z' or
   `foo.gz'.  If this fails, and the file has an extension, the last
   one or two characters of the extension are replaced by `z' and `gz'
   respectively, and Info tries again.  If it finds any of these, it
   will call the `GUnzip' program to decompress the file, catch its
   output and display it.  (The original compressed file stays
   intact.)

   So, to use this feature, compress your files with Gzip and call the
   compressed files using the following as guidelines:

		foo       -->    foo.gz
		foo.inf	  -->	 foo.igz
		foo.i5	  -->	 foo.i5z
		foo.25	  -->	 foo.25z

   If you have a package whose Info docs are split into more than 9
   sub-files and you need to compress those files, you will have to
   rename the sub-files from `foo.iNN' to `foo.NN' so that there will
   be place for the trailing `z' in the compressed names.  Don't
   forget to edit the indirect file table in the main Info file and
   change the sub-file filenames there too!

   An alternative for those packages which have more than 99 Info
   sub-files is to generate them from the Texinfo sources and force
   Makeinfo to produce files without the .iNN extensions, like this:

	        makeinfo -o foo foo.txi

   This causes Makeinfo to generate file names like foo-1, foo-2,
   etc., which leave more place for the numeric index.  If necessary,
   Makeinfo will automatically remove characters from the end of the
   argument to `-o'.  For example, "-o texinfo" produces files
   texinf-1, ..., texin-10, ..., texi-100, etc. on platforms which
   only support 8+3 file names.

   Saying "@setfilename foo" near the beginning of the Texinfo source
   file is another way of forcing Makeinfo to produce files without
   the .iNN extensions.

   Using Makeinfo to produce files whose names are "compression-ready"
   is more convenient, since you don't need to edit the the indirect
   file table to reflect the changes in file names.

   On platforms which support long filenames, the usual Info behavior
   of appending `.gz' or `.Z' to the original filename also works;
   this is done *before* Info checks the above butchered names.

   Special considerations apply if you are installing Info on dual
   DOS/Windows 9X/ME/2K/XP system, where you'd like Info to work with
   the same files both in plain DOS and from the Windows DOS box.  In
   this case, you should make sure your compressed Info files follow
   the 8+3 DOS naming conventions outlined above, even though Info
   supports long file names on Windows 9X.  Also, you need to turn off
   the generation of numeric tails in short 8+3 aliases Windows
   creates for long names (if you don't know how, the DJGPP FAQ list
   explains it).

   Please note: for the automatic decompression to work, Info must be
   able to find the file it looks for with an extension which
   indicates that the file is compressed.  Do NOT call the compressed
   files as the original uncompressed files were called, or Info
   won't be able to find them!  File names like bison-1, gcc.i10 or
   make.info-3 have nothing in them to suggest that they are
   compressed, so don't expect Info to uncompress them.

5. Printing Nodes
   --------------

   Info has a `print-node' command.  It works by piping the contents of
   the current node through a program which is named by the environment
   variable INFO_PRINT_COMMAND.  That command should read its standard
   input and write it to your printer.  Find any such program, put its
   name into the above environment variable, and you can print nodes from
   within Info.

   If the value of INFO_PRINT_COMMAND begins with a redirection
   character `>', Info will write the contents of the node to the file
   whose name follows the `>' character.

   If INFO_PRINT_COMMAND is not defined, the DJGPP port will use
   ">PRN" as the default, which causes it to print to the local printer
   device, PRN.

6. Bug Reports
   -----------

   If you see any bugs which seem specific to this DOS port, please tell
   me about them.

   Enjoy,

				Eli Zaretskii <eliz@is.elta.co.il>

path: djgpp/README


code:
@echo off

echo Configuring GNU Texinfo for DJGPP v2.x...

Rem The small_env tests protect against fixed and too small size
Rem of the environment in stock DOS shell.

Rem Find out if NLS is wanted or not, if dependency-tracking is
Rem wanted or not, if cache is wanted or not, and where the sources are.
set ARGS=
set NLS=disabled
if not "%NLS%" == "disabled" goto small_env
set CACHE=enabled
if not "%CACHE%" == "enabled" goto small_env
set DEPTRAK=disabled
if not "%DEPTRAK%" == "disabled" goto small_env
set XSRC=.
if not "%XSRC%" == "." goto small_env

Rem Loop over all arguments.
Rem Special arguments are: NLS, XSRC CACHE and DEPS.
Rem All other arguments are stored into ARGS.
:arg_loop
set SPECARG=0
if not "%SPECARG%" == "0" goto small_env
if not "%1" == "NLS" if not "%1" == "nls" goto cache_opt
if "%1" == "nls" set NLS=enabled
if "%1" == "NLS" set NLS=enabled
if not "%NLS%" == "enabled" goto small_env
set SPECARG=1
if not "%SPECARG%" == "1" goto small_env
shift
:cache_opt
set SPECARG=0
if not "%SPECARG%" == "0" goto small_env
if "%1" == "no-cache" goto cache_off
if "%1" == "no-CACHE" goto cache_off
if not "%1" == "NO-CACHE" goto dependency_opt
:cache_off
if "%1" == "no-cache" set CACHE=disabled
if "%1" == "no-CACHE" set CACHE=disabled
if "%1" == "NO-CACHE" set CACHE=disabled
if not "%CACHE%" == "disabled" goto small_env
set SPECARG=1
if not "%SPECARG%" == "1" goto small_env
shift
:dependency_opt
set SPECARG=0
if not "%SPECARG%" == "0" goto small_env
if "%1" == "dep" goto dep_off
if not "%1" == "DEP" goto src_dir_opt
:dep_off
if "%1" == "dep" set DEPTRAK=enabled
if "%1" == "DEP" set DEPTRAK=enabled
if not "%DEPTRAK%" == "enabled" goto small_env
set SPECARG=1
if not "%SPECARG%" == "1" goto small_env
shift
:src_dir_opt
set SPECARG=0
if not "%SPECARG%" == "0" goto small_env
echo %1 | grep -q "/"
if errorlevel 1 goto collect_arg
set XSRC=%1
if not "%XSRC%" == "%1" goto small_env
set SPECARG=1
if not "%SPECARG%" == "1" goto small_env
:collect_arg
if "%SPECARG%" == "0" set _ARGS=%ARGS% %1
if "%SPECARG%" == "0" if not "%_ARGS%" == "%ARGS% %1" goto small_env
echo %_ARGS% | grep -q "[^ ]"
if not errorlevel 0 set ARGS=%_ARGS%
set _ARGS=
shift
if not "%1" == "" goto arg_loop
set SPECARG=

Rem Create a response file for the configure script.
echo --srcdir=%XSRC% > args
if "%CACHE%" == "enabled"    echo --config-cache >> args
if "%DEPTRAK%" == "enabled"  echo --enable-dependency-tracking >> args
if "%DEPTRAK%" == "disabled" echo --disable-dependency-tracking >> args
if not "%ARGS%" == ""        echo %ARGS% >> args
set ARGS=
set CACHE=
set DEPTRAK=

if "%XSRC%" == "." goto in_place

:not_in_place
redir -e /dev/null update %XSRC%/configure.org ./configure
test -f ./configure
if errorlevel 1 update %XSRC%/configure ./configure

:in_place
Rem Update configuration files
echo Updating configuration scripts...
test -f ./configure.org
if errorlevel 1 update configure configure.org
sed -f %XSRC%/djgpp/config.sed configure.org > configure
if errorlevel 1 goto sed_error

Rem Make sure they have a config.site file
set CONFIG_SITE=%XSRC%/djgpp/config.site
if not "%CONFIG_SITE%" == "%XSRC%/djgpp/config.site" goto small_env

Rem Make sure crucial file names are not munged by unpacking
test -f %XSRC%/po/Makefile.in.in
if not errorlevel 1 mv -f %XSRC%/po/Makefile.in.in %XSRC%/po/Makefile.in-in
test -f %XSRC%/po/Makefile.am.in
if not errorlevel 1 mv -f %XSRC%/po/Makefile.am.in %XSRC%/po/Makefile.am-in

Rem This is required because DOS/Windows are case-insensitive
Rem to file names, and "make install" will do nothing if Make
Rem finds a file called `install'.
if exist INSTALL ren INSTALL INSTALL.txt

Rem Set HOME to a sane default so configure stops complaining.
if not "%HOME%" == "" goto host_name
set HOME=%XSRC%/djgpp
if not "%HOME%" == "%XSRC%/djgpp" goto small_env
echo No HOME found in the environment, using default value

:host_name
Rem Set HOSTNAME so it shows in config.status
if not "%HOSTNAME%" == "" goto hostdone
if "%windir%" == "" goto msdos
set OS=MS-Windows
if not "%OS%" == "MS-Windows" goto small_env
goto haveos
:msdos
set OS=MS-DOS
if not "%OS%" == "MS-DOS" goto small_env
:haveos
if not "%USERNAME%" == "" goto haveuname
if not "%USER%" == "" goto haveuser
echo No USERNAME and no USER found in the environment, using default values
set HOSTNAME=Unknown PC
if not "%HOSTNAME%" == "Unknown PC" goto small_env
goto userdone
:haveuser
set HOSTNAME=%USER%'s PC
if not "%HOSTNAME%" == "%USER%'s PC" goto small_env
goto userdone
:haveuname
set HOSTNAME=%USERNAME%'s PC
if not "%HOSTNAME%" == "%USERNAME%'s PC" goto small_env
:userdone
set _HOSTNAME=%HOSTNAME%, %OS%
if not "%_HOSTNAME%" == "%HOSTNAME%, %OS%" goto small_env
set HOSTNAME=%_HOSTNAME%
:hostdone
set _HOSTNAME=
set OS=

Rem install-sh is required by the configure script but clashes with the
Rem various Makefile install-foo targets, so we MUST have it before the
Rem script runs and rename it afterwards
test -f %XSRC%/install-sh
if not errorlevel 1 goto no_ren0
test -f %XSRC%/install-sh.sh
if not errorlevel 1 mv -f %XSRC%/install-sh.sh %XSRC%/install-sh
:no_ren0

if "%NLS%" == "disabled" goto without_NLS

:with_NLS
Rem Check for the needed libraries and binaries.
test -x /dev/env/DJDIR/bin/msgfmt.exe
if not errorlevel 0 goto missing_NLS_tools
test -x /dev/env/DJDIR/bin/xgettext.exe
if not errorlevel 0 goto missing_NLS_tools
test -f /dev/env/DJDIR/include/libcharset.h
if not errorlevel 0 goto missing_NLS_tools
test -f /dev/env/DJDIR/lib/libcharset.a
if not errorlevel 0 goto missing_NLS_tools
test -f /dev/env/DJDIR/include/iconv.h
if not errorlevel 0 goto missing_NLS_tools
test -f /dev/env/DJDIR/lib/libiconv.a
if not errorlevel 0 goto missing_NLS_tools
test -f /dev/env/DJDIR/include/libintl.h
if not errorlevel 0 goto missing_NLS_tools
test -f /dev/env/DJDIR/lib/libintl.a
if not errorlevel 0 goto missing_NLS_tools

Rem Recreate the files in the %XSRC%/po subdir with our ported tools.
redir -e /dev/null rm %XSRC%/po/*.gmo
redir -e /dev/null rm %XSRC%/po/texinfo*.pot
redir -e /dev/null rm %XSRC%/po/cat-id-tbl.c
redir -e /dev/null rm %XSRC%/po/stamp-cat-id

Rem Update the arguments file for the configure script.
Rem We prefer without-included-gettext because libintl.a from gettext package
Rem is the only one that is guaranteed to have been ported to DJGPP.
echo --enable-nls --without-included-gettext >> args
goto configure_package

:missing_NLS_tools
echo Needed libs/tools for NLS not found.  Configuring without NLS.
:without_NLS
Rem Update the arguments file for the configure script.
echo --disable-nls >> args

:configure_package
echo Running the ./configure script...
sh ./configure @args
if errorlevel 1 goto cfg_error
rm args
echo Done.
goto End

:sed_error
echo ./configure script editing failed!
goto End

:cfg_error
echo ./configure script exited abnormally!
goto End

:small_env
echo Your environment size is too small.  Enlarge it and run me again.
echo Configuration NOT done!

:End
test -f %XSRC%/install-sh.sh
if not errorlevel 1 goto no_ren1
test -f %XSRC%/install-sh
if not errorlevel 1 mv -f %XSRC%/install-sh %XSRC%/install-sh.sh
:no_ren1
if "%HOME%" == "%XSRC%/djgpp" set HOME=
set ARGS=
set CONFIG_SITE=
set HOSTNAME=
set NLS=
set CACHE=
set DEPTRAK=
set XSRC=


code:
# DJGPP specific configuration file.
# Sed script for additional DJGPP specific editing
# of the configure script generated by autoconf 2.62.

# Additional editing of Makefiles
/^eval sed.*ac_file_inputs.*tmp\/out \\$/ {
:loop
n
/^$/!b loop
a\
cat > "$tmp/subs-djgpp.sed" << eof_djgpp\
# DJGPP specific Makefile changes.\
s,\\.deps,_deps,g\
s,\\.libs,_libs,g\
s,\\.new\\.,_new.,g\
s,\\.old\\.,_old.,g\
s,\\.tab\\.,_tab.,g\
s,Makefile\\.am\\.in,Makefile.am-in,g\
s,Makefile\\.in\\.in,Makefile.in-in,g\
/^install-info-am:/,/^$/ {\
  /@list=.\\\$(INFO_DEPS)\[^ \]/s,DEPS),& texinf- texin- info-stn.i info.inf,\
  s,\\(\\\$\\\$d/\\\$\\\$file-\\[0-9\\]\\[0-9\\]\\)\\(\[^ \]\\),\\1 \\$\\$d/\\$\\$file[0-9] \\$\\$d/\\$\\$file[0-9][0-9]\\2,\
  s,\\( \\\$\\\$file-\\[0-9\\]\\[0-9\\]\\)\\(\[^ \]\\),\\1 \\$\\$file[0-9] \\$\\$file[0-9][0-9]\\2,\
}\
/^uninstall-info-am:/,/^$/ {\
  /@list=.\\\$(INFO_DEPS)\[^ \]/s,DEPS),& texinf- texin- info-stn.i info.inf,\
  s,\\(file-\\[0-9\\]\\[0-9\\]\\)\\(\[^ \]\\),\\1 \\$\\$file[0-9] \\$\\$file[0-9][0-9]\\2,\
}\
eof_djgpp\
sed -f "\$tmp/subs-djgpp.sed" \$tmp/out > \$tmp/out.djgpp\
mv -f \$tmp/out.djgpp \$tmp/out
}

# Makefile.in.in is renamed to Makefile.in-in.
/ac_config_files=/,/_ACEOF/ {
  s|po/Makefile\.in|&:po/Makefile.in-in|
}
/CONFIG_FILES=/ s|po/Makefile\.in|&:po/Makefile.in-in|2

# We always use _deps and _libs instead of .deps and .libs, because
# the latter is an invalid name on 8+3 MS-DOS file system.  This makes
# the generated Makefiles good for every DJGPP installation, not only
# the one where the package was configured (which could happen to be
# a Windows box, where leading dots in file names are allowed).
/^rmdir[	 ]*\.tst/ i\
am__leading_dot=_

# The following two items are changes needed for configuring
# and compiling across partitions.
# The given srcdir value is always translated from the
# "x:" syntax into "/dev/x" syntax while we run configure.
/^[	 ]*-srcdir=\*.*$/ a\
    ac_optarg=`echo "$ac_optarg" | sed "s,^\\([A-Za-z]\\):,/dev/\\1,"`
/set X `ls -Lt \$srcdir/ i\
   if `echo $srcdir | grep "^/dev/" - > /dev/null`; then\
     srcdir=`echo "$srcdir" | sed -e "s%^/dev/%%" -e "s%/%:/%"`\
   fi

# Autoconf 2.52e generated configure scripts
# write absolute paths into Makefiles making
# them useless for DJGPP installations for which
# the package has not been configured for.
/MISSING=/,/^$/ {
  /^fi$/ a\
am_missing_run=`echo "$am_missing_run" | sed 's%/dev.*/texinfo-\\{0,1\\}4\\.[0-9][0-9]\\{0,1\\}\\.\\{0,1\\}[0-9]\\{0,2\\}[a-z]\\{0,1\\}%${top_srcdir}%;s%.:.*/texinfo-\\{0,1\\}4\\.[0-9][0-9]\\{0,1\\}\\.\\{0,1\\}[0-9]\\{0,2\\}[a-z]\\{0,1\\}%${top_srcdir}%'`
}
/^install_sh=/a\
install_sh=`echo "$install_sh" | sed 's%/dev.*/texinfo-\\{0,1\\}4\\.[0-9][0-9]\\{0,1\\}\\.\\{0,1\\}[0-9]\\{0,2\\}[a-z]\\{0,1\\}%${top_srcdir}%;s%.:.*/texinfo-\\{0,1\\}4\\.[0-9][0-9]\\{0,1\\}\\.\\{0,1\\}[0-9]\\{0,2\\}[a-z]\\{0,1\\}%${top_srcdir}%'`

# On DOS/WIN systems every partition has its own root directory,
# so do not make any assumptions about absolute paths or the
# configure script and the generated Makefiles will only be
# good for the system where the package has been configured for.
/^ac_abs_srcdir=/ i\
ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%/dev/.*/texinfo[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%;s%.:.*/texinfo[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%"`\
ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%/dev/.*/texinfo[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%;s%.:.*/texinfo[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%"`\
ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev/.*/texinfo[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%;s%.:.*/texinfo[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../..%"`
#ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%/dev/.*/texinfo[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%;s%.:.*/texinfo[-_0-9]\\{1,1\\}[-.0-9A-Za-z+]*%../../.%"`
/^ac_abs_srcdir=/ a\
for dj_dir in $ac_abs_builddir $ac_abs_top_builddir $ac_abs_top_srcdir $ac_abs_srcdir\
do\
  ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%//%/%g"`\
  ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%//%/%g"`\
  ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%//%/%g"`\
  ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%//%/%g"`\
done

# The following makes sure we are not going to remove a directory
# which is the cwd on its drive (DOS doesn't allow to remove such
# a directory).  The trick is to chdir to the root directory on
# temp directory's drive before removing $tmp.
/^ *trap 'exit_status=\$\?; rm -rf/s%rm -rf%cd $tmp; cd /; &%

# AC_CONFIG_LINKS fails if the source and destination are on
# different file systems and symlinks don't work.
/^    ln \$srcdir/s%||%|| cp -pf $srcdir/$ac_source $ac_dest ||%

# The CR test for awk does not work for DJGPP.
/^ac_cs_awk_cr=/,/^$/ {
  /^fi$/ a\
ac_cs_awk_cr=$ac_cr
}


code:
#! /bin/sh
# Site defaults for the DJGPP configuration

# These two variables are required, otherwise looking for
# programs along the PATH will not work.
PATH_SEPARATOR=:
PATH_EXPAND=y

# This is required in for "test -f foo" to find foo.exe.
export TEST_FINDS_EXE=y

# The root of the DJGPP tree serves as the default prefix
# for all paths that are hardcoded in the binaries.
# When installing the installation prefix must be supplied.
test "x$prefix" = xNONE && prefix='/dev/env/DJDIR'

# This is required for config.status script to be run, since
# ./configure runs it by invoking ${CONFIG_SHELL-/bin/sh}
# CONFIG_SHELL=${CONFIG_SHELL='sh'}

# These are set here so the generated Makefile's will be good
# for every DJGPP installation, not only the one where the
# package was configured.
# $INSTALL must be an absolute path name, otherwise config.status
# will try to prepend ./ and ../ to it when it goes into subdirs.
INSTALL=${INSTALL='/dev/env/DJDIR/bin/ginstall -c'}
RANLIB=${RANLIB='ranlib'}
GMSGFMT=${GMSGFMT='/dev/env/DJDIR/bin/msgfmt'}
MSGFMT=${MSGFMT='/dev/env/DJDIR/bin/msgfmt'}
XGETTEXT=${XGETTEXT='/dev/env/DJDIR/bin/xgettext'}

# Sane defaults for standard programs used by the build process.
# We force the values of these variables so that the resultant
# Makefile's will work on any DJGPP platform, not only on the
# machine where the package was configured.
ac_cv_prog_AWK=${AWK='gawk'}
ac_cv_prog_INTLBISON=${INTLBISON='bison'}
ac_cv_prog_CC=${CC='gcc'}

# These are set here so the generated libtool/Makefile's will
# be good for every DJGPP installation, not only the one where
# the package was configured.
NM=${NM='nm'}
LD=${LD='ld'}
MAKEINFO=${MAKEINFO='makeinfo'}

# A sane default for mkdir.
ac_cv_path_mkdir=${MKDIR_P='/dev/env/DJDIR/bin/mkdir -p'}

# A sane default for grep.
ac_cv_path_GREP=${GREP='/dev/env/DJDIR/bin/grep'}

# A sane default for egrep.
ac_cv_path_EGREP=${EGREP='/dev/env/DJDIR/bin/egrep'}

# Force the test for 'ln -s' to report 'cp -pf'.
ac_cv_prog_LN_S='cp -pf'

# We have `fork', but it always fails.  Don't trust Autoconf to be
# smart enough to detect that...
ac_cv_func_fork=no
ac_cv_func_vfork=no


code:
# $Id$
# Makefile.am for texinfo/doc.
#
# Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
# 2013, 2014, 2015, 2016 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.

SUBDIRS = tp_api

info_TEXINFOS = texinfo.texi info-stnd.texi
DISTCLEANFILES = texinfo.info* info-stnd.info*

MAKEINFO_ENVIRONMENT = TEXINFO_DEV_SOURCE=1 ; export TEXINFO_DEV_SOURCE ; \
                       top_srcdir="$(top_srcdir)" ; export top_srcdir ; \
                       top_builddir="$(top_builddir)" ; export top_builddir ;
MAKEINFO = $(MAKEINFO_ENVIRONMENT) $(PERL) $(top_builddir)/tp/texi2any

# We'd also like to use something like this, but Automake calls
# "install-info" directly.
# INSTALL_INFO = $(top_builddir)/$(native_tools)/util/ginstall-info

TXI_XLATE = txi-ca.tex txi-cs.tex txi-de.tex txi-en.tex txi-es.tex \
            txi-fr.tex txi-hu.tex txi-is.tex txi-it.tex txi-ja.tex \
            txi-nb.tex txi-nl.tex txi-nn.tex txi-pl.tex txi-pt.tex \
            txi-ru.tex txi-sr.tex txi-tr.tex txi-uk.tex

refcard_files = refcard/Makefile refcard/txicmdcheck \
                refcard/txirefcard-a4.pdf refcard/txirefcard.pdf \
		refcard/txirefcard.tex

# Include our texinfo.tex, not Automake's.
EXTRA_DIST = epsf.tex texinfo.tex \
             fdl.texi \
	     $(man_MANS) $(TXI_XLATE) \
             $(refcard_files) texinfo-tex-test.texi \
             texinfo-ja.tex short-sample-ja.texi

if INSTALL_WARNINGS
install-data-local:
	@echo
	@echo "WARNING: If your texmf tree does not already contain"
	@echo "         up-to-date versions, you must install"
	@echo "             texinfo.tex and txi-??.tex manually,"
	@echo "         perhaps in TEXMF/tex/texinfo/,"
	@echo "         where TEXMF is a root of your TeX tree."
	@echo "         See doc/README for some considerations."
	@echo "         You can run make TEXMF=/your/texmf install-tex to do this."
	@echo
	@echo "         You may also need to install epsf.tex in"
	@echo "         TEXMF/tex/generic/dvips, if your TeX"
	@echo "         installation did not include it."
endif

texmf_texinfo = $(TEXMF)/tex/texinfo
texmf_dvips = $(TEXMF)/tex/generic/epsf
install-tex:
	test -n "$(TEXMF)" || (echo "TEXMF must be set." >&2; exit 1)
	$(mkinstalldirs) $(DESTDIR)$(texmf_texinfo) $(DESTDIR)$(texmf_dvips)
	$(INSTALL_DATA) $(srcdir)/texinfo.tex $(DESTDIR)$(texmf_texinfo)/texinfo.tex
	$(INSTALL_DATA) $(srcdir)/epsf.tex $(DESTDIR)$(texmf_dvips)/epsf.tex
	for f in $(TXI_XLATE); do \
	  $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(texmf_texinfo)/$$f; done

# Do not create info files for distribution.
dist-info:

# Rules for updating the online web pages for the documentation
# using the gendocs.sh script; see
# http://www.gnu.org/prep/maintain/html_node/Invoking-gendocs_002esh.html
#
# Invoke gendocs.sh from a gnulib checkout (outside our tree).
#
gnulib = $(abs_top_srcdir)/../gnulib
gendocs = $(gnulib)/build-aux/gendocs.sh
gendocs_templates = $(gnulib)/doc
gendocs_envvars = GENDOCS_TEMPLATE_DIR=$(gendocs_templates)
#
gendocs_email = bug-texinfo@gnu.org
gendocs_dir_url = /manual/
gendocs_invoke = env $(gendocs_envvars) $(gendocs) --email $(gendocs_email) \
  --html '-c TOP_NODE_UP_URL=$(gendocs_dir_url)'
# A nice side effect of using --html is to eliminate the fancy css default;
# otherwise, we could use gendocs_template_min.
#
manual1 = info
manual1_title = "GNU Info manual"
#
manual2 = info-stnd
manual2_title = "GNU standalone info manual"
#
manual3 = texinfo
manual3_title = "GNU Texinfo manual"
#
# We also make a little HTML document for pod2texi script.
pod2texi_pl = $(abs_top_srcdir)/Pod-Simple-Texinfo/pod2texi.pl

# destination directory.
doctemp = wwwtemp
www_target = $(HOME)/gnu/www/texinfo/manual
#
wwwdoc-build:
	rm -rf $(doctemp) && mkdir $(doctemp)
	cd $(doctemp) \
	&& ln -s ../*.texi . \
	&& $(gendocs_invoke) -o $(manual1) $(manual1) $(manual1_title) \
	&& $(gendocs_invoke) -o $(manual2) $(manual2) $(manual2_title) \
	&& $(gendocs_invoke) -o $(manual3) $(manual3) $(manual3_title) \
	&& pod2html $(pod2texi_pl) >pod2texi.html \
	&& echo "Manuals ready for web distribution under: $(doctemp)/"
#
# At official release, we need to update:
# http://www.gnu.org/software/texinfo/manual/
wwwdoc-install:
	cp -arf $(doctemp)/$(manual1) $(doctemp)/$(manual2) \
                $(doctemp)/$(manual3) $(doctemp)/pod2texi.html \
                $(www_target)
	ls -ltu $(www_target)/*/html_node | tail  # cvs rm -f obsolete files
# followed by cvs add of new files and cvs commit.


code:
$Id$
texinfo/doc/README

  Copyright 2002, 2011 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.

This directory contains documentation on the Texinfo system and the TeX
sources needed to process Texinfo sources.  We recommend using the
texi2dvi included in this distribution to run a Texinfo manual through
TeX to produce a DVI file.

The .tex files are not installed automatically because TeX installations
vary so widely.  Installing them in the wrong place would give a false
sense of security.  So, you should simply cp *.tex to the appropriate
place.  If your installation follows the TeX Directory Structure
standard (http://tug.org/tds/), this will be the directory
TEXMF/tex/texinfo/ for texinfo.tex, and TEXMF/tex/generic/epsf/ for
epsf.tex.

It is also possible to put these .tex files in a `local' place instead
of overwriting existing ones, but this is more complicated.  See your TeX
documentation in general and the texmf.cnf file in particular for information.

If you add files to your TeX installations, not just replace existing
ones, you very likely have to update your ls-R file; do this by
running the mktexlsr command.

You can get the latest texinfo.tex from
ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex (and all GNU mirrors)
ftp://tug.org/tex/texinfo.tex (and all CTAN mirrors)
or from the gnulib project on Savannah (among other places).
If you have problems with the texinfo.tex in this distribution, please check
for a newer version.

path: doc/README


code:
@node texi2any Output Customization
@chapter @command{texi2any} Output Customization

@cartouche
@quotation Warning
The information displayed here is likely to change in the future.
In particular, the functions and their behavior may change in any
Texinfo release.
@end quotation
@end cartouche

This chapter describes how to customize aspects of the
@command{texi2any} HTML output.  Although some of the features here
can technically be used with other output formats, it's not especially
useful to do so, so we'll write the documentation as if HTML were the
target format.  Most of the customizations are only available for
HTML.

This part of the manual and the corresponding interfaces are being
stabilized, and the only parts described are those that should not
change in the future.  Many other aspects of the formatted HTML may
already be customized, but the interfaces will change and will be
documented as soon as they are stable.

The HTML converter takes a Texinfo Perl tree as input and transforms
it to HTML@.  The Texinfo Perl tree describes a Texinfo document in a
structured way which makes it easy to go through the tree and format
@@-commands and other containers.  The code that is used to go through
the tree cannot be customized, but the conversion of tree elements can
be fully customized.  The tree structure and the customization of
Texinfo Perl tree elements will be described in future versions of the
manual.

@menu
* Loading Init Files::               Finding and writing initialization files.
* Init File Basics::                 What init files can contain and do.
@end menu

@node Loading Init Files
@section Loading Initialization Files and Search Paths

@cindex Loading init files
@cindex Initialization files, loading
@cindex Search paths, for initialization files

@pindex Config @r{init files loaded}

You can write so-called @dfn{initialization files}, or @dfn{init
files} for short, to modify almost every aspect of output formatting.
The program loads init files named @file{Config} each time it is run.
Those files are looked for in the following directories:

@table @file
@item @var{datadir}/texi2any/
(where @var{datadir} is the system data directory specified at
compile-time, e.g., @file{/usr/local/share})

@item @var{sysconfdir}/texi2any/
(likewise specified at compile time, e.g., @file{/usr/local/etc})

@item ~/.texi2any/
(where @code{~} is the current user's home directory)

@item ./.texi2any/
(under the current directory)

@item ./
(the current directory)
@end table

All @file{Config} files found are loaded, in the above order.  Thus,
@file{./Config} can override entries in, say,
@file{/usr/local/share/makeinfo/Config}.

@opindex --init-file
However, the most common way to load an initialization file is with
the @option{--init-file} option, explicitly specifying the file to be
loaded.  By default the following directories are searched, in the
following order.
@c  where @var{prog} is the name of the program invoked
@c on the command line (@command{makeinfo}, @command{texi2any}, etc.).
Only the first file found is used:

@enumerate
@item The current directory @file{./};

@item @file{./.texi2any/} under the current directory;

@item @file{~/.texi2any/}
where @code{~} is the current user's home directory;

@item @file{@var{sysconfdir}/texi2any/}
where @var{sysconfdir} is the system configuration directory
specified at compile-time, e.g., @file{/usr/local/etc};

@item @file{@var{datadir}/texi2any/}
Where @var{datadir} is the system data directory likewise specified at
compile time, e.g., @file{/usr/local/share};

@item @file{./.texinfo/init/} under the current directory;

@item @file{~/.texinfo/init/} under the current home directory;

@item @file{@var{sysconfdir}/texinfo/init/} with @var{sysconfdir} as above;

@item @file{@var{datadir}/texinfo/init/} with @var{datadir} as above.
@end enumerate

Additional directories may be prepended to the list with the
@option{--conf-dir} option (@pxref{Invoking texi2any}).

@node Init File Basics
@section Init File Basics

@cindex Init file basics
@cindex Perl, language for init files

Init files are written in Perl, and by convention have extension
@file{.init} or @file{.pm}.
@c Several init files are included in the Texinfo
@c distribution (some are crucial components of the program), and can
@c serve as a good model for writing your own.
@c  Smaller examples include @file{utf8.pm},
@c @file{html32.pm}, and plenty more.

@menu
* Init File Namespaces:: @code{Texinfo::Config}.
* Setting and Getting Customization Variables::
* Internationalization of Strings::
@end menu
@c * Init File Expansion Contexts::     Normal, preformatted, string, math.

@node Init File Namespaces
@subsection Init File Namespaces

@cindex Init file namespaces
@cindex Namespaces, for init files
@cindex Perl namespaces, for init files

@c when colons are supported ... vindex Texinfo::Config @r{namespace}
Initialization file are loaded from the main program via an
@code{require} call in the @code{Texinfo::Config} namespace.  This
means that the namespace of the main program and the namespace of
initialization files are distinct, which minimizes the chance of a
name clash.

@node Setting and Getting Customization Variables
@subsection Setting and Getting Customization Variables

@cindex Customization variables, setting and getting

The basic operations on customization variables are to set and
retrieve their values.

To set the value of a customization variable from an initialization
file, you should use @code{set_from_init_file}:

@defun set_from_init_file ($variable_name, $variable_value)
@var{$variable_name} is a string containing the name of the variable
you want to set, and @var{$variable_value} is the value to which you
want to set it.  @var{$variable_value} may be @samp{undef}.
@end defun

For example,

@example
set_from_init_file('documentlanguage', 'fr');
@end example

@noindent overrides the @code{@@documentlanguage} from the
document.  It would be overridden by @option{--document-language} on
the command line.

Another example:

@example
set_from_init_file('SPLIT', 'chapter');
@end example

@noindent overrides the default splitting of the document.  It would be
overridden by @option{--split} on the command line.

A final example:

@example
set_from_init_file('NO_CSS', 1);
@end example

@noindent overrides the default value for @code{NO_CSS}.  It would be
overridden by @code{--set-customization-variable NO_CSS=1} on the command line.

To get the value of a variable, the function is @code{get_conf}:

@defun get_conf ($variable_name)
@var{$variable_name} is the name of the variable; its value (possibly
@code{undef}) is returned.
@end defun

For example:

@example
if (get_conf('footnotestyle') eq 'separate') @{ ... @}
@end example

For the customization variables associated with @@-commands, see
@ref{Customization Variables for @@-Commands}.  For the customization
variables associated with command line options, see @ref{Customization
Variables and Options}.

 @ignore
@c The following is still true, but right now nothing uses these contexts
@c in init files.
@c
@c @node Init File Expansion Contexts
@c @subsection Init File Expansion Contexts: Normal, Preformatted, String, Math
@c
@c @cindex Init file expansion contexts
@c @cindex Expansion contexts, for init files
@c @cindex Contexts for expansion in init files
@c
@c There are four expansion contexts of interest:
@c
@c @table @emph
@c @item normal context
@c @cindex Normal expansion context
@c Paragraphs, index entries, tables, @enddots{}
@c
@c @item preformatted context
@c @cindex Preformatted expansion context
@c When spaces between words are kept.  For example, within the
@c @code{@@display} (@pxref{display,, @code{@@display}}) and
@c @code{@@example} environments (@pxref{example,, @code{@@example}}), and
@c in menu comments.  The preformatted regions
@c are usually rendered using @code{<pre>} elements in HTML.
@c
@c @c oldapi (@pxref{Menu formatting})
@c
@c @item string context
@c @cindex String expansion context
@c When rendering strings without formatting elements, for example in
@c comments (@pxref{Comments}) and titles.  In the string context, there
@c is limited formatting, typically without any element when producing HTML,
@c so the value can be used in an attribute.
@c
@c @item math context
@c @cindex Math expansion context
@c Math (@pxref{math,, @code{@@math}}).
@c
@c @end table
@end ignore

@node Internationalization of Strings Function
@subsection Internationalization of Strings in the Output Document Function

@vindex texinfo_document @r{Gettext domain}
The subroutine @code{gdt} is used for translated strings:

@defun gdt (\%converter, $string, \%variables_hash)
@var{$string} is the string to be translated, @var{\%variables_hash}
is a hash reference holding the variable parts of the translated
string, and @var{\%converter} is an object which holds the informations
about the context.  The result returned is a perl Texinfo tree.
@end defun

When the string is expanded as Texinfo, and converted to a
Texinfo tree in perl, the arguments are substituted; for
example, @samp{@{arg_name@}} is replaced by the corresponding
actual argument, which should be Texinfo perl trees or Texinfo
perl tree contents arrays.

In the following example, @samp{@{date@}}, @samp{@{program_homepage@}}
and @samp{@{program@}} are the arguments of the string.  Since they
are used in @code{@@uref}, their order is not predictable.
@samp{@{date@}}, @samp{@{program_homepage@}} and @samp{@{program@}} are
substituted after the expansion, which means that they should already be
Texinfo perl trees or Texinfo perl tree contents:

@example
gdt('Generated on @@emph@{@{date@}@} using
     @@uref@{@{program_homepage@}, @@emph@{@{program@}@}@}.',
    @{
     'date' => expand_today(\%converter),
     'program_homepage'
         => @{'text' => $Texi2HTML::THISDOC@{'program_homepage'@}@},
     'program'
         => @{'text' => $Texi2HTML::THISDOC@{'program_and_version'@}@} @},
   );
@end example


code:
%%% -*-TeX-*-
%%% ====================================================================
%%%  @TeX-file{
%%%     author          = "Tom Rokicki",
%%%     version         = "2.7.4",
%%%     date            = "14 February 2011",
%%%     time            = "15:44:06 MST",
%%%     filename        = "epsf.tex",
%%%     address         = "Tom Rokicki
%%%                        Box 2081
%%%                        Stanford, CA 94309
%%%                        USA",
%%%     telephone       = "+1 415 855 9989",
%%%     checksum        = "29223 653 3100 27123",
%%%     email           = "rokicki@cs.stanford.edu (Internet)",
%%%     codetable       = "ISO/ASCII",
%%%     copyright       = "This file is freely redistributable and
%%%                        placed into the public domain by Tomas
%%%                        Rokicki.",
%%%     keywords        = "PostScript, TeX",
%%%     license         = "public domain",
%%%     supported       = "yes",
%%%     abstract        = "This file contains macros to support the
%%%                        inclusion of Encapsulated PostScript files
%%%                        in TeX documents.",
%%%     docstring       = "This file contains TeX macros to include an
%%%                        Encapsulated PostScript graphic.  It works
%%%                        by finding the bounding box comment,
%%%                        calculating the correct scale values, and
%%%                        inserting a vbox of the appropriate size at
%%%                        the current position in the TeX document.
%%%
%%%                        To use, simply use
%%%
%%%                        \input epsf % somewhere early on in your TeX file
%%%
%%%                        % then where you want to insert a vbox for a figure:
%%%                        \epsfbox{filename.ps}
%%%
%%%                        Alternatively, you can supply your own
%%%                        bounding box by
%%%
%%%                        \epsfbox[0 0 30 50]{filename.ps}
%%%
%%%                        This will not read in the file, and will
%%%                        instead use the bounding box you specify.
%%%
%%%                        The effect will be to typeset the figure as
%%%                        a TeX box, at the point of your \epsfbox
%%%                        command. By default, the graphic will have
%%%                        its `natural' width (namely the width of
%%%                        its bounding box, as described in
%%%                        filename.ps). The TeX box will have depth
%%%                        zero.
%%%
%%%                        You can enlarge or reduce the figure by
%%%                        using
%%%
%%%                          \epsfxsize = <dimen> \epsfbox{filename.ps}
%%%                        or
%%%                          \epsfysize = <dimen> \epsfbox{filename.ps}
%%%
%%%                        instead. Then the width of the TeX box will
%%%                        be \epsfxsize and its height will be scaled
%%%                        proportionately (or the height will be
%%%                        \epsfysize and its width will be scaled
%%%                        proportionately).
%%%
%%%                        The width (and height) is restored to zero
%%%                        after each use, so \epsfxsize or \epsfysize
%%%                        must be specified before EACH use of
%%%                        \epsfbox.
%%%
%%%                        A more general facility for sizing is
%%%                        available by defining the \epsfsize macro.
%%%                        Normally you can redefine this macro to do
%%%                        almost anything.  The first parameter is
%%%                        the natural x size of the PostScript
%%%                        graphic, the second parameter is the
%%%                        natural y size of the PostScript graphic.
%%%                        It must return the xsize to use, or 0 if
%%%                        natural scaling is to be used.  Common uses
%%%                        include:
%%%
%%%                           \epsfxsize  % just leave the old value alone
%%%                           0pt         % use the natural sizes
%%%                           #1          % use the natural sizes
%%%                           \hsize      % scale to full width
%%%                           0.5#1       % scale to 50% of natural size
%%%                           \ifnum #1 > \hsize \hsize \else #1\fi
%%%                                       % smaller of natural, hsize
%%%
%%%                        If you want TeX to report the size of the
%%%                        figure (as a message on your terminal when
%%%                        it processes each figure), use
%%%                        `\epsfverbosetrue'.
%%%
%%%                        If you only want to get the bounding box
%%%                        extents, without producing any output boxes
%%%                        or \special{}, then use \epsfgetbb{filename}.
%%%                        The bounding box corner coordinates are saved
%%%                        in the macros \epsfllx, \epsflly, \epsfurx,
%%%                        and \epsfury in PostScript units of big
%%%                        points.
%%%
%%%                        Revision history:
%%%
%%%                        ---------------------------------------------
%%%                        epsf.tex macro file:
%%%                        Originally written by Tomas Rokicki of
%%%                        Radical Eye Software, 29 Mar 1989.
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Don Knuth, 3 Jan 1990.
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Tomas Rokicki, 18 Jul 1990.
%%%                        Accept bounding boxes with no space after
%%%                        the colon.
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, 03 Dec 1991 [2.0].
%%%                        Add version number and date typeout.
%%%
%%%                        Use \immediate\write16 instead of \message
%%%                        to ensure output on new line.
%%%
%%%                        Handle nested EPS files.
%%%
%%%                        Handle %%BoundingBox: (atend) lines.
%%%
%%%                        Do not quit when blank lines are found.
%%%
%%%                        Add a few percents to remove generation of
%%%                        spurious blank space.
%%%
%%%                        Move \special output to
%%%                        \epsfspecial{filename} so that other macro
%%%                        packages can input this one, then change
%%%                        the definition of \epsfspecial to match
%%%                        another DVI driver.
%%%
%%%                        Move size computation to \epsfsetsize which
%%%                        can be called by the user; the verbose
%%%                        output of the bounding box and scaled width
%%%                        and height happens here.
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, 05 May 1992 [2.1].
%%%                        Wrap \leavevmode\hbox{} around \vbox{} with
%%%                        the \special so that \epsffile{} can be
%%%                        used inside \begin{center}...\end{center}
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, 09 Dec 1992 [2.2].
%%%                        Introduce \epsfshow{true,false} and
%%%                        \epsfframe{true,false} macros; the latter
%%%                        suppresses the insertion of the PostScript,
%%%                        and instead just creates an empty box,
%%%                        which may be handy for rapid prototyping.
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, 14 Dec 1992 [2.3].
%%%                        Add \epsfshowfilename{true,false}.  When
%%%                        true, and \epsfshowfalse is specified, the
%%%                        PostScript file name will be displayed
%%%                        centered in the figure box.
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, 20 June 1993 [2.4].
%%%                        Remove non-zero debug setting of \epsfframemargin,
%%%                        and change margin handling to preserve EPS image
%%%                        size and aspect ratio, so that the actual
%%%                        box is \epsfxsize+\epsfframemargin wide by
%%%                        \epsfysize+\epsfframemargin high.
%%%                        Reduce output of \epsfshowfilenametrue to
%%%                        just the bare file name.
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, 13 July 1993 [2.5].
%%%                        Add \epsfframethickness for control of
%%%                        \epsfframe frame lines.
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, 02 July 1996 [2.6]
%%%                        Add missing initialization \epsfatendfalse;
%%%                        the lack of this resulted in the wrong
%%%                        BoundingBox being picked up, mea culpa, sigh...
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, 25 October 1996 [2.7]
%%%                        Update to match changes in from dvips 5-600
%%%                        distribution: new user-accessible macros:
%%%                        \epsfclipon, \epsfclipoff, \epsfdrafton,
%%%                        \epsfdraftoff, change \empty to \epsfempty.
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, 18 May 2002 [2.7.1]
%%%                        Add write statements to echo input file
%%%                        names.  Prior to that change, an error in
%%%                        such a file could be quite hard to track
%%%                        down: a long list of TeX page numbers could
%%%                        suddenly be followed by ``TeX buffer
%%%                        capacity'' exceeded, without any indication
%%%                        of the file that was responsible.
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, 16 May 2003 [2.7.2]
%%%                        Supply two critical percent characters that
%%%                        were mistakenly omitted in version 2.7.1,
%%%                        and resulted in a small amount of spurious
%%%                        horizontal space.
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, 14 Feb 2011 [2.7.3]
%%%                        Add previously-missing \space in rwi
%%%                        assignments (bug reported 14-Feb-2011 by
%%%                        Stefan Rueger <s.rueger@open.ac.uk>).
%%%
%%%                        ---------------------------------------------
%%%                        Revised by Nelson H. F. Beebe
%%%                        <beebe@math.utah.edu>, Karl Berry
%%%                        <karl@freefriends.org>, and Robin Fairbairns
%%%                        <Robin.Fairbairns@cl.cam.ac.uk>,
%%%                        23 July 2005 [2.7.3]
%%%                        Add critical \hbox{} wrapper in \epsfsetgraph
%%%                        so that \epsfbox{} does not conflict with
%%%                        LaTeX center environment when \epsfbox{} is
%%%                        surrounded by other horizonal objects.
%%%                        Improve macro readability by adding legal,
%%%                        but invisible-in-typeset-output, spaces.
%%%                        Ensure that verbose status reports come
%%%                        inside (filename ...) list.
%%%
%%%                        ---------------------------------------------
%%%                        The checksum field above contains a CRC-16
%%%                        checksum as the first value, followed by
%%%                        the equivalent of the standard UNIX wc
%%%                        (word count) utility output of lines,
%%%                        words, and characters.  This is produced by
%%%                        Robert Solovay's checksum utility.",
%%%  }
%%% ====================================================================

%\immediate \write16 {This is `epsf.tex' v2.0 <02 Dec 1991>}%
%\immediate \write16 {This is `epsf.tex' v2.1 <05 May 1992>}%
%\immediate \write16 {This is `epsf.tex' v2.2 <09 Dec 1992>}%
%\immediate \write16 {This is `epsf.tex' v2.3 <14 Dec 1992>}%
%\immediate \write16 {This is `epsf.tex' v2.4 <20 June 1993>}%
%\immediate \write16 {This is `epsf.tex' v2.5 <13 July 1993>}%
%\immediate \write16 {This is `epsf.tex' v2.6 <02 July 1996>}%
%\immediate \write16 {This is `epsf.tex' v2.7 <25 October 1996>}%
%\immediate \write16 {This is `epsf.tex' v2.7.1 <18 May 2002>}%
%\immediate \write16 {This is `epsf.tex' v2.7.2 <16 May 2003>}%
%\immediate \write16 {This is `epsf.tex' v2.7.3 <23 July 2005>}%
\immediate \write16 {This is `epsf.tex' v2.7.4 <14 February 2011>}%
%
\newread \epsffilein    % file to \read
\newif \ifepsfatend     % need to scan to LAST %%BoundingBox comment?
\newif \ifepsfbbfound   % success?
\newif \ifepsfdraft     % use draft mode?
\newif \ifepsffileok    % continue looking for the bounding box?
\newif \ifepsfframe     % frame the bounding box?
\newif \ifepsfshow      % show PostScript file, or just bounding box?
\epsfshowtrue          % default is to display PostScript file
\newif \ifepsfshowfilename % show the file name if \epsfshowfalse specified?
\newif \ifepsfverbose   % report what you're making?
\newdimen \epsfframemargin % margin between box and frame
\newdimen \epsfframethickness % thickness of frame rules
\newdimen \epsfrsize    % vertical size before scaling
\newdimen \epsftmp      % register for arithmetic manipulation
\newdimen \epsftsize    % horizontal size before scaling
\newdimen \epsfxsize    % horizontal size after scaling
\newdimen \epsfysize    % vertical size after scaling
\newdimen \pspoints     % conversion factor
%
\pspoints = 1bp        % Adobe points are `big'
\epsfxsize = 0pt       % default value, means `use natural size'
\epsfysize = 0pt       % ditto
\epsfframemargin = 0pt % default value: frame box flush around picture
\epsfframethickness = 0.4pt % TeX's default rule thickness
%
\def \epsfbox #1{%
    \global \def \epsfllx {72}%
    \global \def \epsflly {72}%
    \global \def \epsfurx {540}%
    \global \def \epsfury {720}%
    \def \lbracket {[}%
    \def \testit {#1}%
    \ifx \testit \lbracket
        \let \next = \epsfgetlitbb
    \else
        \let \next = \epsfnormal
    \fi
    \next{#1}%
}%
%
% We use \epsfgetlitbb if the user specified an explicit bounding box,
% and \epsfnormal otherwise.  Because \epsfgetbb can be called
% separately to retrieve the bounding box, we move the verbose
% printing the bounding box extents and size on the terminal to
% \epsfstatus.  Therefore, when the user provided the bounding box,
% \epsfgetbb will not be called, so we must call \epsfsetsize and
% \epsfstatus ourselves.
%
\def \epsfgetlitbb #1#2 #3 #4 #5]#6{%
   \epsfgrab #2 #3 #4 #5 .\\%
   \epsfsetsize
   \epsfstatus{#6}%
   \epsfsetgraph{#6}%
}%
%
\def \epsfnormal #1{%
    \epsfgetbb{#1}%
    \epsfsetgraph{#1}%
}%
%
\def \epsfgetbb #1{%
%
%   The first thing we need to do is to open the
%   PostScript file, if possible.
%
    \openin\epsffilein=#1
    \immediate \write16 {(#1}%
    \ifeof \epsffilein
        \errmessage{Could not open file #1, ignoring it}%
    \else                       %process the file
        {%                      %start a group to contain catcode changes
            % Make all special characters, except space, to be of type
            % `other' so we process the file in almost verbatim mode
            % (TeXbook, p. 344).
            \chardef \other = 12%
            \def \do ##1{\catcode`##1=\other}%
            \dospecials
            \catcode `\ = 10%
            \epsffileoktrue        %true while we are looping
            \epsfatendfalse        %[02-Jul-1996]: add forgotten initialization
            \loop                  %reading lines from the EPS file
                \read \epsffilein to \epsffileline
                \ifeof \epsffilein %then no more input
                \epsffileokfalse   %so set completion flag
            \else                  %otherwise process one line
                \expandafter \epsfaux \epsffileline :. \\%
            \fi
            \ifepsffileok
            \repeat
            \ifepsfbbfound
            \else
                \ifepsfverbose
                    \immediate \write16 {No BoundingBox comment found in %
                                         file #1; using defaults}%
                \fi
            \fi
        }%                      %end catcode changes
        \closein\epsffilein
    \fi                         %end of file processing
    \epsfsetsize                %compute size parameters
    \epsfstatus{#1}%
    \immediate \write16 {)}%
}%
%
% Clipping control:
\def \epsfclipon  {\def \epsfclipstring { clip}}%
\def \epsfclipoff {\def \epsfclipstring {\ifepsfdraft \space clip\fi}}%
\epsfclipoff % default for dvips is OFF
%
% The special that is emitted by \epsfsetgraph comes from this macro.
% It is defined separately to allow easy customization by other
% packages that first \input epsf.tex, then redefine \epsfspecial.
% This macro is invoked in the lower-left corner of a box of the
% width and height determined from the arguments to \epsffile, or
% from the %%BoundingBox in the EPS file itself.
%
% This version is for dvips:
\def \epsfspecial #1{%
     \epsftmp=10\epsfxsize
     \divide \epsftmp by \pspoints
     \ifnum \epsfrsize = 0%
       \relax
       \special{PSfile=\ifepsfdraft psdraft.ps\else#1\fi\space
		llx=\epsfllx\space
		lly=\epsflly\space
		urx=\epsfurx\space
		ury=\epsfury\space
		rwi=\number\epsftmp\space
		\epsfclipstring
               }%
     \else
       \epsfrsize=10\epsfysize
       \divide \epsfrsize by \pspoints
       \special{PSfile=\ifepsfdraft psdraft.ps\else#1\fi\space
		llx=\epsfllx\space
		lly=\epsflly\space
		urx=\epsfurx\space
		ury=\epsfury\space
		rwi=\number\epsftmp\space
		rhi=\number\epsfrsize
		\epsfclipstring
               }%
     \fi
}%
%
% \epsfframe macro adapted from the TeXbook, exercise 21.3, p. 223, 331.
% but modified to set the box width to the natural width, rather
% than the line width, and to include space for margins and rules
\def \epsfframe #1%
{%
 % method for detecting latex suggested by Robin Fairbairns, May 2005.
  \ifx \documentstyle \epsfundefined
    \relax
  \else
%    \leavevmode                   % so we can put this inside
                                  % a latex centered environment
    % The \leavevmode breaks under plain when this is inside a box,
    % because it forces the figure to be the entire \hsize.  On the
    % other hand, we need the \leavevmode for it to work in LaTeX,
    % because the {center} environment works by adjusting TeX's
    % paragraph parameters.
    %
    % Compare the LaTeX sequence
    % \begin{center}
    %   \epsfbox{tip.eps}q
    % \end{center}
    % (needs the \leavevmode to put the q right next to the image)
    %
    % with the plain TeX sequence:
    % \leftline{\vbox{\epsfbox{tip.eps}}q}
    % (had the q all the way over to the right, when \leavevmode was used)
  \fi
  %
  \setbox0 = \hbox{#1}%
  \dimen0 = \wd0                                % natural width of argument
  \advance \dimen0 by 2\epsfframemargin         % plus width of 2 margins
  \advance \dimen0 by 2\epsfframethickness      % plus width of 2 rule lines
  \relax
  \hbox{%
    \vbox
    {%
      \hrule height \epsfframethickness depth 0pt
      \hbox to \dimen0
      {%
	\hss
	\vrule width \epsfframethickness
	\kern \epsfframemargin
	\vbox {\kern \epsfframemargin \box0 \kern \epsfframemargin }%
	\kern \epsfframemargin
	\vrule width \epsfframethickness
	\hss
      }% end hbox
      \hrule height 0pt depth \epsfframethickness
    }% end vbox
  }% end hbox
  \relax
}%
%
\def \epsfsetgraph #1%
{%
   %
   % Make the vbox and stick in a \special that the DVI driver can
   % parse.  \vfil and \hfil are used to place the \special origin at
   % the lower-left corner of the vbox.  \epsfspecial can be redefined
   % to produce alternate \special syntaxes.
   %
   \ifvmode \leavevmode \fi
   \relax
   \hbox{% so we can put this in \begin{center}...\end{center}
     \ifepsfframe \expandafter \epsfframe \fi
     {\vbox to\epsfysize
     {%
        \ifepsfshow
            % output \special{} at lower-left corner of figure box
            \vfil
            \hbox to \epsfxsize{\epsfspecial{#1}\hfil}%
        \else
            \vfil
            \hbox to\epsfxsize{%
               \hss
               \ifepsfshowfilename
               {%
                  \epsfframemargin=3pt % local change of margin
                  \epsfframe{{\tt #1}}%
               }%
               \fi
               \hss
            }%
            \vfil
        \fi
     }%
   }}%
   \relax
   %
   % Reset \epsfxsize and \epsfysize, as documented above.
   %
   \global \epsfxsize = 0pt
   \global \epsfysize = 0pt
}%
%
%   Now we have to calculate the scale and offset values to use.
%   First we compute the natural sizes.
%
\def \epsfsetsize
{%
   \epsfrsize = \epsfury \pspoints
   \advance \epsfrsize by -\epsflly \pspoints
   \epsftsize = \epsfurx \pspoints
   \advance \epsftsize by -\epsfllx \pspoints
%
%   If `epsfxsize' is 0, we default to the natural size of the picture.
%   Otherwise we scale the graph to be \epsfxsize wide.
%
   \epsfxsize = \epsfsize{\epsftsize}{\epsfrsize}%
   \ifnum \epsfxsize = 0
      \ifnum \epsfysize = 0
	\epsfxsize = \epsftsize
        \epsfysize = \epsfrsize
	\epsfrsize = 0pt
%
%   We have a sticky problem here:  TeX doesn't do floating point arithmetic!
%   Our goal is to compute y = rx/t. The following loop does this reasonably
%   fast, with an error of at most about 16 sp (about 1/4000 pt).
%
      \else
	\epsftmp = \epsftsize
        \divide \epsftmp by \epsfrsize
	\epsfxsize = \epsfysize
        \multiply \epsfxsize by \epsftmp
	\multiply \epsftmp by \epsfrsize
        \advance \epsftsize by -\epsftmp
	\epsftmp = \epsfysize
	\loop
        \advance \epsftsize by \epsftsize
        \divide \epsftmp by 2
	\ifnum \epsftmp > 0
	   \ifnum \epsftsize < \epsfrsize
           \else
	      \advance \epsftsize -\epsfrsize
              \advance \epsfxsize \epsftmp
           \fi
	\repeat
	\epsfrsize = 0pt
      \fi
   \else
     \ifnum \epsfysize = 0
       \epsftmp = \epsfrsize
       \divide \epsftmp by \epsftsize
       \epsfysize = \epsfxsize
       \multiply \epsfysize by \epsftmp
       \multiply \epsftmp by \epsftsize
       \advance \epsfrsize by -\epsftmp
       \epsftmp = \epsfxsize
       \loop
	 \advance \epsfrsize by \epsfrsize
	 \divide \epsftmp by 2
       \ifnum \epsftmp > 0
	  \ifnum \epsfrsize < \epsftsize
          \else
	     \advance \epsfrsize by -\epsftsize
             \advance \epsfysize by \epsftmp
          \fi
       \repeat
       \epsfrsize = 0pt
     \else
       \epsfrsize = \epsfysize
     \fi
   \fi
}%
%
% Issue some status messages if the user requested them
%
\def \epsfstatus #1{% arg = filename
   \ifepsfverbose
     \immediate \write16 {#1: BoundingBox:
			  llx = \epsfllx \space lly = \epsflly \space
			  urx = \epsfurx \space ury = \epsfury \space}%
     \immediate \write16 {#1: scaled width = \the\epsfxsize \space
			  scaled height = \the\epsfysize}%
   \fi
}%
%
%   We still need to define the tricky \epsfaux macro. This requires
%   a couple of magic constants for comparison purposes.
%
{\catcode`\%=12 \global \let \epsfpercent=%\global \def \epsfbblit {%BoundingBox}}%
\global \def \epsfatend{(atend)}%
%
%   So we're ready to check for `%BoundingBox:' and to grab the
%   values if they are found.
%
%   If we find a line
%
%   %%BoundingBox: (atend)
%
%   then we ignore it, but set a flag to force parsing all of the
%   file, so the last %%BoundingBox parsed will be the one used.  This
%   is necessary, because EPS files can themselves contain other EPS
%   files with their own %%BoundingBox comments.
%
%   If we find a line
%
%   %%BoundingBox: llx lly urx ury
%
%   then we save the 4 values in \epsfllx, \epsflly, \epsfurx, \epsfury.
%   Then, if we have not previously parsed an (atend), we flag completion
%   and can stop reading the file.  Otherwise, we must keep on reading
%   to end of file so that we find the values on the LAST %%BoundingBox.
\long \def \epsfaux#1#2:#3\\%
{%
   \def \testit {#2}%           % save second character up to just before colon
   \ifx#1\epsfpercent           % then first char is percent (quick test)
       \ifx \testit \epsfbblit  % then (slow test) we have %%BoundingBox
            \epsfgrab #3 . . . \\%
            \ifx \epsfllx\epsfatend % then ignore %%BoundingBox: (atend)
                \global \epsfatendtrue
            \else               % else found %%BoundingBox: llx lly urx ury
                \ifepsfatend    % then keep parsing ALL %%BoundingBox lines
                \else           % else stop after first one parsed
                    \epsffileokfalse
                \fi
                \global \epsfbbfoundtrue
            \fi
       \fi
   \fi
}%
%
%   Here we grab the values and stuff them in the appropriate definitions.
%
\def \epsfempty {}%
\def \epsfgrab #1 #2 #3 #4 #5\\{%
   \global \def \epsfllx {#1}\ifx \epsfllx\epsfempty
      \epsfgrab #2 #3 #4 #5 .\\\else
   \global \def \epsflly {#2}%
   \global \def \epsfurx {#3}\global \def \epsfury {#4}\fi
}%
%
%   We default the epsfsize macro.
%
\def \epsfsize #1#2{\epsfxsize}%
%
%   Finally, another definition for compatibility with older macros.
%
\let \epsffile = \epsfbox
\endinput