Changeset f36635 in git


Ignore:
Timestamp:
Jul 1, 1999, 2:52:33 PM (24 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
Children:
90402fff9cff37cdf6bd00ce9b9fd9b3994289ce
Parents:
e03e679922f2f0c529514b3e8dc048988ddad4ee
Message:
* merged in changes from 1-2-3


git-svn-id: file:///usr/local/Singular/svn/trunk@3207 2c84dea3-7e68-4137-9b89-c4e89433aadc
Files:
3 added
21 edited

Legend:

Unmodified
Added
Removed
  • COPYING

    re03e67 rf36635  
    1                          SINGULAR version 1.2
     1                         SINGULAR version <x-y-z>
    22                     University of Kaiserslautern
    33       Department of Mathematics and Centre for Computer Algebra
    44           Authors: G.-M. Greuel, G. Pfister, H.  Schoenemann
    5               Copyright (C) 1986-98; All Rights reserved
     5              Copyright (C) 1986-99; All Rights reserved
    66
    77                                NOTICE
  • Makefile.in

    re03e67 rf36635  
    1818
    1919PERL            = @PERL@
     20TMP_DIR         = @TMP_DIR@
    2021
    2122##############################################################
     
    2930.PHONY: all install uninstall
    3031
     32TEXINFO_TEX_FILES = epsf.tex texinfo.tex txi-cs.tex txi-de.tex txi-no.tex
     33TEXINFO_TEX_DIR = Texinfo/doc
    3134all install uninstall:
    3235        @ for SUBDIR in ${BUILD_SUBDIRS}; \
    3336        do \
    3437          echo ${MAKE} $@ in $${SUBDIR}; \
    35           ( cd $${SUBDIR} && ${MAKE} $@; ) \
     38          ( cd $${SUBDIR} && ${MAKE} $@;); \
     39          (if test "$${SUBDIR}" = Texinfo && test -d doc; then \
     40                for FILE in ${TEXINFO_TEX_FILES}; \
     41                do \
     42                  if test "$@" = uninstall; then\
     43                    echo rm -f doc/$${FILE};\
     44                    rm -f doc/$${FILE}; \
     45                  else \
     46                    echo cp ${TEXINFO_TEX_DIR}/$${FILE} doc; \
     47                    cp ${TEXINFO_TEX_DIR}/$${FILE} doc; \
     48                  fi; \
     49                done;\
     50          fi;); \
    3651        done
    3752
     
    108123LN_S            = @LN_S@
    109124MKINSTALLDIRS   = ./mkinstalldirs
    110 TMPDIR          = /tmp/singdist
     125TMPDIR          = ${TMP_DIR}/singdist
    111126SINGUNAME       = @SINGUNAME@
    112127S_VERSION       = $${SINGULAR_VERSION-@SINGULAR_VERSION@}
    113 DISTROOT_NAME   = Singular-${S_VERSION}
    114 BINDIST_NAME    = ${DISTROOT_NAME}-${SINGUNAME}
    115 SHAREDIST_NAME  = ${DISTROOT_NAME}-share
     128BINDIR_NAME     = Singular/${SINGUNAME}/${S_VERSION}
     129LIBDIR_NAME     = Singular/LIB/${S_VERSION}
     130GFTABLESDIR_NAME= Singular/LIB/gftables
     131DOCDIR_NAME     = Singular/doc/${S_VERSION}
     132HTMLDIR_NAME    = Singular/html/${S_VERSION}
     133
     134BINDIST_NAME    = Singular-${S_VERSION}-${SINGUNAME}
     135SHAREDIST_NAME  = Singular-${S_VERSION}-share
    116136ZIP             = zip
    117137
     
    123143        cd doc; ${MAKE} all ps
    124144        rm -rf ${TMPDIR}/
    125         ${MKINSTALLDIRS} ${TMPDIR}/Singular/LIB/${S_VERSION}
    126         ${MKINSTALLDIRS} ${TMPDIR}/Singular/doc/${S_VERSION}
    127         ${MKINSTALLDIRS} ${TMPDIR}/Singular/html/${S_VERSION}
    128         ${MKINSTALLDIRS} ${TMPDIR}/Singular/LIB/gftables
    129         cp Singular/LIB/*.lib ${TMPDIR}/Singular/LIB/${S_VERSION}
     145        ${MKINSTALLDIRS} ${TMPDIR}/${LIBDIR_NAME}
     146        ${MKINSTALLDIRS} ${TMPDIR}/${GFTABLESDIR_NAME}
     147        ${MKINSTALLDIRS} ${TMPDIR}/${DOCDIR_NAME}
     148        ${MKINSTALLDIRS} ${TMPDIR}/${HTMLDIR_NAME}
     149        cp Singular/LIB/*.lib ${TMPDIR}/${LIBDIR_NAME}
    130150        rm -f ${TMPDIR}/Singular/LIB/${S_VERSION}/fastsolv.lib
    131151        rm -f ${TMPDIR}/Singular/LIB/${S_VERSION}/tst.lib
    132         cp Singular/LIB/gftables/[0-9]* ${TMPDIR}/Singular/LIB/gftables
     152        cp Singular/LIB/gftables/[0-9]* ${TMPDIR}/${GFTABLESDIR_NAME}
    133153        cp doc/singular.hlp doc/singular.ps doc/usercard.ps \
    134154           doc/singular.dvi doc/usercard.dvi \
    135            ${TMPDIR}/Singular/doc/${S_VERSION}
    136         cp -R doc/html/* ${TMPDIR}/Singular/html/${S_VERSION}
     155           ${TMPDIR}/${DOCDIR_NAME}
     156        cp -R doc/html/* ${TMPDIR}/${HTMLDIR_NAME}
    137157        cat README.general | sed -e "s/<x-y-z>/${S_VERSION}/g" > \
    138158                             ${TMPDIR}/Singular/README
     
    150170        cd Singular; ${MAKE} Singular-$@ libparse
    151171        rm -rf ${TMPDIR}
    152         ${MKINSTALLDIRS} ${TMPDIR}/${SINGUNAME}/bin/
    153         ${MKINSTALLDIRS} ${TMPDIR}/Singular
    154         cp Singular/Singular-$@ \
    155            ${TMPDIR}/${SINGUNAME}/bin/Singular-${S_VERSION}
    156         cd ${TMPDIR}/${SINGUNAME}/bin; \
    157            ${LN_S} Singular-${S_VERSION} Singular
    158         cp Singular/libparse ${TMPDIR}/${SINGUNAME}/bin/
    159         -strip ${TMPDIR}/${SINGUNAME}/bin/*
     172        ${MKINSTALLDIRS} ${TMPDIR}/${BINDIR_NAME}
     173        cp Singular/Singular-$@ ${TMPDIR}/${BINDIR_NAME}/Singular
     174        cp Singular/libparse ${TMPDIR}/${BINDIR_NAME}
     175        -strip ${TMPDIR}/${BINDIR_NAME}/*
    160176        cat INSTALL.unix | sed -e "s/<x-y-z>/${S_VERSION}/g" > \
    161177                      ${TMPDIR}/Singular/INSTALL
    162178        cd ${TMPDIR}; chmod -R a+rX *;\
    163            tar cf ${BINDIST_NAME}.tar ${SINGUNAME} Singular; \
     179           tar cf ${BINDIST_NAME}.tar Singular; \
    164180           gzip ${BINDIST_NAME}.tar
    165181        mv ${TMPDIR}/${BINDIST_NAME}.tar.gz .
     
    169185        cd Singular; ${MAKE} Singular-$@ libparse
    170186        rm -rf ${TMPDIR}
    171         ${MKINSTALLDIRS} ${TMPDIR}/${SINGUNAME}/bin/
    172         ${MKINSTALLDIRS} ${TMPDIR}/Singular
    173         cp Singular/Singular-$@ \
    174            ${TMPDIR}/${SINGUNAME}/bin/Singular-${S_VERSION}-static
    175         cd ${TMPDIR}/${SINGUNAME}/bin;  \
    176            ${LN_S} Singular-${S_VERSION}-static Singular
    177         cat INSTALL | sed -e "s/<x-y-z>/${S_VERSION}/g" > \
     187        ${MKINSTALLDIRS} ${TMPDIR}/${BINDIR_NAME}
     188        cp Singular/Singular-$@ ${TMPDIR}/${BINDIR_NAME}/Singular-static
     189        cp Singular/libparse ${TMPDIR}/${BINDIR_NAME}
     190        -strip ${TMPDIR}/${BINDIR_NAME}/*
     191        cat INSTALL.unix | sed -e "s/<x-y-z>/${S_VERSION}/g" > \
    178192                      ${TMPDIR}/Singular/INSTALL
    179193        cd ${TMPDIR}; chmod -R a+rX *;\
    180            tar cf ${BINDIST_NAME}-static.tar ${SINGUNAME} Singular;\
     194           tar cf ${BINDIST_NAME}-static.tar Singular; \
    181195           gzip ${BINDIST_NAME}-static.tar
    182196        mv ${TMPDIR}/${BINDIST_NAME}-static.tar.gz .
     
    197211INFO_PROGRAM    = /bin/info
    198212CYGWIN_DLL      = /bin/cygwin1.dll
    199 WIN_BINDIR      = ${TMPDIR}/Singular/${S_VERSION}
    200213
    201214windist: ${SINGULAR}
    202215        cd Singular; ${MAKE} Singular-bindist libparse
    203216        rm -rf ${TMPDIR}
    204         ${MKINSTALLDIRS} ${WIN_BINDIR}
    205         ${INSTALL} Singular/Singular-bindist ${WIN_BINDIR}/Singular.exe
    206         ${INSTALL} Singular/libparse ${WIN_BINDIR}
    207         ${INSTALL} ${SH_PROGRAM} ${WIN_BINDIR}
    208         ${INSTALL} ${INFO_PROGRAM} ${WIN_BINDIR}
    209         ${INSTALL} ${CYGWIN_DLL} ${WIN_BINDIR}
     217        ${MKINSTALLDIRS} ${TMPDIR}/${BINDIR_NAME}
     218        ${INSTALL} Singular/Singular-bindist \
     219                   ${TMPDIR}/${BINDIR_NAME}/Singular.exe
     220        ${INSTALL} Singular/libparse ${TMPDIR}/${BINDIR_NAME}
     221        ${INSTALL} ${SH_PROGRAM} ${TMPDIR}/${BINDIR_NAME}
     222        ${INSTALL} ${INFO_PROGRAM} ${TMPDIR}/${BINDIR_NAME}
     223        ${INSTALL} ${CYGWIN_DLL} ${TMPDIR}/${BINDIR_NAME}
    210224        cat INSTALL.win | sed -e "s/<x-y-z>/${S_VERSION}/g" > \
    211225                         ${TMPDIR}/Singular/INSTALL
     
    214228        mv ${TMPDIR}/sing.zip Singular-${S_VERSION}-${SINGUNAME}.zip
    215229        rm -rf ${TMPDIR}
    216 
    217230srcdist:
    218231        rm -rf ${TMPDIR}
     
    225238        rm -rf ${TMPDIR}
    226239
    227 rpmdist:
    228         cd rpm; ${MAKE} rpm
    229 
    230240# You can remeber the password with "iwd" == "ich war dabei"
    231241CRYPT   = enigma # it does not seem to decrypt correctly with the HP crypt
  • README.download

    re03e67 rf36635  
    3131    where <uname> is a description of your hardware and
    3232    operating system.
    33     Messages from tar like "Could not create symlink to ..."
    34     can safely be ignored - they appaer only in the case that you install
    35     the same version of Singular twice.
    3633
    3734(2) Unpack them at the same place and follow the instructions
  • Singular/Makefile.in

    re03e67 rf36635  
    253253install: all installbin
    254254
    255 installbin: Singular
     255installbin: Singular libparse
    256256        ${MKINSTALLDIRS} ${bindir}
    257257        ${INSTALL_PROGRAM} Singular ${bindir}/Singular-${SINGULAR_VERSION}
     258        ${INSTALL_PROGRAM} libparse ${bindir}/libparse
     259        chmod a+x ${bindir}/Singular-${SINGULAR_VERSION}
    258260        rm -f ${bindir}/Singular
    259261        cd ${bindir}; ${LN_S} Singular-${SINGULAR_VERSION} Singular;\
  • Singular/libparse.l

    re03e67 rf36635  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: libparse.l,v 1.31 1998-12-02 15:56:05 krueger Exp $ */
     5/* $Id: libparse.l,v 1.32 1999-07-01 12:49:48 obachman Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    5757int yylplineno = 1;
    5858int lpverbose = 0, check = 0;
     59int texinfo_out = 0;
    5960int found_info=0,
    6061    found_version=0,
     
    252253               make_version(yytext,1);
    253254#ifdef STANDALONE_PARSER
    254                printf("Version:%s;\n", libnamebuf);
     255               if (texinfo_out)
     256                 printf("$version = \"%s\";\n", libnamebuf);
     257               else
     258                 printf("Version:%s;\n", libnamebuf);
    255259#else
    256260#  ifdef HAVE_NAMESPACES
     
    814818#endif /* HAVE_NAMESPACES */
    815819{
    816 #  ifndef STANDALONE_PARSER
     820#ifdef STANDALONE_PARSER
     821  if (texinfo_out && last_cmd == LP_INFO)
     822  {
     823    long current_location = ftell(yylpin), i = string_start, quote = 0;
     824    char c;
     825    printf("$info = <<EOT;\n");
     826    fseek (yylpin, i, SEEK_SET);
     827    while (i< current_location)
     828    {
     829      c = fgetc(yylpin);
     830      if (c == '\\')
     831      {
     832        quote = (! quote);
     833      }
     834      else if (c == '"')
     835      {
     836        if (! quote) break;
     837      }
     838      else
     839        quote = 0;
     840      if (c == '@' || c == '$') putchar('\\');
     841      if (c != '\r') putchar(c);
     842      i++;
     843    }
     844    fseek (yylpin, current_location, SEEK_SET);
     845    printf("\nEOT\n");
     846  }
     847#else
    817848  if((last_cmd == LP_INFO)&&(mode == GET_INFO))
    818849  {
     
    849880#    endif /* HAVE_NAMESPACES */
    850881  }
    851 #  endif /* STANDALONE_PARSER */
     882#endif /* STANDALONE_PARSER */
    852883}
    853884
     
    876907  main_init(argc, argv);
    877908  if(yyin == NULL) {
    878     printf("No library found to parse.\n");
     909    fprintf(stderr, "No library found to parse.\n");
    879910    exit(1);
    880911  }
    881 
    882   if(lpverbose)printf("Verbose level=%d\n", lpverbose);
    883   if(check)printf("Reporting most possible annomalies.\n");
    884   if(lpverbose||check)printf("\n");
    885 
    886   printf( "  %-15s  %20s      %s,%s    %s,%s     %s,%s\n", "Library",
    887           "function", "line", "start-eod", "line", "body-eob",
    888           "line", "example-eoe");
     912  if (! texinfo_out)
     913  {
     914    if(lpverbose)printf("Verbose level=%d\n", lpverbose);
     915    if(check)printf("Reporting most possible annomalies.\n");
     916    if(lpverbose||check)printf("\n");
     917
     918    printf( "  %-15s  %20s      %s,%s    %s,%s     %s,%s\n", "Library",
     919            "function", "line", "start-eod", "line", "body-eob",
     920            "line", "example-eoe");
     921  }
    889922  yylplex(argv[0], argv[0], &lib_style);
    890   if(yylp_errno)
    891   {
     923  if(yylp_errno) {
    892924    printf("ERROR occured: [%d] ", yylp_errno);
    893925    printf(yylp_errlist[yylp_errno], yylplineno);
     
    895927  }
    896928  else if(pi!=NULL) printpi(pi);
    897   main_result(argv[0]);
     929  if (texinfo_out)
     930    printf("1;");
     931  exit(0);
    898932}
    899933
  • Singular/utils.cc

    re03e67 rf36635  
    1414extern int optind, opterr, optopt;
    1515extern int lpverbose, check;
     16extern int texinfo_out;
    1617extern int found_version, found_info, found_oldhelp, found_proc_in_proc;
    1718int warning_info = 0, warning_version = 0;
     
    2526  printf("   -d [digit]            : digit=1,..,4 increases the verbosity of the checks\n");
    2627  printf("   -s                    : turns on reporting about violations of unenforced syntax rules\n");
     28  printf("   -i                    : perl output of examples and help of procs\n");
    2729  printf("   -h                    : print this message\n");
    2830  exit(1);
    2931}
     32 
     33static char* lib_file = NULL;
    3034
    3135/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
    3236void main_init(int argc, char *argv[])
    3337{
    34   char c, *file=NULL;
    35 
    36   while((c=getopt(argc, argv, "hd:sf:"))>=0) {
     38  char c;
     39
     40  while((c=getopt(argc, argv, "ihd:sf:"))>=0) {
    3741    switch(c) {
    3842        case 'd':
     
    4145          else optind--;
    4246          break;
    43         case 'f': file = argv[optind-1];
     47        case 'f': lib_file = argv[optind-1];
    4448          break;
    4549        case 's':
    4650          check++;
    4751          break;
     52        case 'i':
     53          texinfo_out = 1;
     54          break;
    4855        case 'h' :
    4956          usage(argv[0]);
    5057          break;
     58         
    5159        case -1 : printf("no such option:%s\n", argv[optind]);
    5260          usage(argv[0]);
     
    5664    }
    5765  }
    58   if(file!=NULL) {
    59     yylpin = fopen( file, "rb" );
    60     printf("Checking library '%s'\n", file);
     66  if (texinfo_out) lpverbose = 0;
     67   
     68  if(lib_file!=NULL) {
     69    yylpin = fopen( lib_file, "rb" );
     70    if (! texinfo_out)
     71      printf("Checking library '%s'\n", lib_file);
     72    else
     73      printf("$library = \"%s\";\n", lib_file);
    6174  } else {
    6275    while(argc>optind && yylpin==NULL) {
    6376      yylpin = fopen( argv[optind], "rb" );
    64       if(yylpin!=NULL) printf("Checking library '%s'\n", argv[optind]);
     77      if(yylpin!=NULL)
     78      {
     79        lib_file = argv[optind];
     80        if (! texinfo_out)
     81          printf("Checking library '%s'\n", argv[optind]);
     82        else
     83          printf("$library = \"%s\";\n", lib_file);
     84      }
    6585      else optind++;
    6686    }
     
    120140
    121141/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
     142
     143#ifndef SEEK_SET
     144#define SEEK_SET 0
     145#endif
     146
     147static void PrintOut(FILE *fd, int pos_start, int pos_end)
     148{
     149  if (pos_start <= 0 || pos_end - pos_start <= 4) return;
     150  char c;
     151 
     152  fseek(fd, pos_start, SEEK_SET);
     153  while (pos_start++ <= pos_end)
     154  {
     155    c = fgetc(fd);
     156    if (c == '@' || c == '$') putchar('\\');
     157    if (c != '\r') putchar(c);
     158  }
     159}
     160
     161
    122162printpi(procinfov pi)
    123163{
    124   FILE *fp = fopen( pi->libname, "rb");
    125164  char *buf, name[256];
    126165  int len1, len2;
     166  /* pi->libname is badly broken -- use file, instead */
     167  FILE *fp = fopen( lib_file, "rb");
     168
     169  if (fp == NULL)
     170  {
     171    printf("Can not open %s\n", lib_file);
     172    return 0;
     173  }
    127174
    128175  if(!found_info && !warning_info) warning_info++;
     
    131178    pi->data.s.body_end = pi->data.s.proc_end;
    132179
    133   if(lpverbose) printf("//     ");
    134   printf( "%c %-15s  %20s ", pi->is_static ? 'l' : 'g', pi->libname,
    135           pi->procname);
    136   printf("line %4d,%5ld-%-5ld  %4d,%5ld-%-5ld  %4d,%5ld-%-5ld\n",
    137          pi->data.s.proc_lineno, pi->data.s.proc_start, pi->data.s.def_end,
    138          pi->data.s.body_lineno, pi->data.s.body_start, pi->data.s.body_end,
    139          pi->data.s.example_lineno, pi->data.s.example_start,
    140          pi->data.s.proc_end);
    141   if(check) {
    142     if(!pi->is_static && (pi->data.s.body_start-pi->data.s.def_end)<4)
    143       printf("*** Procedure '%s' is global and has no help-section.\n",
    144              pi->procname);
    145     if(!pi->is_static && !pi->data.s.example_start)
    146       printf("*** Procedure '%s' is global and has no example-section.\n",\
    147              pi->procname);
    148     if(found_proc_in_proc)
    149       printf("*** found proc within procedure '%s'.\n", pi->procname);
    150   }
     180  if (texinfo_out)
     181  {
     182    if ((! pi->is_static) &&
     183        (pi->data.s.body_start - pi->data.s.def_end > 10) &&
     184        (pi->data.s.example_start > 0) &&
     185        (pi->data.s.proc_end - pi->data.s.example_start > 10) &&
     186        (! found_proc_in_proc))
     187    {
     188      printf("push(@procs, \"%s\");\n", pi->procname);
     189      printf("$help{\"%s\"} = <<EOT;\n", pi->procname);
     190      PrintOut(fp, pi->data.s.help_start, pi->data.s.body_start-3);
     191      printf("\nEOT\n$example{\"%s\"} = <<EOT;\n", pi->procname);
     192      PrintOut(fp, pi->data.s.example_start, pi->data.s.proc_end);
     193      printf("\nEOT\n");
     194    }
     195  }
     196  else
     197  {
     198    if(lpverbose) printf("//     ");
     199    printf( "%c %-15s  %20s ", pi->is_static ? 'l' : 'g', pi->libname,
     200            pi->procname);
     201    printf("line %4d,%5ld-%-5ld  %4d,%5ld-%-5ld  %4d,%5ld-%-5ld\n",
     202           pi->data.s.proc_lineno, pi->data.s.proc_start, pi->data.s.def_end,
     203           pi->data.s.body_lineno, pi->data.s.body_start, pi->data.s.body_end,
     204           pi->data.s.example_lineno, pi->data.s.example_start,
     205           pi->data.s.proc_end);
     206    if(check) {
     207      if(!pi->is_static && (pi->data.s.body_start-pi->data.s.def_end)<4)
     208        printf("*** Procedure '%s' is global and has no help-section.\n",
     209               pi->procname);
     210      if(!pi->is_static && !pi->data.s.example_start)
     211        printf("*** Procedure '%s' is global and has no example-section.\n",\
     212               pi->procname);
     213      if(found_proc_in_proc)
     214        printf("*** found proc within procedure '%s'.\n", pi->procname);
     215    }
     216  }
     217 
    151218
    152219#if 0
  • configure

    re03e67 rf36635  
    22
    33# Guess values for system-dependent variables and create Makefiles.
    4 # Generated automatically using autoconf version 2.12
     4# Generated automatically using autoconf version 2.13
    55# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
    66#
     
    1313# Any additions from configure.in:
    1414ac_default_prefix=`pwd`
     15ac_help="$ac_help
     16\
     17  --with-tmpdir=DIR       use DIR as temporary directory"
    1518ac_help="$ac_help
    1619\
     
    3740\
    3841     Singular             CAS for Polynomial Computations"
     42ac_help="$ac_help
     43\
     44     Texinfo              Texinfo for info, texi2dvi, makeinfo"
    3945ac_help="$ac_help
    4046\
     
    94100subdirs=
    95101MFLAGS= MAKEFLAGS=
     102SHELL=${CONFIG_SHELL-/bin/sh}
    96103# Maximum number of lines to put in a shell here document.
    97104ac_max_here_lines=12
     
    377384
    378385  -version | --version | --versio | --versi | --vers)
    379     echo "configure generated by autoconf version 2.12"
     386    echo "configure generated by autoconf version 2.13"
    380387    exit 0 ;;
    381388
     
    547554ac_cpp='$CPP $CPPFLAGS'
    548555ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
    549 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
     556ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
    550557cross_compiling=$ac_cv_prog_cc_cross
    551558
     559ac_exeext=
     560ac_objext=o
    552561if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
    553562  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
     
    564573
    565574
    566 OUTPUT_MAKEFILES="Makefile doc/Makefile"
     575OUTPUT_MAKEFILES="Makefile doc/Makefile doc/version.texi"
    567576if test -d "mpr"; then
    568577   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" mpr/Makefile"
     
    580589
    581590echo $ac_n "checking uname for singular""... $ac_c" 1>&6
    582 echo "configure:583: checking uname for singular" >&5
     591echo "configure:592: checking uname for singular" >&5
    583592if eval "test \"`echo '$''{'ac_cv_singuname'+set}'`\" = set"; then
    584593  echo $ac_n "(cached) $ac_c" 1>&6
     
    608617SINGULAR_MINOR_VERSION=3
    609618SINGULAR_SUB_VERSION=3
    610 SINGULAR_VERSION="${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}"
    611 VERSION_DATE="May 1999"
    612 SINGULAR_DOS_VERSION="${SINGULAR_MAJOR_VERSION}-${SINGULAR_MINOR_VERSION}-${SINGULAR_SUB_VERSION}"
     619SINGULAR_SHORT_VERSION="${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}"
     620SINGULAR_VERSION="${SINGULAR_SHORT_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}"
     621VERSION_DATE="February 1999"
     622
    613623export SINGULAR_MINOR_VERSION
    614624export SINGULAR_MAJOR_VERSION
     
    620630
    621631
     632
    622633# Extract the first word of "gcc", so it can be a program name with args.
    623634set dummy gcc; ac_word=$2
    624635echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    625 echo "configure:626: checking for $ac_word" >&5
     636echo "configure:637: checking for $ac_word" >&5
    626637if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    627638  echo $ac_n "(cached) $ac_c" 1>&6
     
    630641  ac_cv_prog_CC="$CC" # Let the user override the test.
    631642else
    632   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    633   for ac_dir in $PATH; do
     643  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
     644  ac_dummy="$PATH"
     645  for ac_dir in $ac_dummy; do
    634646    test -z "$ac_dir" && ac_dir=.
    635647    if test -f $ac_dir/$ac_word; then
     
    652664set dummy cc; ac_word=$2
    653665echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    654 echo "configure:655: checking for $ac_word" >&5
     666echo "configure:667: checking for $ac_word" >&5
    655667if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    656668  echo $ac_n "(cached) $ac_c" 1>&6
     
    659671  ac_cv_prog_CC="$CC" # Let the user override the test.
    660672else
    661   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
     673  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
    662674  ac_prog_rejected=no
    663   for ac_dir in $PATH; do
     675  ac_dummy="$PATH"
     676  for ac_dir in $ac_dummy; do
    664677    test -z "$ac_dir" && ac_dir=.
    665678    if test -f $ac_dir/$ac_word; then
     
    696709fi
    697710
     711  if test -z "$CC"; then
     712    case "`uname -s`" in
     713    *win32* | *WIN32*)
     714      # Extract the first word of "cl", so it can be a program name with args.
     715set dummy cl; ac_word=$2
     716echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
     717echo "configure:718: checking for $ac_word" >&5
     718if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
     719  echo $ac_n "(cached) $ac_c" 1>&6
     720else
     721  if test -n "$CC"; then
     722  ac_cv_prog_CC="$CC" # Let the user override the test.
     723else
     724  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
     725  ac_dummy="$PATH"
     726  for ac_dir in $ac_dummy; do
     727    test -z "$ac_dir" && ac_dir=.
     728    if test -f $ac_dir/$ac_word; then
     729      ac_cv_prog_CC="cl"
     730      break
     731    fi
     732  done
     733  IFS="$ac_save_ifs"
     734fi
     735fi
     736CC="$ac_cv_prog_CC"
     737if test -n "$CC"; then
     738  echo "$ac_t""$CC" 1>&6
     739else
     740  echo "$ac_t""no" 1>&6
     741fi
     742 ;;
     743    esac
     744  fi
    698745  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
    699746fi
    700747
    701748echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
    702 echo "configure:703: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
     749echo "configure:750: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
    703750
    704751ac_ext=c
     
    706753ac_cpp='$CPP $CPPFLAGS'
    707754ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
    708 ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
     755ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
    709756cross_compiling=$ac_cv_prog_cc_cross
    710757
    711 cat > conftest.$ac_ext <<EOF
    712 #line 713 "configure"
     758cat > conftest.$ac_ext << EOF
     759
     760#line 761 "configure"
    713761#include "confdefs.h"
     762
    714763main(){return(0);}
    715764EOF
    716 if { (eval echo configure:717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     765if { (eval echo configure:766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    717766  ac_cv_prog_cc_works=yes
    718767  # If we can't run a trivial program, we are probably using a cross compiler.
     
    728777fi
    729778rm -fr conftest*
     779ac_ext=c
     780# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
     781ac_cpp='$CPP $CPPFLAGS'
     782ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
     783ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
     784cross_compiling=$ac_cv_prog_cc_cross
    730785
    731786echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
     
    734789fi
    735790echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
    736 echo "configure:737: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
     791echo "configure:792: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
    737792echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
    738793cross_compiling=$ac_cv_prog_cc_cross
    739794
    740795echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
    741 echo "configure:742: checking whether we are using GNU C" >&5
     796echo "configure:797: checking whether we are using GNU C" >&5
    742797if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
    743798  echo $ac_n "(cached) $ac_c" 1>&6
     
    748803#endif
    749804EOF
    750 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
     805if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
    751806  ac_cv_prog_gcc=yes
    752807else
     
    759814if test $ac_cv_prog_gcc = yes; then
    760815  GCC=yes
    761   ac_test_CFLAGS="${CFLAGS+set}"
    762   ac_save_CFLAGS="$CFLAGS"
    763   CFLAGS=
    764   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
    765 echo "configure:766: checking whether ${CC-cc} accepts -g" >&5
     816else
     817  GCC=
     818fi
     819
     820ac_test_CFLAGS="${CFLAGS+set}"
     821ac_save_CFLAGS="$CFLAGS"
     822CFLAGS=
     823echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
     824echo "configure:825: checking whether ${CC-cc} accepts -g" >&5
    766825if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
    767826  echo $ac_n "(cached) $ac_c" 1>&6
     
    778837
    779838echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
    780   if test "$ac_test_CFLAGS" = set; then
    781     CFLAGS="$ac_save_CFLAGS"
    782   elif test $ac_cv_prog_cc_g = yes; then
     839if test "$ac_test_CFLAGS" = set; then
     840  CFLAGS="$ac_save_CFLAGS"
     841elif test $ac_cv_prog_cc_g = yes; then
     842  if test "$GCC" = yes; then
    783843    CFLAGS="-g -O2"
    784844  else
     845    CFLAGS="-g"
     846  fi
     847else
     848  if test "$GCC" = yes; then
    785849    CFLAGS="-O2"
    786   fi
    787 else
    788   GCC=
    789   test "${CFLAGS+set}" = set || CFLAGS="-g"
     850  else
     851    CFLAGS=
     852  fi
    790853fi
    791854
    792855echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
    793 echo "configure:794: checking how to run the C preprocessor" >&5
     856echo "configure:857: checking how to run the C preprocessor" >&5
    794857# On Suns, sometimes $CPP names a directory.
    795858if test -n "$CPP" && test -d "$CPP"; then
     
    806869  # not just through cpp.
    807870  cat > conftest.$ac_ext <<EOF
    808 #line 809 "configure"
     871#line 872 "configure"
    809872#include "confdefs.h"
    810873#include <assert.h>
     
    812875EOF
    813876ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    814 { (eval echo configure:815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    815 ac_err=`grep -v '^ *+' conftest.out`
     877{ (eval echo configure:878: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     878ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    816879if test -z "$ac_err"; then
    817880  :
     
    823886  CPP="${CC-cc} -E -traditional-cpp"
    824887  cat > conftest.$ac_ext <<EOF
    825 #line 826 "configure"
     888#line 889 "configure"
    826889#include "confdefs.h"
    827890#include <assert.h>
     
    829892EOF
    830893ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    831 { (eval echo configure:832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    832 ac_err=`grep -v '^ *+' conftest.out`
     894{ (eval echo configure:895: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     895ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    833896if test -z "$ac_err"; then
    834897  :
     
    838901  cat conftest.$ac_ext >&5
    839902  rm -rf conftest*
     903  CPP="${CC-cc} -nologo -E"
     904  cat > conftest.$ac_ext <<EOF
     905#line 906 "configure"
     906#include "confdefs.h"
     907#include <assert.h>
     908Syntax Error
     909EOF
     910ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
     911{ (eval echo configure:912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     912ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
     913if test -z "$ac_err"; then
     914  :
     915else
     916  echo "$ac_err" >&5
     917  echo "configure: failed program was:" >&5
     918  cat conftest.$ac_ext >&5
     919  rm -rf conftest*
    840920  CPP=/lib/cpp
     921fi
     922rm -f conftest*
    841923fi
    842924rm -f conftest*
     
    852934
    853935echo $ac_n "checking for AIX""... $ac_c" 1>&6
    854 echo "configure:855: checking for AIX" >&5
     936echo "configure:937: checking for AIX" >&5
    855937cat > conftest.$ac_ext <<EOF
    856 #line 857 "configure"
     938#line 939 "configure"
    857939#include "confdefs.h"
    858940#ifdef _AIX
     
    881963set dummy $ac_prog; ac_word=$2
    882964echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    883 echo "configure:884: checking for $ac_word" >&5
     965echo "configure:966: checking for $ac_word" >&5
    884966if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
    885967  echo $ac_n "(cached) $ac_c" 1>&6
     
    888970  ac_cv_prog_PERL="$PERL" # Let the user override the test.
    889971else
    890   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
    891   for ac_dir in $PATH; do
     972  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
     973  ac_dummy="$PATH"
     974  for ac_dir in $ac_dummy; do
    892975    test -z "$ac_dir" && ac_dir=.
    893976    if test -f $ac_dir/$ac_word; then
     
    909992done
    910993
     994# Extract the first word of "latex2html", so it can be a program name with args.
     995set dummy latex2html; ac_word=$2
     996echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
     997echo "configure:998: checking for $ac_word" >&5
     998if eval "test \"`echo '$''{'ac_cv_prog_LATEX2HTML'+set}'`\" = set"; then
     999  echo $ac_n "(cached) $ac_c" 1>&6
     1000else
     1001  if test -n "$LATEX2HTML"; then
     1002  ac_cv_prog_LATEX2HTML="$LATEX2HTML" # Let the user override the test.
     1003else
     1004  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
     1005  ac_dummy="$PATH"
     1006  for ac_dir in $ac_dummy; do
     1007    test -z "$ac_dir" && ac_dir=.
     1008    if test -f $ac_dir/$ac_word; then
     1009      ac_cv_prog_LATEX2HTML="latex2html"
     1010      break
     1011    fi
     1012  done
     1013  IFS="$ac_save_ifs"
     1014fi
     1015fi
     1016LATEX2HTML="$ac_cv_prog_LATEX2HTML"
     1017if test -n "$LATEX2HTML"; then
     1018  echo "$ac_t""$LATEX2HTML" 1>&6
     1019else
     1020  echo "$ac_t""no" 1>&6
     1021fi
     1022
    9111023echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
    912 echo "configure:913: checking whether ln -s works" >&5
     1024echo "configure:1025: checking whether ln -s works" >&5
    9131025if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
    9141026  echo $ac_n "(cached) $ac_c" 1>&6
     
    9301042fi
    9311043
     1044if test -x Texi2html/texi2html; then
     1045TEXI2HTML=`pwd`/Texi2html/texi2html
     1046
     1047else
     1048echo "configure: warning: could not find Texi2html/texi2html HTML generation might fail" 1>&2
     1049# Extract the first word of "texi2html", so it can be a program name with args.
     1050set dummy texi2html; ac_word=$2
     1051echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
     1052echo "configure:1053: checking for $ac_word" >&5
     1053if eval "test \"`echo '$''{'ac_cv_prog_TEXI2HTML'+set}'`\" = set"; then
     1054  echo $ac_n "(cached) $ac_c" 1>&6
     1055else
     1056  if test -n "$TEXI2HTML"; then
     1057  ac_cv_prog_TEXI2HTML="$TEXI2HTML" # Let the user override the test.
     1058else
     1059  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
     1060  ac_dummy="$PATH"
     1061  for ac_dir in $ac_dummy; do
     1062    test -z "$ac_dir" && ac_dir=.
     1063    if test -f $ac_dir/$ac_word; then
     1064      ac_cv_prog_TEXI2HTML="texi2html"
     1065      break
     1066    fi
     1067  done
     1068  IFS="$ac_save_ifs"
     1069fi
     1070fi
     1071TEXI2HTML="$ac_cv_prog_TEXI2HTML"
     1072if test -n "$TEXI2HTML"; then
     1073  echo "$ac_t""$TEXI2HTML" 1>&6
     1074else
     1075  echo "$ac_t""no" 1>&6
     1076fi
     1077
     1078fi
     1079if test "$ac_cv_prog_LATEX2HTML" = latex2html; then
     1080  TEXI2HTML_OPTS="-l2h"
     1081else
     1082 TEXI2HTML_OPTS="-expandinfo"
     1083fi
     1084
    9321085
    9331086# expand prefix and pass it to subsequent configures
     
    9731126# check for AIX
    9741127echo $ac_n "checking whether _AIX is defined""... $ac_c" 1>&6
    975 echo "configure:976: checking whether _AIX is defined" >&5
     1128echo "configure:1129: checking whether _AIX is defined" >&5
    9761129if eval "test \"`echo '$''{'ac_cv_is_aix'+set}'`\" = set"; then
    9771130  echo $ac_n "(cached) $ac_c" 1>&6
    9781131else
    9791132  cat > conftest.$ac_ext <<EOF
    980 #line 981 "configure"
     1133#line 1134 "configure"
    9811134#include "confdefs.h"
    9821135#ifdef _AIX
     
    10041157
    10051158echo $ac_n "checking for atof in -lm""... $ac_c" 1>&6
    1006 echo "configure:1007: checking for atof in -lm" >&5
     1159echo "configure:1160: checking for atof in -lm" >&5
    10071160ac_lib_var=`echo m'_'atof | sed 'y%./+-%__p_%'`
    10081161if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    10121165LIBS="-lm  $LIBS"
    10131166cat > conftest.$ac_ext <<EOF
    1014 #line 1015 "configure"
     1167#line 1168 "configure"
    10151168#include "confdefs.h"
    10161169/* Override any gcc2 internal prototype to avoid an error.  */
     
    10231176; return 0; }
    10241177EOF
    1025 if { (eval echo configure:1026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1178if { (eval echo configure:1179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    10261179  rm -rf conftest*
    10271180  eval "ac_cv_lib_$ac_lib_var=yes"
     
    10511204
    10521205echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6
    1053 echo "configure:1054: checking for socket in -lbsd" >&5
     1206echo "configure:1207: checking for socket in -lbsd" >&5
    10541207ac_lib_var=`echo bsd'_'socket | sed 'y%./+-%__p_%'`
    10551208if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    10591212LIBS="-lbsd  $LIBS"
    10601213cat > conftest.$ac_ext <<EOF
    1061 #line 1062 "configure"
     1214#line 1215 "configure"
    10621215#include "confdefs.h"
    10631216/* Override any gcc2 internal prototype to avoid an error.  */
     
    10701223; return 0; }
    10711224EOF
    1072 if { (eval echo configure:1073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1225if { (eval echo configure:1226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    10731226  rm -rf conftest*
    10741227  eval "ac_cv_lib_$ac_lib_var=yes"
     
    10981251
    10991252echo $ac_n "checking for listen in -lsocket""... $ac_c" 1>&6
    1100 echo "configure:1101: checking for listen in -lsocket" >&5
     1253echo "configure:1254: checking for listen in -lsocket" >&5
    11011254ac_lib_var=`echo socket'_'listen | sed 'y%./+-%__p_%'`
    11021255if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    11061259LIBS="-lsocket  $LIBS"
    11071260cat > conftest.$ac_ext <<EOF
    1108 #line 1109 "configure"
     1261#line 1262 "configure"
    11091262#include "confdefs.h"
    11101263/* Override any gcc2 internal prototype to avoid an error.  */
     
    11171270; return 0; }
    11181271EOF
    1119 if { (eval echo configure:1120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1272if { (eval echo configure:1273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    11201273  rm -rf conftest*
    11211274  eval "ac_cv_lib_$ac_lib_var=yes"
     
    11451298
    11461299echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
    1147 echo "configure:1148: checking for gethostbyname in -lnsl" >&5
     1300echo "configure:1301: checking for gethostbyname in -lnsl" >&5
    11481301ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
    11491302if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    11531306LIBS="-lnsl  $LIBS"
    11541307cat > conftest.$ac_ext <<EOF
    1155 #line 1156 "configure"
     1308#line 1309 "configure"
    11561309#include "confdefs.h"
    11571310/* Override any gcc2 internal prototype to avoid an error.  */
     
    11641317; return 0; }
    11651318EOF
    1166 if { (eval echo configure:1167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1319if { (eval echo configure:1320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    11671320  rm -rf conftest*
    11681321  eval "ac_cv_lib_$ac_lib_var=yes"
     
    11921345
    11931346echo $ac_n "checking for mpq_init in -lgmp""... $ac_c" 1>&6
    1194 echo "configure:1195: checking for mpq_init in -lgmp" >&5
     1347echo "configure:1348: checking for mpq_init in -lgmp" >&5
    11951348ac_lib_var=`echo gmp'_'mpq_init | sed 'y%./+-%__p_%'`
    11961349if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    12001353LIBS="-lgmp  $LIBS"
    12011354cat > conftest.$ac_ext <<EOF
    1202 #line 1203 "configure"
     1355#line 1356 "configure"
    12031356#include "confdefs.h"
    12041357/* Override any gcc2 internal prototype to avoid an error.  */
     
    12111364; return 0; }
    12121365EOF
    1213 if { (eval echo configure:1214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1366if { (eval echo configure:1367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    12141367  rm -rf conftest*
    12151368  eval "ac_cv_lib_$ac_lib_var=yes"
     
    12391392
    12401393echo $ac_n "checking for mpz_init in -lsmallgmp""... $ac_c" 1>&6
    1241 echo "configure:1242: checking for mpz_init in -lsmallgmp" >&5
     1394echo "configure:1395: checking for mpz_init in -lsmallgmp" >&5
    12421395ac_lib_var=`echo smallgmp'_'mpz_init | sed 'y%./+-%__p_%'`
    12431396if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    12471400LIBS="-lsmallgmp  $LIBS"
    12481401cat > conftest.$ac_ext <<EOF
    1249 #line 1250 "configure"
     1402#line 1403 "configure"
    12501403#include "confdefs.h"
    12511404/* Override any gcc2 internal prototype to avoid an error.  */
     
    12581411; return 0; }
    12591412EOF
    1260 if { (eval echo configure:1261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1413if { (eval echo configure:1414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    12611414  rm -rf conftest*
    12621415  eval "ac_cv_lib_$ac_lib_var=yes"
     
    12861439
    12871440echo $ac_n "checking for IMP_PutGmpInt in -lMP""... $ac_c" 1>&6
    1288 echo "configure:1289: checking for IMP_PutGmpInt in -lMP" >&5
     1441echo "configure:1442: checking for IMP_PutGmpInt in -lMP" >&5
    12891442ac_lib_var=`echo MP'_'IMP_PutGmpInt | sed 'y%./+-%__p_%'`
    12901443if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    12941447LIBS="-lMP  $LIBS"
    12951448cat > conftest.$ac_ext <<EOF
    1296 #line 1297 "configure"
     1449#line 1450 "configure"
    12971450#include "confdefs.h"
    12981451/* Override any gcc2 internal prototype to avoid an error.  */
     
    13051458; return 0; }
    13061459EOF
    1307 if { (eval echo configure:1308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1460if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    13081461  rm -rf conftest*
    13091462  eval "ac_cv_lib_$ac_lib_var=yes"
     
    13331486
    13341487echo $ac_n "checking for MPT_GetTree in -lMPT""... $ac_c" 1>&6
    1335 echo "configure:1336: checking for MPT_GetTree in -lMPT" >&5
     1488echo "configure:1489: checking for MPT_GetTree in -lMPT" >&5
    13361489ac_lib_var=`echo MPT'_'MPT_GetTree | sed 'y%./+-%__p_%'`
    13371490if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    13411494LIBS="-lMPT  $LIBS"
    13421495cat > conftest.$ac_ext <<EOF
    1343 #line 1344 "configure"
     1496#line 1497 "configure"
    13441497#include "confdefs.h"
    13451498/* Override any gcc2 internal prototype to avoid an error.  */
     
    13521505; return 0; }
    13531506EOF
    1354 if { (eval echo configure:1355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1507if { (eval echo configure:1508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    13551508  rm -rf conftest*
    13561509  eval "ac_cv_lib_$ac_lib_var=yes"
     
    13801533
    13811534echo $ac_n "checking for atof in -lsingcf""... $ac_c" 1>&6
    1382 echo "configure:1383: checking for atof in -lsingcf" >&5
     1535echo "configure:1536: checking for atof in -lsingcf" >&5
    13831536ac_lib_var=`echo singcf'_'atof | sed 'y%./+-%__p_%'`
    13841537if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    13881541LIBS="-lsingcf  $LIBS"
    13891542cat > conftest.$ac_ext <<EOF
    1390 #line 1391 "configure"
     1543#line 1544 "configure"
    13911544#include "confdefs.h"
    13921545/* Override any gcc2 internal prototype to avoid an error.  */
     
    13991552; return 0; }
    14001553EOF
    1401 if { (eval echo configure:1402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1554if { (eval echo configure:1555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    14021555  rm -rf conftest*
    14031556  eval "ac_cv_lib_$ac_lib_var=yes"
     
    14271580
    14281581echo $ac_n "checking for atof in -lsingfac""... $ac_c" 1>&6
    1429 echo "configure:1430: checking for atof in -lsingfac" >&5
     1582echo "configure:1583: checking for atof in -lsingfac" >&5
    14301583ac_lib_var=`echo singfac'_'atof | sed 'y%./+-%__p_%'`
    14311584if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    14351588LIBS="-lsingfac  $LIBS"
    14361589cat > conftest.$ac_ext <<EOF
    1437 #line 1438 "configure"
     1590#line 1591 "configure"
    14381591#include "confdefs.h"
    14391592/* Override any gcc2 internal prototype to avoid an error.  */
     
    14461599; return 0; }
    14471600EOF
    1448 if { (eval echo configure:1449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1601if { (eval echo configure:1602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    14491602  rm -rf conftest*
    14501603  eval "ac_cv_lib_$ac_lib_var=yes"
     
    14781631ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    14791632echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    1480 echo "configure:1481: checking for $ac_hdr" >&5
     1633echo "configure:1634: checking for $ac_hdr" >&5
    14811634if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    14821635  echo $ac_n "(cached) $ac_c" 1>&6
    14831636else
    14841637  cat > conftest.$ac_ext <<EOF
    1485 #line 1486 "configure"
     1638#line 1639 "configure"
    14861639#include "confdefs.h"
    14871640#include <$ac_hdr>
    14881641EOF
    14891642ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1490 { (eval echo configure:1491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    1491 ac_err=`grep -v '^ *+' conftest.out`
     1643{ (eval echo configure:1644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1644ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    14921645if test -z "$ac_err"; then
    14931646  rm -rf conftest*
     
    15441697
    15451698 
     1699# Check whether --with-tmpdir or --without-tmpdir was given.
     1700if test "${with_tmpdir+set}" = set; then
     1701  withval="$with_tmpdir"
     1702  :
     1703fi
     1704
    15461705# Check whether --enable-smallgmp or --disable-smallgmp was given.
    15471706if test "${enable_smallgmp+set}" = set; then
     
    15861745fi
    15871746
     1747# Check whether --enable-Texinfo or --disable-Texinfo was given.
     1748if test "${enable_Texinfo+set}" = set; then
     1749  enableval="$enable_Texinfo"
     1750  :
     1751fi
     1752
    15881753
    15891754# Check whether --with-MP or --without-MP was given.
     
    16121777
    16131778
     1779echo $ac_n "checking which tmp dir to use""... $ac_c" 1>&6
     1780echo "configure:1781: checking which tmp dir to use" >&5
     1781if test "${with_tmpdir+set}" = set && test -d ${with_tmpdir}; then
     1782  if (echo "${with_tmpdir}" | egrep "\." >/dev/null 2>&1)
     1783  then
     1784    TMP_DIR="/tmp"
     1785  else
     1786    TMP_DIR=${with_tmpdir}
     1787  fi
     1788else
     1789  TMP_DIR="/tmp"
     1790fi
     1791echo "$ac_t""$TMP_DIR" 1>&6
     1792
     1793
     1794echo $ac_n "checking whether to configure and build texinfo""... $ac_c" 1>&6
     1795echo "configure:1796: checking whether to configure and build texinfo" >&5
     1796if test "$enable_texinfo" != no && test -d Texinfo; then
     1797  echo "$ac_t""yes" 1>&6
     1798  enable_texinfo=yes
     1799  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texinfo"
     1800  TEXI2DVI=${bindir}/texi2dvi
     1801  MAKEINFO="${bindir}/makeinfo --force"
     1802  TEXINDEX=${bindir}/texindex
     1803else
     1804  echo "$ac_t""no" 1>&6
     1805  echo "configure: warning: Building of doc might fail. Need Texinfo" 1>&2
     1806  enable_texinfo=no
     1807  TEXI2DVI=texi2dvi
     1808  MAKEINFO=makeinfo
     1809  TEXINDEX=${bindir}/texindex
     1810fi 
     1811
     1812
     1813
     1814
     1815
    16141816echo $ac_n "checking whether to configure and build gmp lib""... $ac_c" 1>&6
    1615 echo "configure:1616: checking whether to configure and build gmp lib" >&5
     1817echo "configure:1818: checking whether to configure and build gmp lib" >&5
    16161818if test "$enable_gmp" != yes && test "$enable_gmp" != no; then
    16171819  if test "$ac_gmp_ok" != yes && test -d gmp; then
     
    16391841
    16401842echo $ac_n "checking whether to configure and build smallgmp lib""... $ac_c" 1>&6
    1641 echo "configure:1642: checking whether to configure and build smallgmp lib" >&5
     1843echo "configure:1844: checking whether to configure and build smallgmp lib" >&5
    16421844if test "$enable_smallgmp" != yes && test "$enable_smallgmp" != no; then
    16431845  if test "$ac_smallgmp_ok" != yes && test "$ac_gmp_ok" != yes && \
     
    16781880
    16791881echo $ac_n "checking whether to configure and build MP lib""... $ac_c" 1>&6
    1680 echo "configure:1681: checking whether to configure and build MP lib" >&5
     1882echo "configure:1883: checking whether to configure and build MP lib" >&5
    16811883if test "$enable_MP" != yes && test "$enable_MP" != no; then
    16821884  if test "$with_MP" != no && test "$ac_MP_ok" != yes && test -d MP && \
     
    17071909 
    17081910echo $ac_n "checking whether to configure and build factory lib""... $ac_c" 1>&6
    1709 echo "configure:1710: checking whether to configure and build factory lib" >&5
     1911echo "configure:1912: checking whether to configure and build factory lib" >&5
    17101912if test "$enable_factory" != yes && test "$enable_factory" != no; then
    17111913  if test "$with_factory" != no && test "$ac_factory_ok" != yes && \
     
    17321934
    17331935echo $ac_n "checking whether to configure and build libfac lib""... $ac_c" 1>&6
    1734 echo "configure:1735: checking whether to configure and build libfac lib" >&5
     1936echo "configure:1937: checking whether to configure and build libfac lib" >&5
    17351937if test "$enable_libfac" != yes && test "$enable_libfac" != no; then
    17361938  if test "$with_libfac" != no && test "$ac_libfac_ok" != yes && \
     
    17621964
    17631965echo $ac_n "checking whether to configure and build sgroup lib""... $ac_c" 1>&6
    1764 echo "configure:1765: checking whether to configure and build sgroup lib" >&5
     1966echo "configure:1967: checking whether to configure and build sgroup lib" >&5
    17651967if test "$enable_sgroup" != yes && test "$enable_sgroup" != no; then
    17661968  if test "$with_sgroup" != no && test "$ac_sgroup_ok" != yes && \
     
    17921994
    17931995echo $ac_n "checking whether to configure and build Singular""... $ac_c" 1>&6
    1794 echo "configure:1795: checking whether to configure and build Singular" >&5
     1996echo "configure:1997: checking whether to configure and build Singular" >&5
    17951997if test "$enable_Singular" != yes && test "$enable_Singular" != no; then
    17961998  if test "$with_Singular" != no && test -d Singular; then
     
    18172019
    18182020echo $ac_n "checking which apint package to use""... $ac_c" 1>&6
    1819 echo "configure:1820: checking which apint package to use" >&5
     2021echo "configure:2022: checking which apint package to use" >&5
    18202022if test "$with_apint" = gmp; then
    18212023  if test "$ac_gmp_ok" = yes || test "$enable_gmp" = yes; then
     
    18412043
    18422044echo $ac_n "checking whether to use with MP""... $ac_c" 1>&6
    1843 echo "configure:1844: checking whether to use with MP" >&5
     2045echo "configure:2046: checking whether to use with MP" >&5
    18442046if test "$with_MP" = yes; then
    18452047  if test "$ac_MP_ok" = yes || test "$enable_MP" = yes; then
     
    18602062
    18612063echo $ac_n "checking whether to use with factory""... $ac_c" 1>&6
    1862 echo "configure:1863: checking whether to use with factory" >&5
     2064echo "configure:2065: checking whether to use with factory" >&5
    18632065if test "$with_factory" = yes; then
    18642066  if test "$ac_factory_ok" = yes || test "$enable_factory" = yes; then
     
    18792081 
    18802082echo $ac_n "checking whether to use with libfac""... $ac_c" 1>&6
    1881 echo "configure:1882: checking whether to use with libfac" >&5
     2083echo "configure:2084: checking whether to use with libfac" >&5
    18822084if test "$with_libfac" = yes; then
    18832085  if test "$ac_libfac_ok" = yes || test "$enable_libfac" = yes; then
     
    18982100
    18992101echo $ac_n "checking whether to use with Singular""... $ac_c" 1>&6
    1900 echo "configure:1901: checking whether to use with Singular" >&5
     2102echo "configure:2103: checking whether to use with Singular" >&5
    19012103if test "$with_Singular" != no && test "$with_Singular" != yes; then
    19022104  if test "$enable_Singular" = yes; then
     
    19502152
    19512153echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
    1952 echo "configure:1953: checking whether ${MAKE-make} sets \${MAKE}" >&5
     2154echo "configure:2155: checking whether ${MAKE-make} sets \${MAKE}" >&5
    19532155set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
    19542156if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
     
    20232225# and sets the high bit in the cache file unless we assign to the vars.
    20242226(set) 2>&1 |
    2025   case `(ac_space=' '; set) 2>&1` in
     2227  case `(ac_space=' '; set | grep ac_space) 2>&1` in
    20262228  *ac_space=\ *)
    20272229    # `set' does not quote correctly, so add quotes (double-quote substitution
     
    21022304    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
    21032305  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
    2104     echo "$CONFIG_STATUS generated by autoconf version 2.12"
     2306    echo "$CONFIG_STATUS generated by autoconf version 2.13"
    21052307    exit 0 ;;
    21062308  -help | --help | --hel | --he | --h)
     
    21212323$ac_vpsub
    21222324$extrasub
     2325s%@SHELL@%$SHELL%g
    21232326s%@CFLAGS@%$CFLAGS%g
    21242327s%@CPPFLAGS@%$CPPFLAGS%g
    21252328s%@CXXFLAGS@%$CXXFLAGS%g
     2329s%@FFLAGS@%$FFLAGS%g
    21262330s%@DEFS@%$DEFS%g
    21272331s%@LDFLAGS@%$LDFLAGS%g
     
    21442348s%@SINGUNAME@%$SINGUNAME%g
    21452349s%@SINGULAR_VERSION@%$SINGULAR_VERSION%g
    2146 s%@SINGULAR_DOS_VERSION@%$SINGULAR_DOS_VERSION%g
     2350s%@VERSION_DATE@%$VERSION_DATE%g
     2351s%@SINGULAR_SHORT_VERSION@%$SINGULAR_SHORT_VERSION%g
    21472352s%@CC@%$CC%g
    21482353s%@CPP@%$CPP%g
    21492354s%@PERL@%$PERL%g
     2355s%@LATEX2HTML@%$LATEX2HTML%g
    21502356s%@LN_S@%$LN_S%g
     2357s%@TEXI2HTML@%$TEXI2HTML%g
     2358s%@TEXI2HTML_OPTS@%$TEXI2HTML_OPTS%g
    21512359s%@SINGULAR@%$SINGULAR%g
     2360s%@TMP_DIR@%$TMP_DIR%g
     2361s%@TEXI2DVI@%$TEXI2DVI%g
     2362s%@MAKEINFO@%$MAKEINFO%g
     2363s%@TEXINDEX@%$TEXINDEX%g
    21522364s%@SET_MAKE@%$SET_MAKE%g
    21532365s%@SUBDIRS@%$SUBDIRS%g
  • configure.in

    re03e67 rf36635  
    22AC_INIT(Singular/matpol.h)
    33AC_PREFIX_DEFAULT(`pwd`)
    4 OUTPUT_MAKEFILES="Makefile doc/Makefile"
     4OUTPUT_MAKEFILES="Makefile doc/Makefile doc/version.texi"
    55if test -d "mpr"; then
    66   OUTPUT_MAKEFILES=$OUTPUT_MAKEFILES" mpr/Makefile"
     
    4747SINGULAR_MINOR_VERSION=3
    4848SINGULAR_SUB_VERSION=3
    49 SINGULAR_VERSION="${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}"
    50 VERSION_DATE="May 1999"
    51 SINGULAR_DOS_VERSION="${SINGULAR_MAJOR_VERSION}-${SINGULAR_MINOR_VERSION}-${SINGULAR_SUB_VERSION}"
     49SINGULAR_SHORT_VERSION="${SINGULAR_MAJOR_VERSION}${VERSION_SEP}${SINGULAR_MINOR_VERSION}"
     50SINGULAR_VERSION="${SINGULAR_SHORT_VERSION}${VERSION_SEP}${SINGULAR_SUB_VERSION}"
     51VERSION_DATE="February 1999"
     52
    5253export SINGULAR_MINOR_VERSION
    5354export SINGULAR_MAJOR_VERSION
     
    5859dnl substitue them into the Makefiles
    5960AC_SUBST(SINGULAR_VERSION)
    60 AC_SUBST(SINGULAR_DOS_VERSION)
     61AC_SUBST(VERSION_DATE)
     62AC_SUBST(SINGULAR_SHORT_VERSION)
    6163
    6264dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
     
    6870
    6971AC_CHECK_PROGS(PERL, perl5 perl)
     72AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html)
    7073AC_PROG_LN_S
     74if test -x Texi2html/texi2html; then
     75TEXI2HTML=`pwd`/Texi2html/texi2html
     76AC_SUBST(TEXI2HTML)
     77else
     78AC_MSG_WARN(could not find Texi2html/texi2html HTML generation might fail)
     79AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html)
     80fi
     81if test "$ac_cv_prog_LATEX2HTML" = latex2html; then
     82  TEXI2HTML_OPTS="-l2h"
     83else
     84 TEXI2HTML_OPTS="-expandinfo"
     85fi
     86AC_SUBST(TEXI2HTML_OPTS)
    7187
    7288dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
     
    179195dnl Check command line arguments
    180196dnl
     197AC_ARG_WITH(tmpdir, \
     198 [ --with-tmpdir=DIR       use DIR as temporary directory])
    181199AC_ARG_ENABLE(smallgmp, \
    182200 [ --enable-PACKAGE        configure and build PACKAGE
     
    196214AC_ARG_ENABLE(Singular, \
    197215 [    Singular             CAS for Polynomial Computations])
     216AC_ARG_ENABLE(Texinfo, \
     217 [    Texinfo              Texinfo for info, texi2dvi, makeinfo])
    198218
    199219AC_ARG_WITH(MP,\
     
    214234
    215235dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
     236dnl Check what to use as tmp dir
     237dnl
     238AC_MSG_CHECKING(which tmp dir to use)
     239if test "${with_tmpdir+set}" = set && test -d ${with_tmpdir}; then
     240  if (echo "${with_tmpdir}" | egrep "\." >/dev/null 2>&1)
     241  then
     242    TMP_DIR="/tmp"
     243  else
     244    TMP_DIR=${with_tmpdir}
     245  fi
     246else
     247  TMP_DIR="/tmp"
     248fi
     249AC_MSG_RESULT($TMP_DIR)
     250AC_SUBST(TMP_DIR)
     251
     252dnl lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
    216253dnl Check whether or not to configure and build various packages
    217254dnl
     255AC_MSG_CHECKING(whether to configure and build texinfo)
     256if test "$enable_texinfo" != no && test -d Texinfo; then
     257  AC_MSG_RESULT(yes)
     258  enable_texinfo=yes
     259  CONFIG_SUBDIRS="$CONFIG_SUBDIRS Texinfo"
     260  TEXI2DVI=${bindir}/texi2dvi
     261  MAKEINFO="${bindir}/makeinfo --force"
     262  TEXINDEX=${bindir}/texindex
     263else
     264  AC_MSG_RESULT(no)
     265  AC_MSG_WARN(Building of doc might fail. Need Texinfo)
     266  enable_texinfo=no
     267  TEXI2DVI=texi2dvi
     268  MAKEINFO=makeinfo
     269  TEXINDEX=${bindir}/texindex
     270fi 
     271AC_SUBST(TEXI2DVI)
     272AC_SUBST(MAKEINFO)
     273AC_SUBST(TEXINDEX)
     274
     275
    218276AC_MSG_CHECKING(whether to configure and build gmp lib)
    219277if test "$enable_gmp" != yes && test "$enable_gmp" != no; then
  • doc/Makefile.in

    re03e67 rf36635  
    1414prefix          = @prefix@
    1515infodir         = ${prefix}/info
     16bindir          = @bindir@
    1617
    1718##
     
    2627
    2728TEX             = tex
    28 MAKEINFO        = makeinfo
    29 TEXI2DVI        = texi2dvi
    30 TEXINDEX        = texindex
     29MAKEINFO        = @MAKEINFO@
     30TEXI2DVI        = @TEXI2DVI@
     31TEXINDEX        = @TEXINDEX@
     32TEXI2HTML       = @TEXI2HTML@
     33LATEX2HTML      = @LATEX2HTML@
    3134DVIPS           = dvips
    3235IMAGES          = contents_motif.gif index_motif.gif \
     
    3639                invisible.xbm bg_left.gif bg_right.gif
    3740
     41# d2t stuff
    3842SINGULAR        = @SINGULAR@
     43LIBPARSE        = ${bindir}/libparse
     44D2T_SUBDIR      = ./d2t_singular
     45DOC2TEX         = ./doc2tex.pl -subdir ${D2T_SUBDIR} -Singular ${SINGULAR} \
     46                        -libparse ${LIBPARSE} -I ../Singular/LIB
     47TMP_DIR         = @TMP_DIR@
     48TEXI2HTML_OPTS  = @TEXI2HTML_OPTS@ -l2h_l2h ${LATEX2HTML} -l2h_tmp ${TMP_DIR}
    3949##
    4050## End configuration dependend stuff
     
    5161                tutor.tex examples.tex start.tex copyright.tex
    5262
     63# prepend bindir to path so that programs from there are taken first
     64export PATH := "${bindir}:${PATH}"
     65
    5366.PHONY: info dvi ps
    5467# default target
     
    6073singular.hlp: ${MANUAL_FILES}
    6174        - ${MAKEINFO} --no-split singular.tex
     75
     76singular_all.hlp: singular_all.tex
     77        - ${MAKEINFO} --no-split singular_all.tex
     78
     79singular_lib.hlp: singular_lib.tex
     80        - ${MAKEINFO} --no-split singular_lib.tex
    6281
    6382# dvi stuff
     
    7392        ${TEX} $<
    7493
     94singular_all.dvi: singular_all.tex
     95        ${TEXI2DVI} singular_all.tex
     96
     97singular_lib.dvi: singular_lib.tex
     98        ${TEXI2DVI} singular_lib.tex
     99
    75100# postscript stuff
    76101ps: singular.ps usercard.ps
     
    83108
    84109# html stuff
    85 html: ${MANUAL_FILES}
    86         test -d html || mkdir html
    87         cd html && ../texi2html -I .. -menu -expandinfo -number -split_node -verbose ../singular.tex
    88         test -d html/images || mkdir html/images
    89         for img in ${IMAGES}; \
    90         do \
    91                 echo uudecode images/$${img}.uu; \
    92                 uudecode images/$${img}.uu; \
    93         done
    94         touch html
     110html: html/singular.html
     111html/singular.html: ${MANUAL_FILES} t2h_singular.init t2h.init
     112        ${TEXI2HTML} -init_file t2h_singular.init ${TEXI2HTML_OPTS} -subdir html singular.tex
    95113
    96114# html stuff
    97115html_tutor: ${TUTOR_FILES}
    98116        test -d html_tutor || mkdir html_tutor
    99         cd html_tutor && ../texi2html -I .. -menu -expandinfo -number -split_node -verbose ../tutor.tex
     117        cd html_tutor && ${TEXI2HTML} ${TEXI2HTML_OPTS} ../tutor.tex
    100118        test -d html || mkdir html
    101119        test -d html/images || mkdir html/images
     
    109127
    110128# how to create the texinfo files
    111 %.tex: %.doc doc2tex ${SINGULAR}
    112         @ echo
    113         @ echo "Be sure Singular is up-to-date before making the examples!"
    114         @ echo
    115         ./doc2tex ${SINGULAR} $*
    116         - grep "error occurred" $@
     129singular_all.tex: ${MANUAL_FILES} doc2tex.pl ${SINGULAR} ${LIBPARSE}
     130        ${DOC2TEX} -lib_fun -lib_ex -o singular_all.tex singular.doc
    117131
    118 doc2tex: doc2tex.c
    119         $(CC) doc2tex.c -o doc2tex
     132# how to create the texinfo files
     133singular_lib.tex: ${MANUAL_FILES} doc2tex.pl ${SINGULAR} ${LIBPARSE}
     134        ${DOC2TEX} -lib_fun -o singular_lib.tex singular.doc
     135
     136%.tex: %.doc doc2tex.pl ${SINGULAR} ${LIBPARSE}
     137        ${DOC2TEX} $*
     138
     139# targets which produce stand-alone documents
     140COPYING: copyright.tex
     141        ${MAKEINFO} --no-header -o COPYING copyright.tex
     142
    120143
    121144# targets concerned with maintenance
     
    134157        /bin/rm -f *.fn *.fns *.ky *.kys *.log *.pg *.pgs *.toc *.tp
    135158        /bin/rm -f *.tps *.vr *.vrs
    136         /bin/rm -f doc2tex singular.hlp *.dvi *.ps ${DOC2TEX_FILES}
    137         /bin/rm -rf html
     159        /bin/rm -f singular.hlp *.dvi *.ps ${DOC2TEX_FILES}
     160        /bin/rm -rf html ${D2T_SUBDIR}
    138161
    139162mostlyclean: clean
  • doc/STYLEGUIDE

    re03e67 rf36635  
    4949+ Email Adressen in @email{...} notieren, URL's in @url{...}
    5050
     51+ Muticolumn tables: Rows of multicolumn tables need to go in one
     52  line, otherwise exi2html chockes. Space beween rows with "empty"
     53  rows (c.f. texi2html), i.e., with @item @tab @tab ....
     54
     55
     56* tex *
     57=======
     58+ Use @math{...} as you would use $..$ in latex -- i.e., ANY
     59  mathematical symbols should be within @math (or, @tex, if they
     60  require special tex symbols)
     61
     62+ don't use \mbox, use \hbox, instead
     63
     64+ use \hbox only within math environment
     65
     66+ don't use any sophisticated tex commands (like \eqalign), restrict
     67  yourself to command which latex understands, as well.
     68
     69+ no "@"-constructs within @tex ... @end tex
     70
     71+ @tex and '@end tex' should always be on separate lines
     72
     73
    5174
    5275* Notationen *
     
    107130  "the ideal resp.@: module is..." schreiben.
    108131
    109 + Zum Englischen:
    110   "i.e.", "e.g.", "for example", "that is" usw. werden immer in Kommas
    111   eingebettet:
     132+ non-zero, zero-dimensional, zero-set: use hyphen; Plural of zero:
     133  zeros (instead of zeroes)
     134
     135+ Zum Englischen: "i.e.", "e.g.", "for example", "that is",
     136  "resp. ..."  usw. werden immer in Kommas eingebettet:
    112137    @sc{Singular}, for example, has the ...
    113138  Nach einem Doppelpunkt schreiben wir klein weiter:
     
    215240  trennen.
    216241
     242
    217243* allgemeines *
    218244===============
     
    222248
    223249------------------------------------------------------------
    224 $Id: STYLEGUIDE,v 1.9 1998-10-26 15:05:33 obachman Exp $
    225 ------------------------------------------------------------
     250$Id: STYLEGUIDE,v 1.10 1999-07-01 12:47:59 obachman Exp $
  • doc/copyright.tex

    re03e67 rf36635  
    11@comment -*-texinfo-*-
    2 @comment $Id: copyright.tex,v 1.19 1998-07-28 12:03:57 Singular Exp $
     2@comment $Id: copyright.tex,v 1.20 1999-07-01 12:47:59 obachman Exp $
    33@comment this file contains the copyright notice on Singular
    4 
    5 @c The following directives are necessary for proper compilation
    6 @c with emacs (C-c C-e C-r).  Please keep it as it is.  Since it
    7 @c is wrapped in `@ignore' and `@end ignore' it does not harm `tex' or
    8 @c `makeinfo' but is a great help in editing this file (emacs
    9 @c ignores the `@ignore').
    10 @ignore
    11 %**start
    12 \input texinfo.tex
    13 @setfilename copyright.info
    14 @node Top, Preface
    15 @menu
    16 * Preface::
    17 @end menu
    18 @node Preface, General concepts, Top, Top
    19 @chapter Preface
    20 %**end
    21 @end ignore
     4@include version.texi
    225
    236@cindex copyright
     
    2912
    3013@center @sc{Singular} version @value{VERSION}
    31 @center University of Kaiserslautern
    32 @center Department of Mathematics and Centre for Computer Algebra
    33 @center Authors: G.-M. Greuel, G. Pfister, H. Schoenemann
     14@center @uref{http://www.uni-kl.de/,,University of Kaiserslautern}
     15@center @uref{http://www.mathematik.uni-kl.de/,,Department of Mathematics} and  @uref{http://www.mathematik.uni-kl.de/~zca/,,Centre for Computer Algebra}
     16@center Authors: @uref{http://www.mathematik.uni-kl.de/~wwwagag/E/Greuel,,G.-M. Greuel}, @uref{http://www.mathematik.uni-kl.de/~wwwagag/E/Pfister,,G. Pfister}, @uref{http://www.mathematik.uni-kl.de/~hannes,,H. Schoenemann}
    3417
    35 @center Copyright @copyright{} 1986-98; All Rights Reserved
     18@center Copyright @copyright{} 1986-99; All Rights Reserved
    3619@sp 2
    37                                 @center @strong{NOTICE}
     20@center @strong{NOTICE}
    3821
    3922Permission to use, copy, modify, and distribute this software or parts
     
    5538
    5639@item
    57 You have registered yourself as a Singular user by sending email to @*
     40You have registered yourself as a @sc{Singular} user by sending email to @*
    5841@email{singular@@mathematik.uni-kl.de}
    5942with the subject line (or, mail body)
     
    7558results that were partly obtained using @sc{Singular}, we request that you
    7659cite @sc{Singular} (see
    77 @url{http://www.ma@-the@-ma@-tik.uni-kl.de/~zca/Singular/how_to_cite.html}
    78 on information on how to cite Singular) and inform us about it.
     60@uref{http://www.ma@-the@-ma@-tik.uni-kl.de/~zca/Singular/how_to_cite.html, for information}
     61 on how to cite Singular) and inform us about it.
    7962
    8063Please send any comments or bug reports to
    81 @email{singular@@mathematik.uni-kl.de}.
     64@center @email{singular@@mathematik.uni-kl.de}.
    8265
    8366The following parts of @sc{Singular} have their own copyright: the Gnu Multiple
     
    9073
    9174The latest information about @sc{Singular} is always available from
    92 @url{http://www.ma@-the@-ma@-tik.uni-kl.de/~zca/Singular}.
     75@uref{http://www.ma@-the@-ma@-tik.uni-kl.de/~zca/Singular}.
    9376@ifset singularmanual
    9477The program @sc{Singular} and the above mentioned parts are available via
     
    9881@copyright{} Free Software Foundation:
    9982@code{libgmp-2.0.2.tar.gz}
    100 @* @url{ftp://ftp.gnu.ai.mit.edu} or its mirrors
     83@* @uref{ftp://ftp.gnu.ai.mit.edu} or its mirrors
    10184@item readline
    10285@copyright{} Free Software Foundation:
    10386@code{libreadline-2.0.tar.gz}
    104 @* @url{ftp://ftp.gnu.ai.mit.edu} or its mirrors
     87@* @uref{ftp://ftp.gnu.ai.mit.edu} or its mirrors
    10588@item MP
    10689@copyright{} Gray/Kajler/Wang, Kent State University:
    10790@code{MP-1.1.2.tar.gz},
    108 @* @url{http://SymbolicNet.mcs.kent.edu/areas/protocols/mp.html}
     91@* @uref{http://SymbolicNet.mcs.kent.edu/areas/protocols/mp.html}
    10992@item Factory
    11093@copyright{} Greuel/Stobbe, University of Kaiserslautern:
     
    122105@* Contact @email{michael@@math.uni-sb.de} for details on libfac.
    123106@item @sc{Singular} binaries
    124 @url{ftp://www.mathematik.uni-kl.de/pub/Math/Singular/} or via a
     107@uref{ftp://www.mathematik.uni-kl.de/pub/Math/Singular/} or via a
    125108WWW brow@-ser from
    126 @url{http://www.mathematik.uni-kl.de/ftp/pub/Math/@-Singular/}
     109@uref{http://www.mathematik.uni-kl.de/ftp/pub/Math/@-Singular/}
    127110@end table
    128111@end ifset
  • doc/singular_toc.html

    re03e67 rf36635  
    11<HTML>
    22<HEAD>
    3 <!-- This HTML file has been created by texi2html 1.54
    4      from ../singular.tex on 19 June 1998 -->
     3<!-- This HTML file has been created by texi2html 1.51
     4     from singular.tex on 14 March 1999 -->
    55
    66<TITLE>Singular Manual - Table of Contents</TITLE>
    7 
    87</HEAD>
    9 <BODY background="images/bg_right.gif">
     8<BODY>
     9<H1>Singular Manual</H1>
     10<ADDRESS>Fachbereich Mathematik</ADDRESS>
     11<ADDRESS>und</ADDRESS>
     12<ADDRESS>Zentrum fuer Computeralgebra</ADDRESS>
     13<ADDRESS>Universitaet Kaiserslautern</ADDRESS>
     14<ADDRESS>D-67653 Kaiserslautern</ADDRESS>
     15<P>
    1016<P><HR><P>
    11 <CENTER><A HREF="http://www.mathematik.uni-kl.de/~zca/Singular" TARGET="_parent">
    12 <IMG SRC="images/singular.jpg"></A></CENTER><BR>
    13 <P>
    14 <H1><CENTER>Singular - Manual</CENTER></H1>
    15 <H3><CENTER>Version 1.2</CENTER></H3>
    16 <H3><CENTER>A Computer Algebra System for Polynomial Computations</CENTER></H3>
    17 <P>
    18 <CENTER><A HREF="http://www.uni-kl.de/" TARGET="_parent"><TT>University of Kaiserslautern</TT></A></CENTER>
    19 <CENTER><A HREF="http://www.mathematik.uni-kl.de/" TARGET="_parent"><TT>Department of Mathematics</TT></A></CENTER>
    20 <CENTER>and</CENTER>
    21 <CENTER><A HREF="http://www.mathematik.uni-kl.de/~zca/" TARGET="_parent"><TT>Centre for Computer Algebra</TT></A></CENTER>
    22 
    2317<UL>
    24 <LI><A HREF="singular_1.html#SEC1">Preface</A>
    25 <LI><A HREF="singular_2.html#SEC4">Introduction</A>
    26 <LI><A HREF="singular_12.html#SEC14">General concepts</A>
    27 <LI><A HREF="singular_48.html#SEC49">Data types</A>
    28 <LI><A HREF="singular_132.html#SEC133">Functions and system variables</A>
    29 <LI><A HREF="singular_279.html#SEC280">Tricks and pitfalls</A>
    30 <LI><A HREF="singular_291.html#SEC285">Examples</A>
    31 <LI><A HREF="singular_319.html#SEC313">Polynomial data</A>
    32 <LI><A HREF="singular_328.html#SEC322">Mathematical background</A>
    33 <LI><A HREF="singular_334.html#SEC328">SINGULAR libraries</A>
    34 <LI><A HREF="singular_354.html#SEC348">Library function index</A>
    35 <LI><A HREF="singular_355.html#SEC349">Index</A>
     18<LI><A NAME="TOC1" HREF="singular.html#SEC1">Preface</A>
     19<LI><A NAME="TOC2" HREF="singular.html#SEC2">Introduction</A>
     20<LI><A NAME="TOC3" HREF="singular.html#SEC3">General concepts</A>
     21<LI><A NAME="TOC4" HREF="singular.html#SEC4">Data types</A>
     22<LI><A NAME="TOC5" HREF="singular.html#SEC5">Functions and system variables</A>
     23<LI><A NAME="TOC6" HREF="singular.html#SEC6">Tricks and pitfalls</A>
     24<UL>
     25<LI><A NAME="TOC7" HREF="singular.html#SEC7">Limitations</A>
     26<LI><A NAME="TOC8" HREF="singular.html#SEC8">Major differences to the C programming language</A>
     27<UL>
     28<LI><A NAME="TOC9" HREF="singular.html#SEC9">No rvalue of increments and assignments</A>
     29<LI><A NAME="TOC10" HREF="singular.html#SEC10">Evaluation of logical expressions</A>
     30<LI><A NAME="TOC11" HREF="singular.html#SEC11">No case or switch statement</A>
     31<LI><A NAME="TOC12" HREF="singular.html#SEC12">Usage of commas</A>
     32<LI><A NAME="TOC13" HREF="singular.html#SEC13">Usage of brackets</A>
     33<LI><A NAME="TOC14" HREF="singular.html#SEC14">Behaviour of continue</A>
     34<LI><A NAME="TOC15" HREF="singular.html#SEC15">Return type of procedures</A>
     35</UL>
     36<LI><A NAME="TOC16" HREF="singular.html#SEC16">Miscellaneous oddities</A>
     37<LI><A NAME="TOC17" HREF="singular.html#SEC17">Identifier resolution</A>
     38</UL>
     39<LI><A NAME="TOC18" HREF="singular.html#SEC18">Examples</A>
     40<LI><A NAME="TOC19" HREF="singular.html#SEC19">Polynomial data</A>
     41<LI><A NAME="TOC20" HREF="singular.html#SEC20">Mathematical background</A>
     42<LI><A NAME="TOC21" HREF="singular.html#SEC21">SINGULAR libraries</A>
     43<UL>
     44<LI><A NAME="TOC22" HREF="singular.html#SEC22">standard_lib</A>
     45<LI><A NAME="TOC23" HREF="singular.html#SEC23">all_lib</A>
     46<LI><A NAME="TOC24" HREF="singular.html#SEC24">general_lib</A>
     47<LI><A NAME="TOC25" HREF="singular.html#SEC25">matrix_lib</A>
     48<LI><A NAME="TOC26" HREF="singular.html#SEC26">sing_lib</A>
     49<LI><A NAME="TOC27" HREF="singular.html#SEC27">elim_lib</A>
     50<LI><A NAME="TOC28" HREF="singular.html#SEC28">inout_lib</A>
     51<LI><A NAME="TOC29" HREF="singular.html#SEC29">random_lib</A>
     52<LI><A NAME="TOC30" HREF="singular.html#SEC30">deform_lib</A>
     53<LI><A NAME="TOC31" HREF="singular.html#SEC31">homolog_lib</A>
     54<LI><A NAME="TOC32" HREF="singular.html#SEC32">poly_lib</A>
     55<LI><A NAME="TOC33" HREF="singular.html#SEC33">ring_lib</A>
     56<LI><A NAME="TOC34" HREF="singular.html#SEC34">finvar_lib</A>
     57<LI><A NAME="TOC35" HREF="singular.html#SEC35">primdec_lib</A>
     58<LI><A NAME="TOC36" HREF="singular.html#SEC36">invar_lib</A>
     59<LI><A NAME="TOC37" HREF="singular.html#SEC37">latex_lib</A>
     60<LI><A NAME="TOC38" HREF="singular.html#SEC38">hnoether_lib</A>
     61<LI><A NAME="TOC39" HREF="singular.html#SEC39">classify_lib</A>
     62<LI><A NAME="TOC40" HREF="singular.html#SEC40">graphics_lib</A>
     63<LI><A NAME="TOC41" HREF="singular.html#SEC41">normal_lib</A>
     64</UL>
     65<LI><A NAME="TOC42" HREF="singular.html#SEC42">Library function index</A>
     66<LI><A NAME="TOC43" HREF="singular.html#SEC43">Index</A>
    3667</UL>
    3768<P><HR><P>
    38 <H6>This document was generated on 19 June 1998 using the
    39 <A HREF="http://wwwcn.cern.ch/dci/texi2html/" TARGET="_parent">texi2html</A>
    40 translator version 1.51a.</H6>
    41 <H6>Modified by the Singular-Team 19.6.1998</H6>
     69This document was generated on 14 March 1999 using the
     70<A HREF="http://wwwcn.cern.ch/dci/texi2html/">texi2html</A>
     71translator version 1.51.</P>
    4272</BODY>
    4373</HTML>
  • doc/texinfo.tex

    re03e67 rf36635  
    1 %% TeX macros to handle Texinfo files.
    2 %% $Id: texinfo.tex,v 1.3 1998-06-19 13:09:19 krueger Exp $
    3 
    4 %  Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
    5 %                94, 95, 96, 97 Free Software Foundation, Inc.
    6 
    7 %This texinfo.tex file is free software; you can redistribute it and/or
    8 %modify it under the terms of the GNU General Public License as
    9 %published by the Free Software Foundation; either version 2, or (at
    10 %your option) any later version.
    11 
    12 %This texinfo.tex file is distributed in the hope that it will be
    13 %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
    14 %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    15 %General Public License for more details.
    16 
    17 %You should have received a copy of the GNU General Public License
    18 %along with this texinfo.tex file; see the file COPYING.  If not, write
    19 %to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    20 %Boston, MA 02111-1307, USA.
    21 
    22 
    23 %In other words, you are welcome to use, share and improve this program.
    24 %You are forbidden to forbid anyone else to use, share and improve
    25 %what you give them.   Help stamp out software-hoarding!
    26 
    27 
    28 % Send bug reports to bug-texinfo@prep.ai.mit.edu.
    29 % Please include a *precise* test case in each bug report.
    30 
    31 
    32 % Make it possible to create a .fmt file just by loading this file:
    33 % if the underlying format is not loaded, start by loading it now.
    34 % Added by gildea November 1993.
     1% texinfo.tex -- TeX macros to handle Texinfo files.
     2%
     3% Load plain if necessary, i.e., if running under initex.
    354\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
    36 
    37 % This automatically updates the version number based on RCS.
    38 \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
    39 \deftexinfoversion$Revision: 1.3 $
    40 \message{Loading texinfo package [Version \texinfoversion]:}
     5%
     6\def\texinfoversion{1999-02-21.16}%
     7%
     8% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
     9% Free Software Foundation, Inc.
     10%
     11% This texinfo.tex file is free software; you can redistribute it and/or
     12% modify it under the terms of the GNU General Public License as
     13% published by the Free Software Foundation; either version 2, or (at
     14% your option) any later version.
     15%
     16% This texinfo.tex file is distributed in the hope that it will be
     17% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
     18% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     19% General Public License for more details.
     20%
     21% You should have received a copy of the GNU General Public License
     22% along with this texinfo.tex file; see the file COPYING.  If not, write
     23% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     24% Boston, MA 02111-1307, USA.
     25%
     26% In other words, you are welcome to use, share and improve this program.
     27% You are forbidden to forbid anyone else to use, share and improve
     28% what you give them.   Help stamp out software-hoarding!
     29%
     30% Please try the latest version of texinfo.tex before submitting bug
     31% reports; you can get the latest version from:
     32%   ftp://ftp.gnu.org/pub/gnu/texinfo.tex
     33%   (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
     34%   ftp://tug.org/tex/texinfo.tex
     35%   ftp://ctan.org/macros/texinfo/texinfo.tex
     36%   (and all CTAN mirrors, finger ctan@ctan.org for a list).
     37%   /home/gd/gnu/doc/texinfo.tex on the GNU machines.
     38% The texinfo.tex in any given Texinfo distribution could well be out
     39% of date, so if that's what you're using, please check.
     40% There is a small home page for Texinfo at http://texinfo.org/.
     41%
     42% Send bug reports to bug-texinfo@gnu.org.  Please include including a
     43% complete document in each bug report with which we can reproduce the
     44% problem.  Patches are, of course, greatly appreciated.
     45%
     46% To process a Texinfo manual with TeX, it's most reliable to use the
     47% texi2dvi shell script that comes with the distribution.  For a simple
     48% manual foo.texi, however, you can get away with this:
     49%   tex foo.texi
     50%   texindex foo.??
     51%   tex foo.texi
     52%   tex foo.texi
     53%   dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
     54% The extra runs of TeX get the cross-reference information correct.
     55% Sometimes one run after texindex suffices, and sometimes you need more
     56% than two; texi2dvi does it as many times as necessary.
     57%
     58% It is possible to adapt texinfo.tex for other languages.  You can get
     59% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.
     60
     61\message{Loading texinfo [version \texinfoversion]:}
    4162
    4263% If in a .fmt file, print the version number
    4364% and turn on active characters that we couldn't do earlier because
    4465% they might have appeared in the input file name.
    45 \everyjob{\message{[Texinfo version \texinfoversion]}\message{}
     66\everyjob{\message{[Texinfo version \texinfoversion]}%
    4667  \catcode`+=\active \catcode`\_=\active}
    4768
     
    5576\let\ptexdots=\dots
    5677\let\ptexend=\end
    57 \let\ptexequiv = \equiv
     78\let\ptexequiv=\equiv
     79\let\ptexexclam=\!
    5880\let\ptexi=\i
    5981\let\ptexlbrace=\{
     
    6284\let\ptext=\t
    6385
    64 % Be sure we're in horizontal mode when doing a tie, since we make space
    65 % equivalent to this in @example-like environments. Otherwise, a space
    66 % at the beginning of a line will start with \penalty -- and
    67 % since \penalty is valid in vertical mode, we'd end up putting the
    68 % penalty on the vertical list instead of in the new paragraph.
    69 {\catcode`@ = 11
    70  % Avoid using \@M directly, because that causes trouble
    71  % if the definition is written into an index file.
    72  \global\let\tiepenalty = \@M
    73  \gdef\tie{\leavevmode\penalty\tiepenalty\ }
    74 }
     86% We never want plain's outer \+ definition in Texinfo.
     87% For @tex, we can use \tabalign.
     88\let\+ = \relax
    7589
    7690
     
    8296\newlinechar = `^^J
    8397
    84 % Set up fixed words for English.
    85 \ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter}}\fi%
    86 \def\putwordInfo{Info}%
    87 \ifx\putwordSee\undefined{\gdef\putwordSee{See}}\fi%
    88 \ifx\putwordsee\undefined{\gdef\putwordsee{see}}\fi%
    89 \ifx\putwordfile\undefined{\gdef\putwordfile{file}}\fi%
    90 \ifx\putwordpage\undefined{\gdef\putwordpage{page}}\fi%
    91 \ifx\putwordsection\undefined{\gdef\putwordsection{section}}\fi%
    92 \ifx\putwordSection\undefined{\gdef\putwordSection{Section}}\fi%
    93 \ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents}}\fi%
    94 \ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents}}\fi%
    95 \ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix}}\fi%
     98% Set up fixed words for English if not already set.
     99\ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
     100\ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
     101\ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
     102\ifx\putwordIndexIsEmpty\undefined     \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
     103\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
     104\ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
     105\ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
     106\ifx\putwordNoTitle\undefined   \gdef\putwordNoTitle{No Title}\fi
     107\ifx\putwordof\undefined        \gdef\putwordof{of}\fi
     108\ifx\putwordon\undefined        \gdef\putwordon{on}\fi
     109\ifx\putwordpage\undefined      \gdef\putwordpage{page}\fi
     110\ifx\putwordsection\undefined   \gdef\putwordsection{section}\fi
     111\ifx\putwordSection\undefined   \gdef\putwordSection{Section}\fi
     112\ifx\putwordsee\undefined       \gdef\putwordsee{see}\fi
     113\ifx\putwordSee\undefined       \gdef\putwordSee{See}\fi
     114\ifx\putwordShortTOC\undefined  \gdef\putwordShortTOC{Short Contents}\fi
     115\ifx\putwordTOC\undefined       \gdef\putwordTOC{Table of Contents}\fi
     116%
     117\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
     118\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
     119\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
     120\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
     121\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
     122\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
     123\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
     124\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
     125\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
     126\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
     127\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
     128\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
     129%
     130\ifx\putwordDefmac\undefined    \gdef\putwordDefmac{Macro}\fi
     131\ifx\putwordDefspec\undefined   \gdef\putwordDefspec{Special Form}\fi
     132\ifx\putwordDefivar\undefined   \gdef\putwordDefivar{Instance Variable}\fi
     133\ifx\putwordDefvar\undefined    \gdef\putwordDefvar{Variable}\fi
     134\ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
     135\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
     136\ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
     137\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
    96138
    97139% Ignore a token.
     
    102144\hyphenation{mini-buf-fer mini-buf-fers}
    103145\hyphenation{eshell}
     146\hyphenation{white-space}
    104147
    105148% Margin to add to right of even pages, to left of odd pages.
     
    113156%
    114157\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
     158\ifx\eTeXversion\undefined
    115159\def\loggingall{\tracingcommands2 \tracingstats2
    116160   \tracingpages1 \tracingoutput1 \tracinglostchars1
     
    118162   \showboxbreadth\maxdimen\showboxdepth\maxdimen
    119163}%
    120 
    121 %---------------------Begin change-----------------------
    122 %
    123 %%%% For @cropmarks command.
    124 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
    125 %
    126 \newdimen\cornerlong \newdimen\cornerthick
    127 \newdimen \topandbottommargin
    128 \newdimen \outerhsize \newdimen \outervsize
    129 \cornerlong=1pc\cornerthick=.3pt        % These set size of cropmarks
    130 \outerhsize=7in
    131 %\outervsize=9.5in
    132 % Alternative @smallbook page size is 9.25in
    133 \outervsize=9.25in
    134 \topandbottommargin=.75in
    135 %
    136 %---------------------End change-----------------------
     164\else
     165\def\loggingall{\tracingcommands3 \tracingstats2
     166   \tracingpages1 \tracingoutput1 \tracinglostchars1
     167   \tracingmacros2 \tracingparagraphs1 \tracingrestores1
     168   \tracingscantokens1 \tracingassigns1 \tracingifs1
     169   \tracinggroups1 \tracingnesting2
     170   \showboxbreadth\maxdimen\showboxdepth\maxdimen
     171}%
     172\fi
     173
     174% For @cropmarks command.
     175% Do @cropmarks to get crop marks.
     176%
     177\newif\ifcropmarks
     178\let\cropmarks = \cropmarkstrue
     179%
     180% Dimensions to add cropmarks at corners.
     181% Added by P. A. MacKay, 12 Nov. 1986
     182%
     183\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
     184\newdimen\cornerlong  \cornerlong=1pc
     185\newdimen\cornerthick \cornerthick=.3pt
     186\newdimen\topandbottommargin \topandbottommargin=.75in
    137187
    138188% Main output routine.
     
    140190\output = {\onepageout{\pagecontents\PAGE}}
    141191
    142 \newbox\headlinebox  \newbox\footlinebox
     192\newbox\headlinebox
     193\newbox\footlinebox
    143194
    144195% \onepageout takes a vbox as an argument.  Note that \pagecontents
    145196% does insertions, but you have to call it yourself.
    146197\def\onepageout#1{%
    147   \hoffset=\normaloffset
     198  \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
     199  %
    148200  \ifodd\pageno  \advance\hoffset by \bindingoffset
    149201  \else \advance\hoffset by -\bindingoffset\fi
     
    164216                   % the page break happens to be in the middle of an example.
    165217    \shipout\vbox{%
     218      \ifcropmarks \vbox to \outervsize\bgroup
     219        \hsize = \outerhsize
     220        \vskip-\topandbottommargin
     221        \vtop to0pt{%
     222          \line{\ewtop\hfil\ewtop}%
     223          \nointerlineskip
     224          \line{%
     225            \vbox{\moveleft\cornerthick\nstop}%
     226            \hfill
     227            \vbox{\moveright\cornerthick\nstop}%
     228          }%
     229          \vss}%
     230        \vskip\topandbottommargin
     231        \line\bgroup
     232          \hfil % center the page within the outer (page) hsize.
     233          \ifodd\pageno\hskip\bindingoffset\fi
     234          \vbox\bgroup
     235      \fi
     236      %
    166237      \unvbox\headlinebox
    167238      \pagebody{#1}%
    168       \unvbox\footlinebox
    169     }%
    170     }%
     239      \ifdim\ht\footlinebox > 0pt
     240        % Only leave this space if the footline is nonempty.
     241        % (We lessened \vsize for it in \oddfootingxxx.)
     242        % The \baselineskip=24pt in plain's \makefootline has no effect.
     243        \vskip 2\baselineskip
     244        \unvbox\footlinebox
     245      \fi
     246      %
     247      \ifcropmarks
     248          \egroup % end of \vbox\bgroup
     249        \hfil\egroup % end of (centering) \line\bgroup
     250        \vskip\topandbottommargin plus1fill minus1fill
     251        \boxmaxdepth = \cornerthick
     252        \vbox to0pt{\vss
     253          \line{%
     254            \vbox{\moveleft\cornerthick\nsbot}%
     255            \hfill
     256            \vbox{\moveright\cornerthick\nsbot}%
     257          }%
     258          \nointerlineskip
     259          \line{\ewbot\hfil\ewbot}%
     260        }%
     261      \egroup % \vbox from first cropmarks clause
     262      \fi
     263    }% end of \shipout\vbox
     264  }% end of group with \turnoffactive
    171265  \advancepageno
    172266  \ifnum\outputpenalty>-20000 \else\dosupereject\fi
    173267}
    174 
    175 %%%% For @cropmarks command %%%%
    176 
    177 % Here is a modification of the main output routine for Near East Publications
    178 % This provides right-angle cropmarks at all four corners.
    179 % The contents of the page are centerlined into the cropmarks,
    180 % and any desired binding offset is added as an \hskip on either
    181 % site of the centerlined box.  (P. A. MacKay, 12 November, 1986)
    182 %
    183 \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
    184 {\escapechar=`\\\relax % makes sure backslash is used in output files.
    185                  \shipout
    186                  \vbox to \outervsize{\hsize=\outerhsize
    187                  \vbox{\line{\ewtop\hfill\ewtop}}
    188                  \nointerlineskip
    189                  \line{\vbox{\moveleft\cornerthick\nstop}
    190                        \hfill
    191                        \vbox{\moveright\cornerthick\nstop}}
    192                  \vskip \topandbottommargin
    193                  \centerline{\ifodd\pageno\hskip\bindingoffset\fi
    194                         \vbox{
    195                         {\let\hsize=\pagewidth \makeheadline}
    196                         \pagebody{#1}
    197                         {\let\hsize=\pagewidth \makefootline}}
    198                         \ifodd\pageno\else\hskip\bindingoffset\fi}
    199                  \vskip \topandbottommargin plus1fill minus1fill
    200                  \boxmaxdepth\cornerthick
    201                  \line{\vbox{\moveleft\cornerthick\nsbot}
    202                        \hfill
    203                        \vbox{\moveright\cornerthick\nsbot}}
    204                  \nointerlineskip
    205                  \vbox{\line{\ewbot\hfill\ewbot}}
    206         }}
    207   \advancepageno
    208   \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
    209 %
    210 % Do @cropmarks to get crop marks
    211 \def\cropmarks{\let\onepageout=\croppageout }
    212268
    213269\newinsert\margin \dimen\margin=\maxdimen
     
    224280}
    225281
    226 %
    227282% Here are the rules for the cropmarks.  Note that they are
    228283% offset so that the space between them is truly \outerhsize or \outervsize
     
    319374\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
    320375\def\ENVcheck{%
    321 \ifENV\errmessage{Still within an environment.  Type Return to continue.}
     376\ifENV\errmessage{Still within an environment; press RETURN to continue}
    322377\endgroup\fi} % This is not perfect, but it should reduce lossage
    323378
    324379% @begin foo  is the same as @foo, for now.
    325 \newhelp\EMsimple{Type <Return> to continue.}
     380\newhelp\EMsimple{Press RETURN to continue.}
    326381
    327382\outer\def\begin{\parsearg\beginxxx}
     
    382437% @@ prints an @
    383438% Kludge this until the fonts are right (grr).
    384 \def\@{{\tt \char '100}}
     439\def\@{{\tt\char64}}
    385440
    386441% This is turned off because it was never documented
     
    392447
    393448% Used to generate quoted braces.
    394 \def\mylbrace {{\tt \char '173}}
    395 \def\myrbrace {{\tt \char '175}}
     449\def\mylbrace {{\tt\char123}}
     450\def\myrbrace {{\tt\char125}}
    396451\let\{=\mylbrace
    397452\let\}=\myrbrace
     
    430485}
    431486
     487% Be sure we're in horizontal mode when doing a tie, since we make space
     488% equivalent to this in @example-like environments. Otherwise, a space
     489% at the beginning of a line will start with \penalty -- and
     490% since \penalty is valid in vertical mode, we'd end up putting the
     491% penalty on the vertical list instead of in the new paragraph.
     492{\catcode`@ = 11
     493 % Avoid using \@M directly, because that causes trouble
     494 % if the definition is written into an index file.
     495 \global\let\tiepenalty = \@M
     496 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
     497}
     498
    432499% @: forces normal size whitespace following.
    433500\def\:{\spacefactor=1000 }
     
    439506\def\.{.\spacefactor=3000 }
    440507
    441 % @enddots{} is an end-of-sentence ellipsis.
    442 \gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
    443 
    444508% @! is an end-of-sentence bang.
    445 \gdef\!{!\spacefactor=3000 }
     509\def\!{!\spacefactor=3000 }
    446510
    447511% @? is an end-of-sentence query.
    448 \gdef\?{?\spacefactor=3000 }
     512\def\?{?\spacefactor=3000 }
    449513
    450514% @w prevents a word break.  Without the \leavevmode, @w at the
     
    530594%% if the depth of the box does not fit.
    531595%{\baselineskip=0pt%
    532 %\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
     596%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
    533597%\prevdepth=-1000pt
    534598%}}
     
    571635\let\br = \par
    572636
    573 % @dots{}  output some dots
    574 
    575 \def\dots{$\ldots$}
     637% @dots{} output an ellipsis using the current font.
     638% We do .5em per period so that it has the same spacing in a typewriter
     639% font as three actual period characters.
     640%
     641\def\dots{%
     642  \leavevmode
     643  \hbox to 1.5em{%
     644    \hskip 0pt plus 0.25fil minus 0.25fil
     645    .\hss.\hss.%
     646    \hskip 0pt plus 0.5fil minus 0.5fil
     647  }%
     648}
     649
     650% @enddots{} is an end-of-sentence ellipsis.
     651%
     652\def\enddots{%
     653  \leavevmode
     654  \hbox to 2em{%
     655    \hskip 0pt plus 0.25fil minus 0.25fil
     656    .\hss.\hss.\hss.%
     657    \hskip 0pt plus 0.5fil minus 0.5fil
     658  }%
     659  \spacefactor=3000
     660}
     661
    576662
    577663% @page    forces the start of a new page
    578 
     664%
    579665\def\page{\par\vfill\supereject}
    580666
     
    643729% @ignore ... @end ignore  is another way to write a comment
    644730
    645 \def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
    646 \parsearg \commentxxx}
    647 
    648 \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
     731\def\comment{\begingroup \catcode`\^^M=\other%
     732\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
     733\commentxxx}
     734{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
    649735
    650736\let\c=\comment
    651737
    652 % @paragraphindent  is defined for the Info formatting commands only.
    653 \let\paragraphindent=\comment
    654 
     738% @paragraphindent NCHARS
     739% We'll use ems for NCHARS, close enough.
     740% We cannot implement @paragraphindent asis, though.
     741%
     742\def\asisword{asis} % no translation, these are keywords
     743\def\noneword{none}
     744%
     745\def\paragraphindent{\parsearg\doparagraphindent}
     746\def\doparagraphindent#1{%
     747  \def\temp{#1}%
     748  \ifx\temp\asisword
     749  \else
     750    \ifx\temp\noneword
     751      \defaultparindent = 0pt
     752    \else
     753      \defaultparindent = #1em
     754    \fi
     755  \fi
     756  \parindent = \defaultparindent
     757}
     758
     759% @asis just yields its argument.  Used with @table, for example.
     760%
     761\def\asis#1{#1}
     762
     763% @math means output in math mode.
     764% We don't use $'s directly in the definition of \math because control
     765% sequences like \math are expanded when the toc file is written.  Then,
     766% we read the toc file back, the $'s will be normal characters (as they
     767% should be, according to the definition of Texinfo).  So we must use a
     768% control sequence to switch into and out of math mode.
     769%
     770% This isn't quite enough for @math to work properly in indices, but it
     771% seems unlikely it will ever be needed there.
     772%
     773\let\implicitmath = $
     774\def\math#1{\implicitmath #1\implicitmath}
     775
     776% @bullet and @minus need the same treatment as @math, just above.
     777\def\bullet{\implicitmath\ptexbullet\implicitmath}
     778\def\minus{\implicitmath-\implicitmath}
     779
     780% @refill is a no-op.
     781\let\refill=\relax
     782
     783% If working on a large document in chapters, it is convenient to
     784% be able to disable indexing, cross-referencing, and contents, for test runs.
     785% This is done with @novalidate (before @setfilename).
     786%
     787\newif\iflinks \linkstrue % by default we want the aux files.
     788\let\novalidate = \linksfalse
     789
     790% @setfilename is done at the beginning of every texinfo file.
     791% So open here the files we need to have open while reading the input.
     792% This makes it possible to make a .fmt file for texinfo.
     793\def\setfilename{%
     794   \iflinks
     795     \readauxfile
     796   \fi % \openindices needs to do some work in any case.
     797   \openindices
     798   \fixbackslash  % Turn off hack to swallow `\input texinfo'.
     799   \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
     800   %
     801   % If texinfo.cnf is present on the system, read it.
     802   % Useful for site-wide @afourpaper, etc.
     803   % Just to be on the safe side, close the input stream before the \input.
     804   \openin 1 texinfo.cnf
     805   \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
     806   \closein1
     807   \temp
     808   %
     809   \comment % Ignore the actual filename.
     810}
     811
     812% Called from \setfilename.
     813%
     814\def\openindices{%
     815  \newindex{cp}%
     816  \newcodeindex{fn}%
     817  \newcodeindex{vr}%
     818  \newcodeindex{tp}%
     819  \newcodeindex{ky}%
     820  \newcodeindex{pg}%
     821}
     822
     823% @bye.
     824\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
     825
     826
     827\message{fonts,}
     828% Font-change commands.
     829
     830% Texinfo sort of supports the sans serif font style, which plain TeX does not.
     831% So we set up a \sf analogous to plain's \rm, etc.
     832\newfam\sffam
     833\def\sf{\fam=\sffam \tensf}
     834\let\li = \sf % Sometimes we call it \li, not \sf.
     835
     836% We don't need math for this one.
     837\def\ttsl{\tenttsl}
     838
     839% Use Computer Modern fonts at \magstephalf (11pt).
     840\newcount\mainmagstep
     841\mainmagstep=\magstephalf
     842
     843% Set the font macro #1 to the font named #2, adding on the
     844% specified font prefix (normally `cm').
     845% #3 is the font's design size, #4 is a scale factor
     846\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
     847
     848% Use cm as the default font prefix.
     849% To specify the font prefix, you must define \fontprefix
     850% before you read in texinfo.tex.
     851\ifx\fontprefix\undefined
     852\def\fontprefix{cm}
     853\fi
     854% Support font families that don't use the same naming scheme as CM.
     855\def\rmshape{r}
     856\def\rmbshape{bx}               %where the normal face is bold
     857\def\bfshape{b}
     858\def\bxshape{bx}
     859\def\ttshape{tt}
     860\def\ttbshape{tt}
     861\def\ttslshape{sltt}
     862\def\itshape{ti}
     863\def\itbshape{bxti}
     864\def\slshape{sl}
     865\def\slbshape{bxsl}
     866\def\sfshape{ss}
     867\def\sfbshape{ss}
     868\def\scshape{csc}
     869\def\scbshape{csc}
     870
     871\ifx\bigger\relax
     872\let\mainmagstep=\magstep1
     873\setfont\textrm\rmshape{12}{1000}
     874\setfont\texttt\ttshape{12}{1000}
     875\else
     876\setfont\textrm\rmshape{10}{\mainmagstep}
     877\setfont\texttt\ttshape{10}{\mainmagstep}
     878\fi
     879% Instead of cmb10, you many want to use cmbx10.
     880% cmbx10 is a prettier font on its own, but cmb10
     881% looks better when embedded in a line with cmr10.
     882\setfont\textbf\bfshape{10}{\mainmagstep}
     883\setfont\textit\itshape{10}{\mainmagstep}
     884\setfont\textsl\slshape{10}{\mainmagstep}
     885\setfont\textsf\sfshape{10}{\mainmagstep}
     886\setfont\textsc\scshape{10}{\mainmagstep}
     887\setfont\textttsl\ttslshape{10}{\mainmagstep}
     888\font\texti=cmmi10 scaled \mainmagstep
     889\font\textsy=cmsy10 scaled \mainmagstep
     890
     891% A few fonts for @defun, etc.
     892\setfont\defbf\bxshape{10}{\magstep1} %was 1314
     893\setfont\deftt\ttshape{10}{\magstep1}
     894\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
     895
     896% Fonts for indices and small examples (9pt).
     897% We actually use the slanted font rather than the italic,
     898% because texinfo normally uses the slanted fonts for that.
     899% Do not make many font distinctions in general in the index, since they
     900% aren't very useful.
     901\setfont\ninett\ttshape{9}{1000}
     902\setfont\ninettsl\ttslshape{10}{900}
     903\setfont\indrm\rmshape{9}{1000}
     904\setfont\indit\itshape{9}{1000}
     905\setfont\indsl\slshape{9}{1000}
     906\let\indtt=\ninett
     907\let\indttsl=\ninettsl
     908\let\indsf=\indrm
     909\let\indbf=\indrm
     910\setfont\indsc\scshape{10}{900}
     911\font\indi=cmmi9
     912\font\indsy=cmsy9
     913
     914% Fonts for title page:
     915\setfont\titlerm\rmbshape{12}{\magstep3}
     916\setfont\titleit\itbshape{10}{\magstep4}
     917\setfont\titlesl\slbshape{10}{\magstep4}
     918\setfont\titlett\ttbshape{12}{\magstep3}
     919\setfont\titlettsl\ttslshape{10}{\magstep4}
     920\setfont\titlesf\sfbshape{17}{\magstep1}
     921\let\titlebf=\titlerm
     922\setfont\titlesc\scbshape{10}{\magstep4}
     923\font\titlei=cmmi12 scaled \magstep3
     924\font\titlesy=cmsy10 scaled \magstep4
     925\def\authorrm{\secrm}
     926
     927% Chapter (and unnumbered) fonts (17.28pt).
     928\setfont\chaprm\rmbshape{12}{\magstep2}
     929\setfont\chapit\itbshape{10}{\magstep3}
     930\setfont\chapsl\slbshape{10}{\magstep3}
     931\setfont\chaptt\ttbshape{12}{\magstep2}
     932\setfont\chapttsl\ttslshape{10}{\magstep3}
     933\setfont\chapsf\sfbshape{17}{1000}
     934\let\chapbf=\chaprm
     935\setfont\chapsc\scbshape{10}{\magstep3}
     936\font\chapi=cmmi12 scaled \magstep2
     937\font\chapsy=cmsy10 scaled \magstep3
     938
     939% Section fonts (14.4pt).
     940\setfont\secrm\rmbshape{12}{\magstep1}
     941\setfont\secit\itbshape{10}{\magstep2}
     942\setfont\secsl\slbshape{10}{\magstep2}
     943\setfont\sectt\ttbshape{12}{\magstep1}
     944\setfont\secttsl\ttslshape{10}{\magstep2}
     945\setfont\secsf\sfbshape{12}{\magstep1}
     946\let\secbf\secrm
     947\setfont\secsc\scbshape{10}{\magstep2}
     948\font\seci=cmmi12 scaled \magstep1
     949\font\secsy=cmsy10 scaled \magstep2
     950
     951% \setfont\ssecrm\bxshape{10}{\magstep1}    % This size an font looked bad.
     952% \setfont\ssecit\itshape{10}{\magstep1}    % The letters were too crowded.
     953% \setfont\ssecsl\slshape{10}{\magstep1}
     954% \setfont\ssectt\ttshape{10}{\magstep1}
     955% \setfont\ssecsf\sfshape{10}{\magstep1}
     956
     957%\setfont\ssecrm\bfshape{10}{1315}      % Note the use of cmb rather than cmbx.
     958%\setfont\ssecit\itshape{10}{1315}      % Also, the size is a little larger than
     959%\setfont\ssecsl\slshape{10}{1315}      % being scaled magstep1.
     960%\setfont\ssectt\ttshape{10}{1315}
     961%\setfont\ssecsf\sfshape{10}{1315}
     962
     963%\let\ssecbf=\ssecrm
     964
     965% Subsection fonts (13.15pt).
     966\setfont\ssecrm\rmbshape{12}{\magstephalf}
     967\setfont\ssecit\itbshape{10}{1315}
     968\setfont\ssecsl\slbshape{10}{1315}
     969\setfont\ssectt\ttbshape{12}{\magstephalf}
     970\setfont\ssecttsl\ttslshape{10}{1315}
     971\setfont\ssecsf\sfbshape{12}{\magstephalf}
     972\let\ssecbf\ssecrm
     973\setfont\ssecsc\scbshape{10}{\magstep1}
     974\font\sseci=cmmi12 scaled \magstephalf
     975\font\ssecsy=cmsy10 scaled 1315
     976% The smallcaps and symbol fonts should actually be scaled \magstep1.5,
     977% but that is not a standard magnification.
     978
     979% In order for the font changes to affect most math symbols and letters,
     980% we have to define the \textfont of the standard families.  Since
     981% texinfo doesn't allow for producing subscripts and superscripts, we
     982% don't bother to reset \scriptfont and \scriptscriptfont (which would
     983% also require loading a lot more fonts).
     984%
     985\def\resetmathfonts{%
     986  \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
     987  \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
     988  \textfont\ttfam = \tentt \textfont\sffam = \tensf
     989}
     990
     991
     992% The font-changing commands redefine the meanings of \tenSTYLE, instead
     993% of just \STYLE.  We do this so that font changes will continue to work
     994% in math mode, where it is the current \fam that is relevant in most
     995% cases, not the current font.  Plain TeX does \def\bf{\fam=\bffam
     996% \tenbf}, for example.  By redefining \tenbf, we obviate the need to
     997% redefine \bf itself.
     998\def\textfonts{%
     999  \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
     1000  \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
     1001  \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
     1002  \resetmathfonts}
     1003\def\titlefonts{%
     1004  \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
     1005  \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
     1006  \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
     1007  \let\tenttsl=\titlettsl
     1008  \resetmathfonts \setleading{25pt}}
     1009\def\titlefont#1{{\titlefonts\rm #1}}
     1010\def\chapfonts{%
     1011  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
     1012  \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
     1013  \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
     1014  \resetmathfonts \setleading{19pt}}
     1015\def\secfonts{%
     1016  \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
     1017  \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
     1018  \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
     1019  \resetmathfonts \setleading{16pt}}
     1020\def\subsecfonts{%
     1021  \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
     1022  \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
     1023  \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
     1024  \resetmathfonts \setleading{15pt}}
     1025\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
     1026\def\indexfonts{%
     1027  \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
     1028  \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
     1029  \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
     1030  \resetmathfonts \setleading{12pt}}
     1031
     1032% Set up the default fonts, so we can use them for creating boxes.
     1033%
     1034\textfonts
     1035
     1036% Define these so they can be easily changed for other fonts.
     1037\def\angleleft{$\langle$}
     1038\def\angleright{$\rangle$}
     1039
     1040% Count depth in font-changes, for error checks
     1041\newcount\fontdepth \fontdepth=0
     1042
     1043% Fonts for short table of contents.
     1044\setfont\shortcontrm\rmshape{12}{1000}
     1045\setfont\shortcontbf\bxshape{12}{1000}
     1046\setfont\shortcontsl\slshape{12}{1000}
     1047
     1048%% Add scribe-like font environments, plus @l for inline lisp (usually sans
     1049%% serif) and @ii for TeX italic
     1050
     1051% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
     1052% unless the following character is such as not to need one.
     1053\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
     1054\def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
     1055\def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
     1056
     1057\let\i=\smartitalic
     1058\let\var=\smartslanted
     1059\let\dfn=\smartslanted
     1060\let\emph=\smartitalic
     1061\let\cite=\smartslanted
     1062
     1063\def\b#1{{\bf #1}}
     1064\let\strong=\b
     1065
     1066% We can't just use \exhyphenpenalty, because that only has effect at
     1067% the end of a paragraph.  Restore normal hyphenation at the end of the
     1068% group within which \nohyphenation is presumably called.
     1069%
     1070\def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
     1071\def\restorehyphenation{\hyphenchar\font = `- }
     1072
     1073\def\t#1{%
     1074  {\tt \rawbackslash \frenchspacing #1}%
     1075  \null
     1076}
     1077\let\ttfont=\t
     1078\def\samp#1{`\tclose{#1}'\null}
     1079\setfont\smallrm\rmshape{8}{1000}
     1080\font\smallsy=cmsy9
     1081\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
     1082  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
     1083    \vbox{\hrule\kern-0.4pt
     1084     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
     1085    \kern-0.4pt\hrule}%
     1086  \kern-.06em\raise0.4pt\hbox{\angleright}}}}
     1087% The old definition, with no lozenge:
     1088%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
     1089\def\ctrl #1{{\tt \rawbackslash \hat}#1}
     1090
     1091% @file, @option are the same as @samp.
     1092\let\file=\samp
     1093\let\option=\samp
     1094
     1095% @code is a modification of @t,
     1096% which makes spaces the same size as normal in the surrounding text.
     1097\def\tclose#1{%
     1098  {%
     1099    % Change normal interword space to be same as for the current font.
     1100    \spaceskip = \fontdimen2\font
     1101    %
     1102    % Switch to typewriter.
     1103    \tt
     1104    %
     1105    % But `\ ' produces the large typewriter interword space.
     1106    \def\ {{\spaceskip = 0pt{} }}%
     1107    %
     1108    % Turn off hyphenation.
     1109    \nohyphenation
     1110    %
     1111    \rawbackslash
     1112    \frenchspacing
     1113    #1%
     1114  }%
     1115  \null
     1116}
     1117
     1118% We *must* turn on hyphenation at `-' and `_' in \code.
     1119% Otherwise, it is too hard to avoid overfull hboxes
     1120% in the Emacs manual, the Library manual, etc.
     1121
     1122% Unfortunately, TeX uses one parameter (\hyphenchar) to control
     1123% both hyphenation at - and hyphenation within words.
     1124% We must therefore turn them both off (\tclose does that)
     1125% and arrange explicitly to hyphenate at a dash.
     1126%  -- rms.
     1127{
     1128  \catcode`\-=\active
     1129  \catcode`\_=\active
     1130  %
     1131  \global\def\code{\begingroup
     1132    \catcode`\-=\active \let-\codedash
     1133    \catcode`\_=\active \let_\codeunder
     1134    \codex
     1135  }
     1136  %
     1137  % If we end up with any active - characters when handling the index,
     1138  % just treat them as a normal -.
     1139  \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
     1140}
     1141
     1142\def\realdash{-}
     1143\def\codedash{-\discretionary{}{}{}}
     1144\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
     1145\def\codex #1{\tclose{#1}\endgroup}
     1146
     1147%\let\exp=\tclose  %Was temporary
     1148
     1149% @kbd is like @code, except that if the argument is just one @key command,
     1150% then @kbd has no effect.
     1151
     1152% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
     1153%   `example' (@kbd uses ttsl only inside of @example and friends),
     1154%   or `code' (@kbd uses normal tty font always).
     1155\def\kbdinputstyle{\parsearg\kbdinputstylexxx}
     1156\def\kbdinputstylexxx#1{%
     1157  \def\arg{#1}%
     1158  \ifx\arg\worddistinct
     1159    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
     1160  \else\ifx\arg\wordexample
     1161    \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
     1162  \else\ifx\arg\wordcode
     1163    \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
     1164  \fi\fi\fi
     1165}
     1166\def\worddistinct{distinct}
     1167\def\wordexample{example}
     1168\def\wordcode{code}
     1169
     1170% Default is kbdinputdistinct.  (Too much of a hassle to call the macro,
     1171% the catcodes are wrong for parsearg to work.)
     1172\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
     1173
     1174\def\xkey{\key}
     1175\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
     1176\ifx\one\xkey\ifx\threex\three \key{#2}%
     1177\else{\tclose{\kbdfont\look}}\fi
     1178\else{\tclose{\kbdfont\look}}\fi}
     1179
     1180% For @url, @env, @command quotes seem unnecessary, so use \code.
     1181\let\url=\code
     1182\let\env=\code
     1183\let\command=\code
     1184
     1185% @uref (abbreviation for `urlref') takes an optional (comma-separated)
     1186% second argument specifying the text to display and an optional third
     1187% arg as text to display instead of (rather than in addition to) the url
     1188% itself.  First (mandatory) arg is the url.  Perhaps eventually put in
     1189% a hypertex \special here.
     1190%
     1191\def\uref#1{\douref #1,,,\finish}
     1192\def\douref#1,#2,#3,#4\finish{%
     1193  \setbox0 = \hbox{\ignorespaces #3}%
     1194  \ifdim\wd0 > 0pt
     1195    \unhbox0 % third arg given, show only that
     1196  \else
     1197    \setbox0 = \hbox{\ignorespaces #2}%
     1198    \ifdim\wd0 > 0pt
     1199      \unhbox0\ (\code{#1})% second arg given, show both it and url
     1200    \else
     1201      \code{#1}% only url given, so show it
     1202    \fi
     1203  \fi
     1204}
     1205
     1206% rms does not like the angle brackets --karl, 17may97.
     1207% So now @email is just like @uref.
     1208%\def\email#1{\angleleft{\tt #1}\angleright}
     1209\let\email=\uref
     1210
     1211% Check if we are currently using a typewriter font.  Since all the
     1212% Computer Modern typewriter fonts have zero interword stretch (and
     1213% shrink), and it is reasonable to expect all typewriter fonts to have
     1214% this property, we can check that font parameter.
     1215%
     1216\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
     1217
     1218% Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
     1219% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
     1220%
     1221\def\dmn#1{\thinspace #1}
     1222
     1223\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
     1224
     1225% @l was never documented to mean ``switch to the Lisp font'',
     1226% and it is not used as such in any manual I can find.  We need it for
     1227% Polish suppressed-l.  --karl, 22sep96.
     1228%\def\l#1{{\li #1}\null}
     1229
     1230% Explicit font changes: @r, @sc, undocumented @ii.
     1231\def\r#1{{\rm #1}}              % roman font
     1232\def\sc#1{{\smallcaps#1}}       % smallcaps font
     1233\def\ii#1{{\it #1}}             % italic font
     1234
     1235% @acronym downcases the argument and prints in smallcaps.
     1236\def\acronym#1{{\smallcaps \lowercase{#1}}}
     1237
     1238% @pounds{} is a sterling sign.
     1239\def\pounds{{\it\$}}
     1240
     1241
     1242\message{page headings,}
     1243
     1244\newskip\titlepagetopglue \titlepagetopglue = 1.5in
     1245\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
     1246
     1247% First the title page.  Must do @settitle before @titlepage.
     1248\newif\ifseenauthor
     1249\newif\iffinishedtitlepage
     1250
     1251% Do an implicit @contents or @shortcontents after @end titlepage if the
     1252% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
     1253%
     1254\newif\ifsetcontentsaftertitlepage
     1255 \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
     1256\newif\ifsetshortcontentsaftertitlepage
     1257 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
     1258
     1259\def\shorttitlepage{\parsearg\shorttitlepagezzz}
     1260\def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
     1261        \endgroup\page\hbox{}\page}
     1262
     1263\def\titlepage{\begingroup \parindent=0pt \textfonts
     1264   \let\subtitlerm=\tenrm
     1265   \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
     1266   %
     1267   \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
     1268   %
     1269   % Leave some space at the very top of the page.
     1270   \vglue\titlepagetopglue
     1271   %
     1272   % Now you can print the title using @title.
     1273   \def\title{\parsearg\titlezzz}%
     1274   \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
     1275                    % print a rule at the page bottom also.
     1276                    \finishedtitlepagefalse
     1277                    \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
     1278   % No rule at page bottom unless we print one at the top with @title.
     1279   \finishedtitlepagetrue
     1280   %
     1281   % Now you can put text using @subtitle.
     1282   \def\subtitle{\parsearg\subtitlezzz}%
     1283   \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
     1284   %
     1285   % @author should come last, but may come many times.
     1286   \def\author{\parsearg\authorzzz}%
     1287   \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
     1288      {\authorfont \leftline{##1}}}%
     1289   %
     1290   % Most title ``pages'' are actually two pages long, with space
     1291   % at the top of the second.  We don't want the ragged left on the second.
     1292   \let\oldpage = \page
     1293   \def\page{%
     1294      \iffinishedtitlepage\else
     1295         \finishtitlepage
     1296      \fi
     1297      \oldpage
     1298      \let\page = \oldpage
     1299      \hbox{}}%
     1300%   \def\page{\oldpage \hbox{}}
     1301}
     1302
     1303\def\Etitlepage{%
     1304   \iffinishedtitlepage\else
     1305      \finishtitlepage
     1306   \fi
     1307   % It is important to do the page break before ending the group,
     1308   % because the headline and footline are only empty inside the group.
     1309   % If we use the new definition of \page, we always get a blank page
     1310   % after the title page, which we certainly don't want.
     1311   \oldpage
     1312   \endgroup
     1313   %
     1314   % If they want short, they certainly want long too.
     1315   \ifsetshortcontentsaftertitlepage
     1316     \shortcontents
     1317     \contents
     1318     \global\let\shortcontents = \relax
     1319     \global\let\contents = \relax
     1320   \fi
     1321   %
     1322   \ifsetcontentsaftertitlepage
     1323     \contents
     1324     \global\let\contents = \relax
     1325     \global\let\shortcontents = \relax
     1326   \fi
     1327   %
     1328   \HEADINGSon
     1329}
     1330
     1331\def\finishtitlepage{%
     1332   \vskip4pt \hrule height 2pt width \hsize
     1333   \vskip\titlepagebottomglue
     1334   \finishedtitlepagetrue
     1335}
     1336
     1337%%% Set up page headings and footings.
     1338
     1339\let\thispage=\folio
     1340
     1341\newtoks\evenheadline    % headline on even pages
     1342\newtoks\oddheadline     % headline on odd pages
     1343\newtoks\evenfootline    % footline on even pages
     1344\newtoks\oddfootline     % footline on odd pages
     1345
     1346% Now make Tex use those variables
     1347\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
     1348                            \else \the\evenheadline \fi}}
     1349\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
     1350                            \else \the\evenfootline \fi}\HEADINGShook}
     1351\let\HEADINGShook=\relax
     1352
     1353% Commands to set those variables.
     1354% For example, this is what  @headings on  does
     1355% @evenheading @thistitle|@thispage|@thischapter
     1356% @oddheading @thischapter|@thispage|@thistitle
     1357% @evenfooting @thisfile||
     1358% @oddfooting ||@thisfile
     1359
     1360\def\evenheading{\parsearg\evenheadingxxx}
     1361\def\oddheading{\parsearg\oddheadingxxx}
     1362\def\everyheading{\parsearg\everyheadingxxx}
     1363
     1364\def\evenfooting{\parsearg\evenfootingxxx}
     1365\def\oddfooting{\parsearg\oddfootingxxx}
     1366\def\everyfooting{\parsearg\everyfootingxxx}
     1367
     1368{\catcode`\@=0 %
     1369
     1370\gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
     1371\gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
     1372\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
     1373
     1374\gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
     1375\gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
     1376\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
     1377
     1378\gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
     1379
     1380\gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
     1381\gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
     1382\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
     1383
     1384\gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
     1385\gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
     1386  \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
     1387  %
     1388  % Leave some space for the footline.  Hopefully ok to assume
     1389  % @evenfooting will not be used by itself.
     1390  \global\advance\pageheight by -\baselineskip
     1391  \global\advance\vsize by -\baselineskip
     1392}
     1393
     1394\gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
     1395%
     1396}% unbind the catcode of @.
     1397
     1398% @headings double      turns headings on for double-sided printing.
     1399% @headings single      turns headings on for single-sided printing.
     1400% @headings off         turns them off.
     1401% @headings on          same as @headings double, retained for compatibility.
     1402% @headings after       turns on double-sided headings after this page.
     1403% @headings doubleafter turns on double-sided headings after this page.
     1404% @headings singleafter turns on single-sided headings after this page.
     1405% By default, they are off at the start of a document,
     1406% and turned `on' after @end titlepage.
     1407
     1408\def\headings #1 {\csname HEADINGS#1\endcsname}
     1409
     1410\def\HEADINGSoff{
     1411\global\evenheadline={\hfil} \global\evenfootline={\hfil}
     1412\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
     1413\HEADINGSoff
     1414% When we turn headings on, set the page number to 1.
     1415% For double-sided printing, put current file name in lower left corner,
     1416% chapter name on inside top of right hand pages, document
     1417% title on inside top of left hand pages, and page numbers on outside top
     1418% edge of all pages.
     1419\def\HEADINGSdouble{
     1420\global\pageno=1
     1421\global\evenfootline={\hfil}
     1422\global\oddfootline={\hfil}
     1423\global\evenheadline={\line{\folio\hfil\thistitle}}
     1424\global\oddheadline={\line{\thischapter\hfil\folio}}
     1425\global\let\contentsalignmacro = \chapoddpage
     1426}
     1427\let\contentsalignmacro = \chappager
     1428
     1429% For single-sided printing, chapter title goes across top left of page,
     1430% page number on top right.
     1431\def\HEADINGSsingle{
     1432\global\pageno=1
     1433\global\evenfootline={\hfil}
     1434\global\oddfootline={\hfil}
     1435\global\evenheadline={\line{\thischapter\hfil\folio}}
     1436\global\oddheadline={\line{\thischapter\hfil\folio}}
     1437\global\let\contentsalignmacro = \chappager
     1438}
     1439\def\HEADINGSon{\HEADINGSdouble}
     1440
     1441\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
     1442\let\HEADINGSdoubleafter=\HEADINGSafter
     1443\def\HEADINGSdoublex{%
     1444\global\evenfootline={\hfil}
     1445\global\oddfootline={\hfil}
     1446\global\evenheadline={\line{\folio\hfil\thistitle}}
     1447\global\oddheadline={\line{\thischapter\hfil\folio}}
     1448\global\let\contentsalignmacro = \chapoddpage
     1449}
     1450
     1451\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
     1452\def\HEADINGSsinglex{%
     1453\global\evenfootline={\hfil}
     1454\global\oddfootline={\hfil}
     1455\global\evenheadline={\line{\thischapter\hfil\folio}}
     1456\global\oddheadline={\line{\thischapter\hfil\folio}}
     1457\global\let\contentsalignmacro = \chappager
     1458}
     1459
     1460% Subroutines used in generating headings
     1461% Produces Day Month Year style of output.
     1462\def\today{%
     1463  \number\day\space
     1464  \ifcase\month
     1465  \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
     1466  \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
     1467  \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
     1468  \fi
     1469  \space\number\year}
     1470
     1471% @settitle line...  specifies the title of the document, for headings.
     1472% It generates no output of its own.
     1473\def\thistitle{\putwordNoTitle}
     1474\def\settitle{\parsearg\settitlezzz}
     1475\def\settitlezzz #1{\gdef\thistitle{#1}}
     1476
     1477
     1478\message{tables,}
     1479% Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
     1480
     1481% default indentation of table text
     1482\newdimen\tableindent \tableindent=.8in
     1483% default indentation of @itemize and @enumerate text
     1484\newdimen\itemindent  \itemindent=.3in
     1485% margin between end of table item and start of table text.
     1486\newdimen\itemmargin  \itemmargin=.1in
     1487
     1488% used internally for \itemindent minus \itemmargin
     1489\newdimen\itemmax
     1490
     1491% Note @table, @vtable, and @vtable define @item, @itemx, etc., with
     1492% these defs.
     1493% They also define \itemindex
     1494% to index the item name in whatever manner is desired (perhaps none).
     1495
     1496\newif\ifitemxneedsnegativevskip
     1497
     1498\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
     1499
     1500\def\internalBitem{\smallbreak \parsearg\itemzzz}
     1501\def\internalBitemx{\itemxpar \parsearg\itemzzz}
     1502
     1503\def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
     1504\def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
     1505
     1506\def\internalBkitem{\smallbreak \parsearg\kitemzzz}
     1507\def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
     1508
     1509\def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
     1510                 \itemzzz {#1}}
     1511
     1512\def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
     1513                 \itemzzz {#1}}
     1514
     1515\def\itemzzz #1{\begingroup %
     1516  \advance\hsize by -\rightskip
     1517  \advance\hsize by -\tableindent
     1518  \setbox0=\hbox{\itemfont{#1}}%
     1519  \itemindex{#1}%
     1520  \nobreak % This prevents a break before @itemx.
     1521  %
     1522  % If the item text does not fit in the space we have, put it on a line
     1523  % by itself, and do not allow a page break either before or after that
     1524  % line.  We do not start a paragraph here because then if the next
     1525  % command is, e.g., @kindex, the whatsit would get put into the
     1526  % horizontal list on a line by itself, resulting in extra blank space.
     1527  \ifdim \wd0>\itemmax
     1528    %
     1529    % Make this a paragraph so we get the \parskip glue and wrapping,
     1530    % but leave it ragged-right.
     1531    \begingroup
     1532      \advance\leftskip by-\tableindent
     1533      \advance\hsize by\tableindent
     1534      \advance\rightskip by0pt plus1fil
     1535      \leavevmode\unhbox0\par
     1536    \endgroup
     1537    %
     1538    % We're going to be starting a paragraph, but we don't want the
     1539    % \parskip glue -- logically it's part of the @item we just started.
     1540    \nobreak \vskip-\parskip
     1541    %
     1542    % Stop a page break at the \parskip glue coming up.  Unfortunately
     1543    % we can't prevent a possible page break at the following
     1544    % \baselineskip glue.
     1545    \nobreak
     1546    \endgroup
     1547    \itemxneedsnegativevskipfalse
     1548  \else
     1549    % The item text fits into the space.  Start a paragraph, so that the
     1550    % following text (if any) will end up on the same line.
     1551    \noindent
     1552    % Do this with kerns and \unhbox so that if there is a footnote in
     1553    % the item text, it can migrate to the main vertical list and
     1554    % eventually be printed.
     1555    \nobreak\kern-\tableindent
     1556    \dimen0 = \itemmax  \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
     1557    \unhbox0
     1558    \nobreak\kern\dimen0
     1559    \endgroup
     1560    \itemxneedsnegativevskiptrue
     1561  \fi
     1562}
     1563
     1564\def\item{\errmessage{@item while not in a table}}
     1565\def\itemx{\errmessage{@itemx while not in a table}}
     1566\def\kitem{\errmessage{@kitem while not in a table}}
     1567\def\kitemx{\errmessage{@kitemx while not in a table}}
     1568\def\xitem{\errmessage{@xitem while not in a table}}
     1569\def\xitemx{\errmessage{@xitemx while not in a table}}
     1570
     1571% Contains a kludge to get @end[description] to work.
     1572\def\description{\tablez{\dontindex}{1}{}{}{}{}}
     1573
     1574% @table, @ftable, @vtable.
     1575\def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
     1576{\obeylines\obeyspaces%
     1577\gdef\tablex #1^^M{%
     1578\tabley\dontindex#1        \endtabley}}
     1579
     1580\def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
     1581{\obeylines\obeyspaces%
     1582\gdef\ftablex #1^^M{%
     1583\tabley\fnitemindex#1        \endtabley
     1584\def\Eftable{\endgraf\afterenvbreak\endgroup}%
     1585\let\Etable=\relax}}
     1586
     1587\def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
     1588{\obeylines\obeyspaces%
     1589\gdef\vtablex #1^^M{%
     1590\tabley\vritemindex#1        \endtabley
     1591\def\Evtable{\endgraf\afterenvbreak\endgroup}%
     1592\let\Etable=\relax}}
     1593
     1594\def\dontindex #1{}
     1595\def\fnitemindex #1{\doind {fn}{\code{#1}}}%
     1596\def\vritemindex #1{\doind {vr}{\code{#1}}}%
     1597
     1598{\obeyspaces %
     1599\gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
     1600\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
     1601
     1602\def\tablez #1#2#3#4#5#6{%
     1603\aboveenvbreak %
     1604\begingroup %
     1605\def\Edescription{\Etable}% Necessary kludge.
     1606\let\itemindex=#1%
     1607\ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
     1608\ifnum 0#4>0 \tableindent=#4\mil \fi %
     1609\ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
     1610\def\itemfont{#2}%
     1611\itemmax=\tableindent %
     1612\advance \itemmax by -\itemmargin %
     1613\advance \leftskip by \tableindent %
     1614\exdentamount=\tableindent
     1615\parindent = 0pt
     1616\parskip = \smallskipamount
     1617\ifdim \parskip=0pt \parskip=2pt \fi%
     1618\def\Etable{\endgraf\afterenvbreak\endgroup}%
     1619\let\item = \internalBitem %
     1620\let\itemx = \internalBitemx %
     1621\let\kitem = \internalBkitem %
     1622\let\kitemx = \internalBkitemx %
     1623\let\xitem = \internalBxitem %
     1624\let\xitemx = \internalBxitemx %
     1625}
     1626
     1627% This is the counter used by @enumerate, which is really @itemize
     1628
     1629\newcount \itemno
     1630
     1631\def\itemize{\parsearg\itemizezzz}
     1632
     1633\def\itemizezzz #1{%
     1634  \begingroup % ended by the @end itemize
     1635  \itemizey {#1}{\Eitemize}
     1636}
     1637
     1638\def\itemizey #1#2{%
     1639\aboveenvbreak %
     1640\itemmax=\itemindent %
     1641\advance \itemmax by -\itemmargin %
     1642\advance \leftskip by \itemindent %
     1643\exdentamount=\itemindent
     1644\parindent = 0pt %
     1645\parskip = \smallskipamount %
     1646\ifdim \parskip=0pt \parskip=2pt \fi%
     1647\def#2{\endgraf\afterenvbreak\endgroup}%
     1648\def\itemcontents{#1}%
     1649\let\item=\itemizeitem}
     1650
     1651% Set sfcode to normal for the chars that usually have another value.
     1652% These are `.?!:;,'
     1653\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
     1654  \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
     1655
     1656% \splitoff TOKENS\endmark defines \first to be the first token in
     1657% TOKENS, and \rest to be the remainder.
     1658%
     1659\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
     1660
     1661% Allow an optional argument of an uppercase letter, lowercase letter,
     1662% or number, to specify the first label in the enumerated list.  No
     1663% argument is the same as `1'.
     1664%
     1665\def\enumerate{\parsearg\enumeratezzz}
     1666\def\enumeratezzz #1{\enumeratey #1  \endenumeratey}
     1667\def\enumeratey #1 #2\endenumeratey{%
     1668  \begingroup % ended by the @end enumerate
     1669  %
     1670  % If we were given no argument, pretend we were given `1'.
     1671  \def\thearg{#1}%
     1672  \ifx\thearg\empty \def\thearg{1}\fi
     1673  %
     1674  % Detect if the argument is a single token.  If so, it might be a
     1675  % letter.  Otherwise, the only valid thing it can be is a number.
     1676  % (We will always have one token, because of the test we just made.
     1677  % This is a good thing, since \splitoff doesn't work given nothing at
     1678  % all -- the first parameter is undelimited.)
     1679  \expandafter\splitoff\thearg\endmark
     1680  \ifx\rest\empty
     1681    % Only one token in the argument.  It could still be anything.
     1682    % A ``lowercase letter'' is one whose \lccode is nonzero.
     1683    % An ``uppercase letter'' is one whose \lccode is both nonzero, and
     1684    %   not equal to itself.
     1685    % Otherwise, we assume it's a number.
     1686    %
     1687    % We need the \relax at the end of the \ifnum lines to stop TeX from
     1688    % continuing to look for a <number>.
     1689    %
     1690    \ifnum\lccode\expandafter`\thearg=0\relax
     1691      \numericenumerate % a number (we hope)
     1692    \else
     1693      % It's a letter.
     1694      \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
     1695        \lowercaseenumerate % lowercase letter
     1696      \else
     1697        \uppercaseenumerate % uppercase letter
     1698      \fi
     1699    \fi
     1700  \else
     1701    % Multiple tokens in the argument.  We hope it's a number.
     1702    \numericenumerate
     1703  \fi
     1704}
     1705
     1706% An @enumerate whose labels are integers.  The starting integer is
     1707% given in \thearg.
     1708%
     1709\def\numericenumerate{%
     1710  \itemno = \thearg
     1711  \startenumeration{\the\itemno}%
     1712}
     1713
     1714% The starting (lowercase) letter is in \thearg.
     1715\def\lowercaseenumerate{%
     1716  \itemno = \expandafter`\thearg
     1717  \startenumeration{%
     1718    % Be sure we're not beyond the end of the alphabet.
     1719    \ifnum\itemno=0
     1720      \errmessage{No more lowercase letters in @enumerate; get a bigger
     1721                  alphabet}%
     1722    \fi
     1723    \char\lccode\itemno
     1724  }%
     1725}
     1726
     1727% The starting (uppercase) letter is in \thearg.
     1728\def\uppercaseenumerate{%
     1729  \itemno = \expandafter`\thearg
     1730  \startenumeration{%
     1731    % Be sure we're not beyond the end of the alphabet.
     1732    \ifnum\itemno=0
     1733      \errmessage{No more uppercase letters in @enumerate; get a bigger
     1734                  alphabet}
     1735    \fi
     1736    \char\uccode\itemno
     1737  }%
     1738}
     1739
     1740% Call itemizey, adding a period to the first argument and supplying the
     1741% common last two arguments.  Also subtract one from the initial value in
     1742% \itemno, since @item increments \itemno.
     1743%
     1744\def\startenumeration#1{%
     1745  \advance\itemno by -1
     1746  \itemizey{#1.}\Eenumerate\flushcr
     1747}
     1748
     1749% @alphaenumerate and @capsenumerate are abbreviations for giving an arg
     1750% to @enumerate.
     1751%
     1752\def\alphaenumerate{\enumerate{a}}
     1753\def\capsenumerate{\enumerate{A}}
     1754\def\Ealphaenumerate{\Eenumerate}
     1755\def\Ecapsenumerate{\Eenumerate}
     1756
     1757% Definition of @item while inside @itemize.
     1758
     1759\def\itemizeitem{%
     1760\advance\itemno by 1
     1761{\let\par=\endgraf \smallbreak}%
     1762\ifhmode \errmessage{In hmode at itemizeitem}\fi
     1763{\parskip=0in \hskip 0pt
     1764\hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
     1765\vadjust{\penalty 1200}}%
     1766\flushcr}
     1767
     1768% @multitable macros
     1769% Amy Hendrickson, 8/18/94, 3/6/96
     1770%
     1771% @multitable ... @end multitable will make as many columns as desired.
     1772% Contents of each column will wrap at width given in preamble.  Width
     1773% can be specified either with sample text given in a template line,
     1774% or in percent of \hsize, the current width of text on page.
     1775
     1776% Table can continue over pages but will only break between lines.
     1777
     1778% To make preamble:
     1779%
     1780% Either define widths of columns in terms of percent of \hsize:
     1781%   @multitable @columnfractions .25 .3 .45
     1782%   @item ...
     1783%
     1784%   Numbers following @columnfractions are the percent of the total
     1785%   current hsize to be used for each column. You may use as many
     1786%   columns as desired.
     1787
     1788
     1789% Or use a template:
     1790%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
     1791%   @item ...
     1792%   using the widest term desired in each column.
     1793%
     1794% For those who want to use more than one line's worth of words in
     1795% the preamble, break the line within one argument and it
     1796% will parse correctly, i.e.,
     1797%
     1798%     @multitable {Column 1 template} {Column 2 template} {Column 3
     1799%      template}
     1800% Not:
     1801%     @multitable {Column 1 template} {Column 2 template}
     1802%      {Column 3 template}
     1803
     1804% Each new table line starts with @item, each subsequent new column
     1805% starts with @tab. Empty columns may be produced by supplying @tab's
     1806% with nothing between them for as many times as empty columns are needed,
     1807% ie, @tab@tab@tab will produce two empty columns.
     1808
     1809% @item, @tab, @multitable or @end multitable do not need to be on their
     1810% own lines, but it will not hurt if they are.
     1811
     1812% Sample multitable:
     1813
     1814%   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
     1815%   @item first col stuff @tab second col stuff @tab third col
     1816%   @item
     1817%   first col stuff
     1818%   @tab
     1819%   second col stuff
     1820%   @tab
     1821%   third col
     1822%   @item first col stuff @tab second col stuff
     1823%   @tab Many paragraphs of text may be used in any column.
     1824%
     1825%         They will wrap at the width determined by the template.
     1826%   @item@tab@tab This will be in third column.
     1827%   @end multitable
     1828
     1829% Default dimensions may be reset by user.
     1830% @multitableparskip is vertical space between paragraphs in table.
     1831% @multitableparindent is paragraph indent in table.
     1832% @multitablecolmargin is horizontal space to be left between columns.
     1833% @multitablelinespace is space to leave between table items, baseline
     1834%                                                            to baseline.
     1835%   0pt means it depends on current normal line spacing.
     1836%
     1837\newskip\multitableparskip
     1838\newskip\multitableparindent
     1839\newdimen\multitablecolspace
     1840\newskip\multitablelinespace
     1841\multitableparskip=0pt
     1842\multitableparindent=6pt
     1843\multitablecolspace=12pt
     1844\multitablelinespace=0pt
     1845
     1846% Macros used to set up halign preamble:
     1847%
     1848\let\endsetuptable\relax
     1849\def\xendsetuptable{\endsetuptable}
     1850\let\columnfractions\relax
     1851\def\xcolumnfractions{\columnfractions}
     1852\newif\ifsetpercent
     1853
     1854% #1 is the part of the @columnfraction before the decimal point, which
     1855% is presumably either 0 or the empty string (but we don't check, we
     1856% just throw it away).  #2 is the decimal part, which we use as the
     1857% percent of \hsize for this column.
     1858\def\pickupwholefraction#1.#2 {%
     1859  \global\advance\colcount by 1
     1860  \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
     1861  \setuptable
     1862}
     1863
     1864\newcount\colcount
     1865\def\setuptable#1{%
     1866  \def\firstarg{#1}%
     1867  \ifx\firstarg\xendsetuptable
     1868    \let\go = \relax
     1869  \else
     1870    \ifx\firstarg\xcolumnfractions
     1871      \global\setpercenttrue
     1872    \else
     1873      \ifsetpercent
     1874         \let\go\pickupwholefraction
     1875      \else
     1876         \global\advance\colcount by 1
     1877         \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
     1878                            % typically that is always in the input, anyway.
     1879         \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
     1880      \fi
     1881    \fi
     1882    \ifx\go\pickupwholefraction
     1883      % Put the argument back for the \pickupwholefraction call, so
     1884      % we'll always have a period there to be parsed.
     1885      \def\go{\pickupwholefraction#1}%
     1886    \else
     1887      \let\go = \setuptable
     1888    \fi%
     1889  \fi
     1890  \go
     1891}
     1892
     1893% multitable syntax
     1894\def\tab{&\hskip1sp\relax} % 2/2/96
     1895                           % tiny skip here makes sure this column space is
     1896                           % maintained, even if it is never used.
     1897
     1898% @multitable ... @end multitable definitions:
     1899%
     1900\def\multitable{\parsearg\dotable}
     1901\def\dotable#1{\bgroup
     1902  \vskip\parskip
     1903  \let\item\crcr
     1904  \tolerance=9500
     1905  \hbadness=9500
     1906  \setmultitablespacing
     1907  \parskip=\multitableparskip
     1908  \parindent=\multitableparindent
     1909  \overfullrule=0pt
     1910  \global\colcount=0
     1911  \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
     1912  %
     1913  % To parse everything between @multitable and @item:
     1914  \setuptable#1 \endsetuptable
     1915  %
     1916  % \everycr will reset column counter, \colcount, at the end of
     1917  % each line. Every column entry will cause \colcount to advance by one.
     1918  % The table preamble
     1919  % looks at the current \colcount to find the correct column width.
     1920  \everycr{\noalign{%
     1921  %
     1922  % \filbreak%% keeps underfull box messages off when table breaks over pages.
     1923  % Maybe so, but it also creates really weird page breaks when the table
     1924  % breaks over pages. Wouldn't \vfil be better?  Wait until the problem
     1925  % manifests itself, so it can be fixed for real --karl.
     1926    \global\colcount=0\relax}}%
     1927  %
     1928  % This preamble sets up a generic column definition, which will
     1929  % be used as many times as user calls for columns.
     1930  % \vtop will set a single line and will also let text wrap and
     1931  % continue for many paragraphs if desired.
     1932  \halign\bgroup&\global\advance\colcount by 1\relax
     1933    \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
     1934  %
     1935  % In order to keep entries from bumping into each other
     1936  % we will add a \leftskip of \multitablecolspace to all columns after
     1937  % the first one.
     1938  %
     1939  % If a template has been used, we will add \multitablecolspace
     1940  % to the width of each template entry.
     1941  %
     1942  % If the user has set preamble in terms of percent of \hsize we will
     1943  % use that dimension as the width of the column, and the \leftskip
     1944  % will keep entries from bumping into each other.  Table will start at
     1945  % left margin and final column will justify at right margin.
     1946  %
     1947  % Make sure we don't inherit \rightskip from the outer environment.
     1948  \rightskip=0pt
     1949  \ifnum\colcount=1
     1950    % The first column will be indented with the surrounding text.
     1951    \advance\hsize by\leftskip
     1952  \else
     1953    \ifsetpercent \else
     1954      % If user has not set preamble in terms of percent of \hsize
     1955      % we will advance \hsize by \multitablecolspace.
     1956      \advance\hsize by \multitablecolspace
     1957    \fi
     1958   % In either case we will make \leftskip=\multitablecolspace:
     1959  \leftskip=\multitablecolspace
     1960  \fi
     1961  % Ignoring space at the beginning and end avoids an occasional spurious
     1962  % blank line, when TeX decides to break the line at the space before the
     1963  % box from the multistrut, so the strut ends up on a line by itself.
     1964  % For example:
     1965  % @multitable @columnfractions .11 .89
     1966  % @item @code{#}
     1967  % @tab Legal holiday which is valid in major parts of the whole country.
     1968  % Is automatically provided with highlighting sequences respectively marking
     1969  % characters.
     1970  \noindent\ignorespaces##\unskip\multistrut}\cr
     1971}
     1972
     1973\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
     1974% If so, do nothing. If not, give it an appropriate dimension based on
     1975% current baselineskip.
     1976\ifdim\multitablelinespace=0pt
     1977%% strut to put in table in case some entry doesn't have descenders,
     1978%% to keep lines equally spaced
     1979\let\multistrut = \strut
     1980%% Test to see if parskip is larger than space between lines of
     1981%% table. If not, do nothing.
     1982%%        If so, set to same dimension as multitablelinespace.
     1983\else
     1984\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
     1985width0pt\relax} \fi
     1986\ifdim\multitableparskip>\multitablelinespace
     1987\global\multitableparskip=\multitablelinespace
     1988\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
     1989                                      %% than skip between lines in the table.
     1990\fi%
     1991\ifdim\multitableparskip=0pt
     1992\global\multitableparskip=\multitablelinespace
     1993\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
     1994                                      %% than skip between lines in the table.
     1995\fi}
     1996
     1997
     1998\message{conditionals,}
    6551999% Prevent errors for section commands.
    6562000% Used in @ignore and in failing conditionals.
    6572001\def\ignoresections{%
    658 \let\chapter=\relax
    659 \let\unnumbered=\relax
    660 \let\top=\relax
    661 \let\unnumberedsec=\relax
    662 \let\unnumberedsection=\relax
    663 \let\unnumberedsubsec=\relax
    664 \let\unnumberedsubsection=\relax
    665 \let\unnumberedsubsubsec=\relax
    666 \let\unnumberedsubsubsection=\relax
    667 \let\section=\relax
    668 \let\subsec=\relax
    669 \let\subsubsec=\relax
    670 \let\subsection=\relax
    671 \let\subsubsection=\relax
    672 \let\appendix=\relax
    673 \let\appendixsec=\relax
    674 \let\appendixsection=\relax
    675 \let\appendixsubsec=\relax
    676 \let\appendixsubsection=\relax
    677 \let\appendixsubsubsec=\relax
    678 \let\appendixsubsubsection=\relax
    679 \let\contents=\relax
    680 \let\smallbook=\relax
    681 \let\titlepage=\relax
     2002  \let\chapter=\relax
     2003  \let\unnumbered=\relax
     2004  \let\top=\relax
     2005  \let\unnumberedsec=\relax
     2006  \let\unnumberedsection=\relax
     2007  \let\unnumberedsubsec=\relax
     2008  \let\unnumberedsubsection=\relax
     2009  \let\unnumberedsubsubsec=\relax
     2010  \let\unnumberedsubsubsection=\relax
     2011  \let\section=\relax
     2012  \let\subsec=\relax
     2013  \let\subsubsec=\relax
     2014  \let\subsection=\relax
     2015  \let\subsubsection=\relax
     2016  \let\appendix=\relax
     2017  \let\appendixsec=\relax
     2018  \let\appendixsection=\relax
     2019  \let\appendixsubsec=\relax
     2020  \let\appendixsubsection=\relax
     2021  \let\appendixsubsubsec=\relax
     2022  \let\appendixsubsubsection=\relax
     2023  \let\contents=\relax
     2024  \let\smallbook=\relax
     2025  \let\titlepage=\relax
    6822026}
    6832027
     
    7342078\def\ignore{\doignore{ignore}}
    7352079
    736 % Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
     2080% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
    7372081%
    7382082\def\ifinfo{\doignore{ifinfo}}
     
    7432087\def\direntry{\doignore{direntry}}
    7442088
    745 % Also ignore @macro ... @end macro.  The user must run texi2dvi,
    746 % which runs makeinfo to do macro expansion.  Ignore @unmacro, too.
    747 \def\macro{\doignore{macro}}
    748 \let\unmacro = \comment
    749 
    750 
    7512089% @dircategory CATEGORY  -- specify a category of the dir file
    7522090% which this file should belong to.  Ignore this in TeX.
     
    7602098  %
    7612099  % Define a command to swallow text until we reach `@end #1'.
    762   \long\def\doignoretext##1\end #1{\enddoignore}%
     2100  % This @ is a catcode 12 token (that is the normal catcode of @ in
     2101  % this texinfo.tex file).  We change the catcode of @ below to match.
     2102  \long\def\doignoretext##1@end #1{\enddoignore}%
    7632103  %
    7642104  % Make sure that spaces turn into tokens that match what \doignoretext wants.
    7652105  \catcode32 = 10
     2106  %
     2107  % Ignore braces, too, so mismatched braces don't cause trouble.
     2108  \catcode`\{ = 9
     2109  \catcode`\} = 9
     2110  %
     2111  % We must not have @c interpreted as a control sequence.
     2112  \catcode`\@ = 12
     2113  %
     2114  % Make the letter c a comment character so that the rest of the line
     2115  % will be ignored. This way, the document can have (for example)
     2116  %   @c @end ifinfo
     2117  % and the @end ifinfo will be properly ignored.
     2118  % (We've just changed @ to catcode 12.)
     2119  \catcode`\c = 14
    7662120  %
    7672121  % And now expand that command.
     
    7792133  % This uses \immediate\write16 rather than \message to get newlines.
    7802134    \immediate\write16{}
    781     \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
     2135    \immediate\write16{WARNING: for users of Unix TeX 3.0!}
    7822136    \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
    7832137    \immediate\write16{If you are running another version of TeX, relax.}
    7842138    \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
    7852139    \immediate\write16{  Then upgrade your TeX installation if you can.}
    786     \immediate\write16{  (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
     2140    \immediate\write16{  (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
    7872141    \immediate\write16{If you are stuck with version 3.0, run the}
    7882142    \immediate\write16{  script ``tex3patch'' from the Texinfo distribution}
     
    8562210    %
    8572211    % Do not execute instructions in @tex
    858     \def\tex{\doignore{tex}}
     2212    \def\tex{\doignore{tex}}%
     2213    % Do not execute macro definitions.
     2214    % `c' is a comment character, so the word `macro' will get cut off.
     2215    \def\macro{\doignore{ma}}%
    8592216}
    8602217
     
    8902247
    8912248% @value{foo} gets the text saved in variable foo.
    892 %
    893 \def\value{\begingroup
    894   \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
    895   \valuexxx}
    896 \def\valuexxx#1{%
     2249{
     2250  \catcode`\_ = \active
     2251  %
     2252  % We might end up with active _ or - characters in the argument if
     2253  % we're called from @code, as @code{@value{foo-bar_}}.  So \let any
     2254  % such active characters to their normal equivalents.
     2255  \gdef\value{\begingroup
     2256    \catcode`\-=12 \catcode`\_=12
     2257    \indexbreaks \let_\normalunderscore
     2258    \valuexxx}
     2259}
     2260\def\valuexxx#1{\expandablevalue{#1}\endgroup}
     2261
     2262% We have this subroutine so that we can handle at least some @value's
     2263% properly in indexes (we \let\value to this in \indexdummies).  Ones
     2264% whose names contain - or _ still won't work, but we can't do anything
     2265% about that.  The command has to be fully expandable, since the result
     2266% winds up in the index file.  This means that if the variable's value
     2267% contains other Texinfo commands, it's almost certain it will fail
     2268% (although perhaps we could fix that with sufficient work to do a
     2269% one-level expansion on the result, instead of complete).
     2270%
     2271\def\expandablevalue#1{%
    8972272  \expandafter\ifx\csname SET#1\endcsname\relax
    898     {\{No value for ``#1''\}}%
     2273    {[No value for ``#1'']}%
    8992274  \else
    9002275    \csname SET#1\endcsname
    9012276  \fi
    902 \endgroup}
     2277}
    9032278
    9042279% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
     
    9322307\defineunmatchedend{ifclear}
    9332308
    934 % @iftex always succeeds; we read the text following, through @end
    935 % iftex).  But `@end iftex' should be valid only after an @iftex.
     2309% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
     2310% following, through the first @end iftex (etc.).  Make `@end iftex'
     2311% (etc.) valid only after an @iftex.
    9362312%
    9372313\def\iftex{\conditionalsucceed{iftex}}
     
    9652341\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
    9662342
    967 % @asis just yields its argument.  Used with @table, for example.
    968 %
    969 \def\asis#1{#1}
    970 
    971 % @math means output in math mode.
    972 % We don't use $'s directly in the definition of \math because control
    973 % sequences like \math are expanded when the toc file is written.  Then,
    974 % we read the toc file back, the $'s will be normal characters (as they
    975 % should be, according to the definition of Texinfo).  So we must use a
    976 % control sequence to switch into and out of math mode.
    977 %
    978 % This isn't quite enough for @math to work properly in indices, but it
    979 % seems unlikely it will ever be needed there.
    980 %
    981 \let\implicitmath = $
    982 \def\math#1{\implicitmath #1\implicitmath}
    983 
    984 % @bullet and @minus need the same treatment as @math, just above.
    985 \def\bullet{\implicitmath\ptexbullet\implicitmath}
    986 \def\minus{\implicitmath-\implicitmath}
    987 
    988 \def\node{\ENVcheck\parsearg\nodezzz}
    989 \def\nodezzz#1{\nodexxx [#1,]}
    990 \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
    991 \let\nwnode=\node
    992 \let\lastnode=\relax
    993 
    994 \def\donoderef{\ifx\lastnode\relax\else
    995 \expandafter\expandafter\expandafter\setref{\lastnode}\fi
    996 \global\let\lastnode=\relax}
    997 
    998 \def\unnumbnoderef{\ifx\lastnode\relax\else
    999 \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
    1000 \global\let\lastnode=\relax}
    1001 
    1002 \def\appendixnoderef{\ifx\lastnode\relax\else
    1003 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
    1004 \global\let\lastnode=\relax}
    1005 
    1006 % @refill is a no-op.
    1007 \let\refill=\relax
    1008 
    1009 % @setfilename is done at the beginning of every texinfo file.
    1010 % So open here the files we need to have open while reading the input.
    1011 % This makes it possible to make a .fmt file for texinfo.
    1012 \def\setfilename{%
    1013    \readauxfile
    1014    \opencontents
    1015    \openindices
    1016    \fixbackslash  % Turn off hack to swallow `\input texinfo'.
    1017    \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
    1018    \comment % Ignore the actual filename.
    1019 }
    1020 
    1021 % @bye.
    1022 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
    1023 
    1024 % \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
    1025 % \def\macroxxx#1#2 \end macro{%
    1026 % \expandafter\gdef\macrotemp#1{#2}%
    1027 % \endgroup}
    1028 
    1029 %\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
    1030 %\def\linemacroxxx#1#2 \end linemacro{%
    1031 %\let\parsearg=\relax
    1032 %\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
    1033 %\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
    1034 %\expandafter\gdef\macrotempx#1{#2}%
    1035 %\endgroup}
    1036 
    1037 %\def\butfirst#1{}
    1038 
    1039 
    1040 \message{fonts,}
    1041 
    1042 % Font-change commands.
    1043 
    1044 % Texinfo supports the sans serif font style, which plain TeX does not.
    1045 % So we set up a \sf analogous to plain's \rm, etc.
    1046 \newfam\sffam
    1047 \def\sf{\fam=\sffam \tensf}
    1048 \let\li = \sf % Sometimes we call it \li, not \sf.
    1049 
    1050 % We don't need math for this one.
    1051 \def\ttsl{\tenttsl}
    1052 
    1053 %% Try out Computer Modern fonts at \magstephalf
    1054 \let\mainmagstep=\magstephalf
    1055 
    1056 % Set the font macro #1 to the font named #2, adding on the
    1057 % specified font prefix (normally `cm').
    1058 % #3 is the font's design size, #4 is a scale factor
    1059 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
    1060 
    1061 % Use cm as the default font prefix.
    1062 % To specify the font prefix, you must define \fontprefix
    1063 % before you read in texinfo.tex.
    1064 \ifx\fontprefix\undefined
    1065 \def\fontprefix{cm}
    1066 \fi
    1067 % Support font families that don't use the same naming scheme as CM.
    1068 \def\rmshape{r}
    1069 \def\rmbshape{bx}               %where the normal face is bold
    1070 \def\bfshape{b}
    1071 \def\bxshape{bx}
    1072 \def\ttshape{tt}
    1073 \def\ttbshape{tt}
    1074 \def\ttslshape{sltt}
    1075 \def\itshape{ti}
    1076 \def\itbshape{bxti}
    1077 \def\slshape{sl}
    1078 \def\slbshape{bxsl}
    1079 \def\sfshape{ss}
    1080 \def\sfbshape{ss}
    1081 \def\scshape{csc}
    1082 \def\scbshape{csc}
    1083 
    1084 \ifx\bigger\relax
    1085 \let\mainmagstep=\magstep1
    1086 \setfont\textrm\rmshape{12}{1000}
    1087 \setfont\texttt\ttshape{12}{1000}
    1088 \else
    1089 \setfont\textrm\rmshape{10}{\mainmagstep}
    1090 \setfont\texttt\ttshape{10}{\mainmagstep}
    1091 \fi
    1092 % Instead of cmb10, you many want to use cmbx10.
    1093 % cmbx10 is a prettier font on its own, but cmb10
    1094 % looks better when embedded in a line with cmr10.
    1095 \setfont\textbf\bfshape{10}{\mainmagstep}
    1096 \setfont\textit\itshape{10}{\mainmagstep}
    1097 \setfont\textsl\slshape{10}{\mainmagstep}
    1098 \setfont\textsf\sfshape{10}{\mainmagstep}
    1099 \setfont\textsc\scshape{10}{\mainmagstep}
    1100 \setfont\textttsl\ttslshape{10}{\mainmagstep}
    1101 \font\texti=cmmi10 scaled \mainmagstep
    1102 \font\textsy=cmsy10 scaled \mainmagstep
    1103 
    1104 % A few fonts for @defun, etc.
    1105 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
    1106 \setfont\deftt\ttshape{10}{\magstep1}
    1107 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
    1108 
    1109 % Fonts for indices and small examples (9pt).
    1110 % We actually use the slanted font rather than the italic,
    1111 % because texinfo normally uses the slanted fonts for that.
    1112 % Do not make many font distinctions in general in the index, since they
    1113 % aren't very useful.
    1114 \setfont\ninett\ttshape{9}{1000}
    1115 \setfont\indrm\rmshape{9}{1000}
    1116 \setfont\indit\slshape{9}{1000}
    1117 \let\indsl=\indit
    1118 \let\indtt=\ninett
    1119 \let\indttsl=\ninett
    1120 \let\indsf=\indrm
    1121 \let\indbf=\indrm
    1122 \setfont\indsc\scshape{10}{900}
    1123 \font\indi=cmmi9
    1124 \font\indsy=cmsy9
    1125 
    1126 % Chapter (and unnumbered) fonts (17.28pt).
    1127 \setfont\chaprm\rmbshape{12}{\magstep2}
    1128 \setfont\chapit\itbshape{10}{\magstep3}
    1129 \setfont\chapsl\slbshape{10}{\magstep3}
    1130 \setfont\chaptt\ttbshape{12}{\magstep2}
    1131 \setfont\chapttsl\ttslshape{10}{\magstep3}
    1132 \setfont\chapsf\sfbshape{12}{\magstep2}
    1133 \let\chapbf=\chaprm
    1134 \setfont\chapsc\scbshape{10}{\magstep3}
    1135 \font\chapi=cmmi12 scaled \magstep2
    1136 \font\chapsy=cmsy10 scaled \magstep3
    1137 
    1138 % Section fonts (14.4pt).
    1139 \setfont\secrm\rmbshape{12}{\magstep1}
    1140 \setfont\secit\itbshape{10}{\magstep2}
    1141 \setfont\secsl\slbshape{10}{\magstep2}
    1142 \setfont\sectt\ttbshape{12}{\magstep1}
    1143 \setfont\secttsl\ttslshape{10}{\magstep2}
    1144 \setfont\secsf\sfbshape{12}{\magstep1}
    1145 \let\secbf\secrm
    1146 \setfont\secsc\scbshape{10}{\magstep2}
    1147 \font\seci=cmmi12 scaled \magstep1
    1148 \font\secsy=cmsy10 scaled \magstep2
    1149 
    1150 % \setfont\ssecrm\bxshape{10}{\magstep1}    % This size an font looked bad.
    1151 % \setfont\ssecit\itshape{10}{\magstep1}    % The letters were too crowded.
    1152 % \setfont\ssecsl\slshape{10}{\magstep1}
    1153 % \setfont\ssectt\ttshape{10}{\magstep1}
    1154 % \setfont\ssecsf\sfshape{10}{\magstep1}
    1155 
    1156 %\setfont\ssecrm\bfshape{10}{1315}      % Note the use of cmb rather than cmbx.
    1157 %\setfont\ssecit\itshape{10}{1315}      % Also, the size is a little larger than
    1158 %\setfont\ssecsl\slshape{10}{1315}      % being scaled magstep1.
    1159 %\setfont\ssectt\ttshape{10}{1315}
    1160 %\setfont\ssecsf\sfshape{10}{1315}
    1161 
    1162 %\let\ssecbf=\ssecrm
    1163 
    1164 % Subsection fonts (13.15pt).
    1165 \setfont\ssecrm\rmbshape{12}{\magstephalf}
    1166 \setfont\ssecit\itbshape{10}{1315}
    1167 \setfont\ssecsl\slbshape{10}{1315}
    1168 \setfont\ssectt\ttbshape{12}{\magstephalf}
    1169 \setfont\ssecttsl\ttslshape{10}{\magstep1}
    1170 \setfont\ssecsf\sfbshape{12}{\magstephalf}
    1171 \let\ssecbf\ssecrm
    1172 \setfont\ssecsc\scbshape{10}{\magstep1}
    1173 \font\sseci=cmmi12 scaled \magstephalf
    1174 \font\ssecsy=cmsy10 scaled \magstep1
    1175 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
    1176 % but that is not a standard magnification.
    1177 
    1178 % Fonts for title page:
    1179 \setfont\titlerm\rmbshape{12}{\magstep3}
    1180 \let\authorrm = \secrm
    1181 
    1182 % In order for the font changes to affect most math symbols and letters,
    1183 % we have to define the \textfont of the standard families.  Since
    1184 % texinfo doesn't allow for producing subscripts and superscripts, we
    1185 % don't bother to reset \scriptfont and \scriptscriptfont (which would
    1186 % also require loading a lot more fonts).
    1187 %
    1188 \def\resetmathfonts{%
    1189   \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
    1190   \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
    1191   \textfont\ttfam = \tentt \textfont\sffam = \tensf
    1192 }
    1193 
    1194 
    1195 % The font-changing commands redefine the meanings of \tenSTYLE, instead
    1196 % of just \STYLE.  We do this so that font changes will continue to work
    1197 % in math mode, where it is the current \fam that is relevant in most
    1198 % cases, not the current font.  Plain TeX does \def\bf{\fam=\bffam
    1199 % \tenbf}, for example.  By redefining \tenbf, we obviate the need to
    1200 % redefine \bf itself.
    1201 \def\textfonts{%
    1202   \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
    1203   \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
    1204   \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
    1205   \resetmathfonts}
    1206 \def\chapfonts{%
    1207   \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
    1208   \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
    1209   \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
    1210   \resetmathfonts \setleading{19pt}}
    1211 \def\secfonts{%
    1212   \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
    1213   \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
    1214   \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
    1215   \resetmathfonts \setleading{16pt}}
    1216 \def\subsecfonts{%
    1217   \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
    1218   \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
    1219   \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
    1220   \resetmathfonts \setleading{15pt}}
    1221 \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
    1222 \def\indexfonts{%
    1223   \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
    1224   \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
    1225   \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
    1226   \resetmathfonts \setleading{12pt}}
    1227 
    1228 % Set up the default fonts, so we can use them for creating boxes.
    1229 %
    1230 \textfonts
    1231 
    1232 % Count depth in font-changes, for error checks
    1233 \newcount\fontdepth \fontdepth=0
    1234 
    1235 % Fonts for short table of contents.
    1236 \setfont\shortcontrm\rmshape{12}{1000}
    1237 \setfont\shortcontbf\bxshape{12}{1000}
    1238 \setfont\shortcontsl\slshape{12}{1000}
    1239 
    1240 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
    1241 %% serif) and @ii for TeX italic
    1242 
    1243 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
    1244 % unless the following character is such as not to need one.
    1245 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
    1246 \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
    1247 
    1248 \let\i=\smartitalic
    1249 \let\var=\smartitalic
    1250 \let\dfn=\smartitalic
    1251 \let\emph=\smartitalic
    1252 \let\cite=\smartitalic
    1253 
    1254 \def\b#1{{\bf #1}}
    1255 \let\strong=\b
    1256 
    1257 % We can't just use \exhyphenpenalty, because that only has effect at
    1258 % the end of a paragraph.  Restore normal hyphenation at the end of the
    1259 % group within which \nohyphenation is presumably called.
    1260 %
    1261 \def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
    1262 \def\restorehyphenation{\hyphenchar\font = `- }
    1263 
    1264 \def\t#1{%
    1265   {\tt \rawbackslash \frenchspacing #1}%
    1266   \null
    1267 }
    1268 \let\ttfont=\t
    1269 \def\samp #1{`\tclose{#1}'\null}
    1270 \setfont\smallrm\rmshape{8}{1000}
    1271 \font\smallsy=cmsy9
    1272 \def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
    1273   \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
    1274     \vbox{\hrule\kern-0.4pt
    1275      \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
    1276     \kern-0.4pt\hrule}%
    1277   \kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
    1278 % The old definition, with no lozenge:
    1279 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
    1280 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
    1281 
    1282 \let\file=\samp
    1283 %\let\url=\samp % perhaps include a hypertex \special eventually
    1284 %\def\email#1{$\langle${\tt #1}$\rangle$}
    1285 
    1286 % @code is a modification of @t,
    1287 % which makes spaces the same size as normal in the surrounding text.
    1288 \def\tclose#1{%
    1289   {%
    1290     % Change normal interword space to be same as for the current font.
    1291     \spaceskip = \fontdimen2\font
    1292     %
    1293     % Switch to typewriter.
    1294     \tt
    1295     %
    1296     % But `\ ' produces the large typewriter interword space.
    1297     \def\ {{\spaceskip = 0pt{} }}%
    1298     %
    1299     % Turn off hyphenation.
    1300     \nohyphenation
    1301     %
    1302     \rawbackslash
    1303     \frenchspacing
    1304     #1%
    1305   }%
    1306   \null
    1307 }
    1308 
    1309 % We *must* turn on hyphenation at `-' and `_' in \code.
    1310 % Otherwise, it is too hard to avoid overfull hboxes
    1311 % in the Emacs manual, the Library manual, etc.
    1312 
    1313 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
    1314 % both hyphenation at - and hyphenation within words.
    1315 % We must therefore turn them both off (\tclose does that)
    1316 % and arrange explicitly to hyphenate at a dash.
    1317 %  -- rms.
    1318 {
    1319 \catcode`\-=\active
    1320 \catcode`\_=\active
    1321 \catcode`\|=\active
    1322 \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
    1323 % The following is used by \doprintindex to insure that long function names
    1324 % wrap around.  It is necessary for - and _ to be active before the index is
    1325 % read from the file, as \entry parses the arguments long before \code is
    1326 % ever called.  -- mycroft
    1327 % _ is always active; and it shouldn't be \let = to an _ that is a
    1328 % subscript character anyway. Then, @cindex @samp{_} (for example)
    1329 % fails.  --karl
    1330 \global\def\indexbreaks{%
    1331   \catcode`\-=\active \let-\realdash
    1332 }
    1333 }
    1334 
    1335 \def\realdash{-}
    1336 \def\codedash{-\discretionary{}{}{}}
    1337 \def\codeunder{\normalunderscore\discretionary{}{}{}}
    1338 \def\codex #1{\tclose{#1}\endgroup}
    1339 
    1340 %\let\exp=\tclose  %Was temporary
    1341 
    1342 % @kbd is like @code, except that if the argument is just one @key command,
    1343 % then @kbd has no effect.
    1344 %
    1345 \def\xkey{\key}
    1346 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
    1347 \ifx\one\xkey\ifx\threex\three \key{#2}%
    1348 \else{\tclose{\ttsl\look}}\fi
    1349 \else{\tclose{\ttsl\look}}\fi}
    1350 
    1351 % @url.  Quotes do not seem necessary, so use \code.
    1352 \let\url=\code
    1353 
    1354 % @uref (abbreviation for `urlref') takes an optional second argument
    1355 % specifying the text to display.  First (mandatory) arg is the url.
    1356 % Perhaps eventually put in a hypertex \special here.
    1357 %
    1358 \def\uref#1{\urefxxx #1,,\finish}
    1359 \def\urefxxx#1,#2,#3\finish{%
    1360   \setbox0 = \hbox{\ignorespaces #2}%
    1361   \ifdim\wd0 > 0pt
    1362     \unhbox0\ (\code{#1})%
    1363   \else
    1364     \code{#1}%
    1365   \fi
    1366 }
    1367 
    1368 % rms does not like the angle brackets --karl, 17may97.
    1369 % So now @email is just like @uref.
    1370 %\def\email#1{\angleleft{\tt #1}\angleright}
    1371 \let\email=\uref
    1372 
    1373 % Check if we are currently using a typewriter font.  Since all the
    1374 % Computer Modern typewriter fonts have zero interword stretch (and
    1375 % shrink), and it is reasonable to expect all typewriter fonts to have
    1376 % this property, we can check that font parameter.
    1377 %
    1378 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
    1379 
    1380 % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
    1381 % argument is to make the input look right: @dmn{pt} instead of
    1382 % @dmn{}pt.
    1383 %
    1384 \def\dmn#1{\thinspace #1}
    1385 
    1386 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
    1387 
    1388 % @l was never documented to mean ``switch to the Lisp font'',
    1389 % and it is not used as such in any manual I can find.  We need it for
    1390 % Polish suppressed-l.  --karl, 22sep96.
    1391 %\def\l#1{{\li #1}\null}
    1392 
    1393 \def\r#1{{\rm #1}}              % roman font
    1394 % Use of \lowercase was suggested.
    1395 \def\sc#1{{\smallcaps#1}}       % smallcaps font
    1396 \def\ii#1{{\it #1}}             % italic font
    1397 
    1398 % @pounds{} is a sterling sign.
    1399 \def\pounds{{\it\$}}
    1400 
    1401 
    1402 \message{page headings,}
    1403 
    1404 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
    1405 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
    1406 
    1407 % First the title page.  Must do @settitle before @titlepage.
    1408 \def\titlefont#1{{\titlerm #1}}
    1409 
    1410 \newif\ifseenauthor
    1411 \newif\iffinishedtitlepage
    1412 
    1413 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
    1414 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
    1415         \endgroup\page\hbox{}\page}
    1416 
    1417 \def\titlepage{\begingroup \parindent=0pt \textfonts
    1418    \let\subtitlerm=\tenrm
    1419 % I deinstalled the following change because \cmr12 is undefined.
    1420 % This change was not in the ChangeLog anyway.  --rms.
    1421 %   \let\subtitlerm=\cmr12
    1422    \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
    1423    %
    1424    \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
    1425    %
    1426    % Leave some space at the very top of the page.
    1427    \vglue\titlepagetopglue
    1428    %
    1429    % Now you can print the title using @title.
    1430    \def\title{\parsearg\titlezzz}%
    1431    \def\titlezzz##1{\leftline{\titlefont{##1}}
    1432                     % print a rule at the page bottom also.
    1433                     \finishedtitlepagefalse
    1434                     \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
    1435    % No rule at page bottom unless we print one at the top with @title.
    1436    \finishedtitlepagetrue
    1437    %
    1438    % Now you can put text using @subtitle.
    1439    \def\subtitle{\parsearg\subtitlezzz}%
    1440    \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
    1441    %
    1442    % @author should come last, but may come many times.
    1443    \def\author{\parsearg\authorzzz}%
    1444    \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
    1445       {\authorfont \leftline{##1}}}%
    1446    %
    1447    % Most title ``pages'' are actually two pages long, with space
    1448    % at the top of the second.  We don't want the ragged left on the second.
    1449    \let\oldpage = \page
    1450    \def\page{%
    1451       \iffinishedtitlepage\else
    1452          \finishtitlepage
    1453       \fi
    1454       \oldpage
    1455       \let\page = \oldpage
    1456       \hbox{}}%
    1457 %   \def\page{\oldpage \hbox{}}
    1458 }
    1459 
    1460 \def\Etitlepage{%
    1461    \iffinishedtitlepage\else
    1462       \finishtitlepage
    1463    \fi
    1464    % It is important to do the page break before ending the group,
    1465    % because the headline and footline are only empty inside the group.
    1466    % If we use the new definition of \page, we always get a blank page
    1467    % after the title page, which we certainly don't want.
    1468    \oldpage
    1469    \endgroup
    1470    \HEADINGSon
    1471 }
    1472 
    1473 \def\finishtitlepage{%
    1474    \vskip4pt \hrule height 2pt width \hsize
    1475    \vskip\titlepagebottomglue
    1476    \finishedtitlepagetrue
    1477 }
    1478 
    1479 %%% Set up page headings and footings.
    1480 
    1481 \let\thispage=\folio
    1482 
    1483 \newtoks \evenheadline    % Token sequence for heading line of even pages
    1484 \newtoks \oddheadline     % Token sequence for heading line of odd pages
    1485 \newtoks \evenfootline    % Token sequence for footing line of even pages
    1486 \newtoks \oddfootline     % Token sequence for footing line of odd pages
    1487 
    1488 % Now make Tex use those variables
    1489 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
    1490                             \else \the\evenheadline \fi}}
    1491 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
    1492                             \else \the\evenfootline \fi}\HEADINGShook}
    1493 \let\HEADINGShook=\relax
    1494 
    1495 % Commands to set those variables.
    1496 % For example, this is what  @headings on  does
    1497 % @evenheading @thistitle|@thispage|@thischapter
    1498 % @oddheading @thischapter|@thispage|@thistitle
    1499 % @evenfooting @thisfile||
    1500 % @oddfooting ||@thisfile
    1501 
    1502 \def\evenheading{\parsearg\evenheadingxxx}
    1503 \def\oddheading{\parsearg\oddheadingxxx}
    1504 \def\everyheading{\parsearg\everyheadingxxx}
    1505 
    1506 \def\evenfooting{\parsearg\evenfootingxxx}
    1507 \def\oddfooting{\parsearg\oddfootingxxx}
    1508 \def\everyfooting{\parsearg\everyfootingxxx}
    1509 
    1510 {\catcode`\@=0 %
    1511 
    1512 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
    1513 \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
    1514 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
    1515 
    1516 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
    1517 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
    1518 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
    1519 
    1520 \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
    1521 \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
    1522 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
    1523 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
    1524 
    1525 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
    1526 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
    1527 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
    1528 
    1529 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
    1530 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
    1531 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
    1532 
    1533 \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
    1534 \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
    1535 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
    1536 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
    1537 %
    1538 }% unbind the catcode of @.
    1539 
    1540 % @headings double      turns headings on for double-sided printing.
    1541 % @headings single      turns headings on for single-sided printing.
    1542 % @headings off         turns them off.
    1543 % @headings on          same as @headings double, retained for compatibility.
    1544 % @headings after       turns on double-sided headings after this page.
    1545 % @headings doubleafter turns on double-sided headings after this page.
    1546 % @headings singleafter turns on single-sided headings after this page.
    1547 % By default, they are off at the start of a document,
    1548 % and turned `on' after @end titlepage.
    1549 
    1550 \def\headings #1 {\csname HEADINGS#1\endcsname}
    1551 
    1552 \def\HEADINGSoff{
    1553 \global\evenheadline={\hfil} \global\evenfootline={\hfil}
    1554 \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
    1555 \HEADINGSoff
    1556 % When we turn headings on, set the page number to 1.
    1557 % For double-sided printing, put current file name in lower left corner,
    1558 % chapter name on inside top of right hand pages, document
    1559 % title on inside top of left hand pages, and page numbers on outside top
    1560 % edge of all pages.
    1561 \def\HEADINGSdouble{
    1562 \global\pageno=1
    1563 \global\evenfootline={\hfil}
    1564 \global\oddfootline={\hfil}
    1565 \global\evenheadline={\line{\folio\hfil\thistitle}}
    1566 \global\oddheadline={\line{\thischapter\hfil\folio}}
    1567 \global\let\contentsalignmacro = \chapoddpage
    1568 }
    1569 \let\contentsalignmacro = \chappager
    1570 
    1571 % For single-sided printing, chapter title goes across top left of page,
    1572 % page number on top right.
    1573 \def\HEADINGSsingle{
    1574 \global\pageno=1
    1575 \global\evenfootline={\hfil}
    1576 \global\oddfootline={\hfil}
    1577 \global\evenheadline={\line{\thischapter\hfil\folio}}
    1578 \global\oddheadline={\line{\thischapter\hfil\folio}}
    1579 \global\let\contentsalignmacro = \chappager
    1580 }
    1581 \def\HEADINGSon{\HEADINGSdouble}
    1582 
    1583 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
    1584 \let\HEADINGSdoubleafter=\HEADINGSafter
    1585 \def\HEADINGSdoublex{%
    1586 \global\evenfootline={\hfil}
    1587 \global\oddfootline={\hfil}
    1588 \global\evenheadline={\line{\folio\hfil\thistitle}}
    1589 \global\oddheadline={\line{\thischapter\hfil\folio}}
    1590 \global\let\contentsalignmacro = \chapoddpage
    1591 }
    1592 
    1593 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
    1594 \def\HEADINGSsinglex{%
    1595 \global\evenfootline={\hfil}
    1596 \global\oddfootline={\hfil}
    1597 \global\evenheadline={\line{\thischapter\hfil\folio}}
    1598 \global\oddheadline={\line{\thischapter\hfil\folio}}
    1599 \global\let\contentsalignmacro = \chappager
    1600 }
    1601 
    1602 % Subroutines used in generating headings
    1603 % Produces Day Month Year style of output.
    1604 \def\today{\number\day\space
    1605 \ifcase\month\or
    1606 January\or February\or March\or April\or May\or June\or
    1607 July\or August\or September\or October\or November\or December\fi
    1608 \space\number\year}
    1609 
    1610 % Use this if you want the Month Day, Year style of output.
    1611 %\def\today{\ifcase\month\or
    1612 %January\or February\or March\or April\or May\or June\or
    1613 %July\or August\or September\or October\or November\or December\fi
    1614 %\space\number\day, \number\year}
    1615 
    1616 % @settitle line...  specifies the title of the document, for headings
    1617 % It generates no output of its own
    1618 
    1619 \def\thistitle{No Title}
    1620 \def\settitle{\parsearg\settitlezzz}
    1621 \def\settitlezzz #1{\gdef\thistitle{#1}}
    1622 
    1623 
    1624 \message{tables,}
    1625 
    1626 % @tabs -- simple alignment
    1627 
    1628 % These don't work.  For one thing, \+ is defined as outer.
    1629 % So these macros cannot even be defined.
    1630 
    1631 %\def\tabs{\parsearg\tabszzz}
    1632 %\def\tabszzz #1{\settabs\+#1\cr}
    1633 %\def\tabline{\parsearg\tablinezzz}
    1634 %\def\tablinezzz #1{\+#1\cr}
    1635 %\def\&{&}
    1636 
    1637 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
    1638 
    1639 % default indentation of table text
    1640 \newdimen\tableindent \tableindent=.8in
    1641 % default indentation of @itemize and @enumerate text
    1642 \newdimen\itemindent  \itemindent=.3in
    1643 % margin between end of table item and start of table text.
    1644 \newdimen\itemmargin  \itemmargin=.1in
    1645 
    1646 % used internally for \itemindent minus \itemmargin
    1647 \newdimen\itemmax
    1648 
    1649 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
    1650 % these defs.
    1651 % They also define \itemindex
    1652 % to index the item name in whatever manner is desired (perhaps none).
    1653 
    1654 \newif\ifitemxneedsnegativevskip
    1655 
    1656 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
    1657 
    1658 \def\internalBitem{\smallbreak \parsearg\itemzzz}
    1659 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
    1660 
    1661 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
    1662 \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
    1663 
    1664 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
    1665 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
    1666 
    1667 \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
    1668                  \itemzzz {#1}}
    1669 
    1670 \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
    1671                  \itemzzz {#1}}
    1672 
    1673 \def\itemzzz #1{\begingroup %
    1674   \advance\hsize by -\rightskip
    1675   \advance\hsize by -\tableindent
    1676   \setbox0=\hbox{\itemfont{#1}}%
    1677   \itemindex{#1}%
    1678   \nobreak % This prevents a break before @itemx.
    1679   %
    1680   % Be sure we are not still in the middle of a paragraph.
    1681   %{\parskip = 0in
    1682   %\par
    1683   %}%
    1684   %
    1685   % If the item text does not fit in the space we have, put it on a line
    1686   % by itself, and do not allow a page break either before or after that
    1687   % line.  We do not start a paragraph here because then if the next
    1688   % command is, e.g., @kindex, the whatsit would get put into the
    1689   % horizontal list on a line by itself, resulting in extra blank space.
    1690   \ifdim \wd0>\itemmax
    1691     %
    1692     % Make this a paragraph so we get the \parskip glue and wrapping,
    1693     % but leave it ragged-right.
    1694     \begingroup
    1695       \advance\leftskip by-\tableindent
    1696       \advance\hsize by\tableindent
    1697       \advance\rightskip by0pt plus1fil
    1698       \leavevmode\unhbox0\par
    1699     \endgroup
    1700     %
    1701     % We're going to be starting a paragraph, but we don't want the
    1702     % \parskip glue -- logically it's part of the @item we just started.
    1703     \nobreak \vskip-\parskip
    1704     %
    1705     % Stop a page break at the \parskip glue coming up.  Unfortunately
    1706     % we can't prevent a possible page break at the following
    1707     % \baselineskip glue.
    1708     \nobreak
    1709     \endgroup
    1710     \itemxneedsnegativevskipfalse
    1711   \else
    1712     % The item text fits into the space.  Start a paragraph, so that the
    1713     % following text (if any) will end up on the same line.  Since that
    1714     % text will be indented by \tableindent, we make the item text be in
    1715     % a zero-width box.
    1716     \noindent
    1717     \rlap{\hskip -\tableindent\box0}\ignorespaces%
    1718     \endgroup%
    1719     \itemxneedsnegativevskiptrue%
    1720   \fi
    1721 }
    1722 
    1723 \def\item{\errmessage{@item while not in a table}}
    1724 \def\itemx{\errmessage{@itemx while not in a table}}
    1725 \def\kitem{\errmessage{@kitem while not in a table}}
    1726 \def\kitemx{\errmessage{@kitemx while not in a table}}
    1727 \def\xitem{\errmessage{@xitem while not in a table}}
    1728 \def\xitemx{\errmessage{@xitemx while not in a table}}
    1729 
    1730 %% Contains a kludge to get @end[description] to work
    1731 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
    1732 
    1733 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
    1734 {\obeylines\obeyspaces%
    1735 \gdef\tablex #1^^M{%
    1736 \tabley\dontindex#1        \endtabley}}
    1737 
    1738 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
    1739 {\obeylines\obeyspaces%
    1740 \gdef\ftablex #1^^M{%
    1741 \tabley\fnitemindex#1        \endtabley
    1742 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
    1743 \let\Etable=\relax}}
    1744 
    1745 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
    1746 {\obeylines\obeyspaces%
    1747 \gdef\vtablex #1^^M{%
    1748 \tabley\vritemindex#1        \endtabley
    1749 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
    1750 \let\Etable=\relax}}
    1751 
    1752 \def\dontindex #1{}
    1753 \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
    1754 \def\vritemindex #1{\doind {vr}{\code{#1}}}%
    1755 
    1756 {\obeyspaces %
    1757 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
    1758 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
    1759 
    1760 \def\tablez #1#2#3#4#5#6{%
    1761 \aboveenvbreak %
    1762 \begingroup %
    1763 \def\Edescription{\Etable}% Necessary kludge.
    1764 \let\itemindex=#1%
    1765 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
    1766 \ifnum 0#4>0 \tableindent=#4\mil \fi %
    1767 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
    1768 \def\itemfont{#2}%
    1769 \itemmax=\tableindent %
    1770 \advance \itemmax by -\itemmargin %
    1771 \advance \leftskip by \tableindent %
    1772 \exdentamount=\tableindent
    1773 \parindent = 0pt
    1774 \parskip = \smallskipamount
    1775 \ifdim \parskip=0pt \parskip=2pt \fi%
    1776 \def\Etable{\endgraf\afterenvbreak\endgroup}%
    1777 \let\item = \internalBitem %
    1778 \let\itemx = \internalBitemx %
    1779 \let\kitem = \internalBkitem %
    1780 \let\kitemx = \internalBkitemx %
    1781 \let\xitem = \internalBxitem %
    1782 \let\xitemx = \internalBxitemx %
    1783 }
    1784 
    1785 % This is the counter used by @enumerate, which is really @itemize
    1786 
    1787 \newcount \itemno
    1788 
    1789 \def\itemize{\parsearg\itemizezzz}
    1790 
    1791 \def\itemizezzz #1{%
    1792   \begingroup % ended by the @end itemsize
    1793   \itemizey {#1}{\Eitemize}
    1794 }
    1795 
    1796 \def\itemizey #1#2{%
    1797 \aboveenvbreak %
    1798 \itemmax=\itemindent %
    1799 \advance \itemmax by -\itemmargin %
    1800 \advance \leftskip by \itemindent %
    1801 \exdentamount=\itemindent
    1802 \parindent = 0pt %
    1803 \parskip = \smallskipamount %
    1804 \ifdim \parskip=0pt \parskip=2pt \fi%
    1805 \def#2{\endgraf\afterenvbreak\endgroup}%
    1806 \def\itemcontents{#1}%
    1807 \let\item=\itemizeitem}
    1808 
    1809 % Set sfcode to normal for the chars that usually have another value.
    1810 % These are `.?!:;,'
    1811 \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
    1812   \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
    1813 
    1814 % \splitoff TOKENS\endmark defines \first to be the first token in
    1815 % TOKENS, and \rest to be the remainder.
    1816 %
    1817 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
    1818 
    1819 % Allow an optional argument of an uppercase letter, lowercase letter,
    1820 % or number, to specify the first label in the enumerated list.  No
    1821 % argument is the same as `1'.
    1822 %
    1823 \def\enumerate{\parsearg\enumeratezzz}
    1824 \def\enumeratezzz #1{\enumeratey #1  \endenumeratey}
    1825 \def\enumeratey #1 #2\endenumeratey{%
    1826   \begingroup % ended by the @end enumerate
    1827   %
    1828   % If we were given no argument, pretend we were given `1'.
    1829   \def\thearg{#1}%
    1830   \ifx\thearg\empty \def\thearg{1}\fi
    1831   %
    1832   % Detect if the argument is a single token.  If so, it might be a
    1833   % letter.  Otherwise, the only valid thing it can be is a number.
    1834   % (We will always have one token, because of the test we just made.
    1835   % This is a good thing, since \splitoff doesn't work given nothing at
    1836   % all -- the first parameter is undelimited.)
    1837   \expandafter\splitoff\thearg\endmark
    1838   \ifx\rest\empty
    1839     % Only one token in the argument.  It could still be anything.
    1840     % A ``lowercase letter'' is one whose \lccode is nonzero.
    1841     % An ``uppercase letter'' is one whose \lccode is both nonzero, and
    1842     %   not equal to itself.
    1843     % Otherwise, we assume it's a number.
    1844     %
    1845     % We need the \relax at the end of the \ifnum lines to stop TeX from
    1846     % continuing to look for a <number>.
    1847     %
    1848     \ifnum\lccode\expandafter`\thearg=0\relax
    1849       \numericenumerate % a number (we hope)
    1850     \else
    1851       % It's a letter.
    1852       \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
    1853         \lowercaseenumerate % lowercase letter
    1854       \else
    1855         \uppercaseenumerate % uppercase letter
    1856       \fi
    1857     \fi
    1858   \else
    1859     % Multiple tokens in the argument.  We hope it's a number.
    1860     \numericenumerate
    1861   \fi
    1862 }
    1863 
    1864 % An @enumerate whose labels are integers.  The starting integer is
    1865 % given in \thearg.
    1866 %
    1867 \def\numericenumerate{%
    1868   \itemno = \thearg
    1869   \startenumeration{\the\itemno}%
    1870 }
    1871 
    1872 % The starting (lowercase) letter is in \thearg.
    1873 \def\lowercaseenumerate{%
    1874   \itemno = \expandafter`\thearg
    1875   \startenumeration{%
    1876     % Be sure we're not beyond the end of the alphabet.
    1877     \ifnum\itemno=0
    1878       \errmessage{No more lowercase letters in @enumerate; get a bigger
    1879                   alphabet}%
    1880     \fi
    1881     \char\lccode\itemno
    1882   }%
    1883 }
    1884 
    1885 % The starting (uppercase) letter is in \thearg.
    1886 \def\uppercaseenumerate{%
    1887   \itemno = \expandafter`\thearg
    1888   \startenumeration{%
    1889     % Be sure we're not beyond the end of the alphabet.
    1890     \ifnum\itemno=0
    1891       \errmessage{No more uppercase letters in @enumerate; get a bigger
    1892                   alphabet}
    1893     \fi
    1894     \char\uccode\itemno
    1895   }%
    1896 }
    1897 
    1898 % Call itemizey, adding a period to the first argument and supplying the
    1899 % common last two arguments.  Also subtract one from the initial value in
    1900 % \itemno, since @item increments \itemno.
    1901 %
    1902 \def\startenumeration#1{%
    1903   \advance\itemno by -1
    1904   \itemizey{#1.}\Eenumerate\flushcr
    1905 }
    1906 
    1907 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
    1908 % to @enumerate.
    1909 %
    1910 \def\alphaenumerate{\enumerate{a}}
    1911 \def\capsenumerate{\enumerate{A}}
    1912 \def\Ealphaenumerate{\Eenumerate}
    1913 \def\Ecapsenumerate{\Eenumerate}
    1914 
    1915 % Definition of @item while inside @itemize.
    1916 
    1917 \def\itemizeitem{%
    1918 \advance\itemno by 1
    1919 {\let\par=\endgraf \smallbreak}%
    1920 \ifhmode \errmessage{\in hmode at itemizeitem}\fi
    1921 {\parskip=0in \hskip 0pt
    1922 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
    1923 \vadjust{\penalty 1200}}%
    1924 \flushcr}
    1925 
    1926 % @multitable macros
    1927 % Amy Hendrickson, 8/18/94, 3/6/96
    1928 %
    1929 % @multitable ... @end multitable will make as many columns as desired.
    1930 % Contents of each column will wrap at width given in preamble.  Width
    1931 % can be specified either with sample text given in a template line,
    1932 % or in percent of \hsize, the current width of text on page.
    1933 
    1934 % Table can continue over pages but will only break between lines.
    1935 
    1936 % To make preamble:
    1937 %
    1938 % Either define widths of columns in terms of percent of \hsize:
    1939 %   @multitable @columnfractions .25 .3 .45
    1940 %   @item ...
    1941 %
    1942 %   Numbers following @columnfractions are the percent of the total
    1943 %   current hsize to be used for each column. You may use as many
    1944 %   columns as desired.
    1945 
    1946 
    1947 % Or use a template:
    1948 %   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
    1949 %   @item ...
    1950 %   using the widest term desired in each column.
    1951 %
    1952 % For those who want to use more than one line's worth of words in
    1953 % the preamble, break the line within one argument and it
    1954 % will parse correctly, i.e.,
    1955 %
    1956 %     @multitable {Column 1 template} {Column 2 template} {Column 3
    1957 %      template}
    1958 % Not:
    1959 %     @multitable {Column 1 template} {Column 2 template}
    1960 %      {Column 3 template}
    1961 
    1962 % Each new table line starts with @item, each subsequent new column
    1963 % starts with @tab. Empty columns may be produced by supplying @tab's
    1964 % with nothing between them for as many times as empty columns are needed,
    1965 % ie, @tab@tab@tab will produce two empty columns.
    1966 
    1967 % @item, @tab, @multitable or @end multitable do not need to be on their
    1968 % own lines, but it will not hurt if they are.
    1969 
    1970 % Sample multitable:
    1971 
    1972 %   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
    1973 %   @item first col stuff @tab second col stuff @tab third col
    1974 %   @item
    1975 %   first col stuff
    1976 %   @tab
    1977 %   second col stuff
    1978 %   @tab
    1979 %   third col
    1980 %   @item first col stuff @tab second col stuff
    1981 %   @tab Many paragraphs of text may be used in any column.
    1982 %
    1983 %         They will wrap at the width determined by the template.
    1984 %   @item@tab@tab This will be in third column.
    1985 %   @end multitable
    1986 
    1987 % Default dimensions may be reset by user.
    1988 % @multitableparskip is vertical space between paragraphs in table.
    1989 % @multitableparindent is paragraph indent in table.
    1990 % @multitablecolmargin is horizontal space to be left between columns.
    1991 % @multitablelinespace is space to leave between table items, baseline
    1992 %                                                            to baseline.
    1993 %   0pt means it depends on current normal line spacing.
    1994 
    1995 %%%%
    1996 % Dimensions
    1997 
    1998 \newskip\multitableparskip
    1999 \newskip\multitableparindent
    2000 \newdimen\multitablecolspace
    2001 \newskip\multitablelinespace
    2002 \multitableparskip=0pt
    2003 \multitableparindent=6pt
    2004 \multitablecolspace=12pt
    2005 \multitablelinespace=0pt
    2006 
    2007 %%%%
    2008 % Macros used to set up halign preamble:
    2009 \let\endsetuptable\relax
    2010 \def\xendsetuptable{\endsetuptable}
    2011 \let\columnfractions\relax
    2012 \def\xcolumnfractions{\columnfractions}
    2013 \newif\ifsetpercent
    2014 
    2015 %% 2/1/96, to allow fractions to be given with more than one digit.
    2016 \def\pickupwholefraction#1 {\global\advance\colcount by1 %
    2017 \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
    2018 \setuptable}
    2019 
    2020 \newcount\colcount
    2021 \def\setuptable#1{\def\firstarg{#1}%
    2022 \ifx\firstarg\xendsetuptable\let\go\relax%
    2023 \else
    2024   \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
    2025   \else
    2026     \ifsetpercent
    2027        \let\go\pickupwholefraction   % In this case arg of setuptable
    2028                                      % is the decimal point before the
    2029                                      % number given in percent of hsize.
    2030                                      % We don't need this so we don't use it.
    2031     \else
    2032        \global\advance\colcount by1
    2033        \setbox0=\hbox{#1 }% Add a normal word space as a separator;
    2034                           % typically that is always in the input, anyway.
    2035        \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
    2036     \fi%
    2037   \fi%
    2038 \ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
    2039 \fi\go}
    2040 
    2041 %%%%
    2042 % multitable syntax
    2043 \def\tab{&\hskip1sp\relax} % 2/2/96
    2044                            % tiny skip here makes sure this column space is
    2045                            % maintained, even if it is never used.
    2046 
    2047 
    2048 %%%%
    2049 % @multitable ... @end multitable definitions:
    2050 
    2051 \def\multitable{\parsearg\dotable}
    2052 
    2053 \def\dotable#1{\bgroup
    2054 \let\item\cr
    2055 \tolerance=9500
    2056 \hbadness=9500
    2057 \setmultitablespacing
    2058 \parskip=\multitableparskip
    2059 \parindent=\multitableparindent
    2060 \overfullrule=0pt
    2061 \global\colcount=0\relax%
    2062 \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
    2063  % To parse everything between @multitable and @item :
    2064 \setuptable#1 \endsetuptable
    2065  % Need to reset this to 0 after \setuptable.
    2066 \global\colcount=0\relax%
    2067  %
    2068  % This preamble sets up a generic column definition, which will
    2069  % be used as many times as user calls for columns.
    2070  % \vtop will set a single line and will also let text wrap and
    2071  % continue for many paragraphs if desired.
    2072 \halign\bgroup&\global\advance\colcount by 1\relax%
    2073 \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
    2074  % In order to keep entries from bumping into each other
    2075  % we will add a \leftskip of \multitablecolspace to all columns after
    2076  % the first one.
    2077  %  If a template has been used, we will add \multitablecolspace
    2078  % to the width of each template entry.
    2079  %  If user has set preamble in terms of percent of \hsize
    2080  % we will use that dimension as the width of the column, and
    2081  % the \leftskip will keep entries from bumping into each other.
    2082  % Table will start at left margin and final column will justify at
    2083  % right margin.
    2084 \ifnum\colcount=1
    2085 \else
    2086   \ifsetpercent
    2087   \else
    2088    % If user has <not> set preamble in terms of percent of \hsize
    2089    % we will advance \hsize by \multitablecolspace
    2090   \advance\hsize by \multitablecolspace
    2091   \fi
    2092  % In either case we will make \leftskip=\multitablecolspace:
    2093 \leftskip=\multitablecolspace
    2094 \fi
    2095  % Ignoring space at the beginning and end avoids an occasional spurious
    2096  % blank line, when TeX decides to break the line at the space before the
    2097  % box from the multistrut, so the strut ends up on a line by itself.
    2098  % For example:
    2099  % @multitable @columnfractions .11 .89
    2100  % @item @code{#}
    2101  % @tab Legal holiday which is valid in major parts of the whole country.
    2102  % Is automatically provided with highlighting sequences respectively marking
    2103  % characters.
    2104  \noindent\ignorespaces##\unskip\multistrut}\cr
    2105  % \everycr will reset column counter, \colcount, at the end of
    2106  % each line. Every column  entry will cause \colcount to advance by one.
    2107  % The table preamble
    2108  % looks at the current \colcount to find the correct column width.
    2109 \global\everycr{\noalign{%
    2110 % \filbreak%% keeps underfull box messages off when table breaks over pages.
    2111 % Maybe so, but it also creates really weird page breaks when the table
    2112 % breaks over pages Wouldn't \vfil be better?  Wait until the problem
    2113 % manifests itself, so it can be fixed for real --karl.
    2114 \global\colcount=0\relax}}
    2115 }
    2116 
    2117 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
    2118 % If so, do nothing. If not, give it an appropriate dimension based on
    2119 % current baselineskip.
    2120 \ifdim\multitablelinespace=0pt
    2121 %% strut to put in table in case some entry doesn't have descenders,
    2122 %% to keep lines equally spaced
    2123 \let\multistrut = \strut
    2124 %% Test to see if parskip is larger than space between lines of
    2125 %% table. If not, do nothing.
    2126 %%        If so, set to same dimension as multitablelinespace.
    2127 \else
    2128 \gdef\multistrut{\vrule height\multitablelinespace depth\dp0
    2129 width0pt\relax} \fi
    2130 \ifdim\multitableparskip>\multitablelinespace
    2131 \global\multitableparskip=\multitablelinespace
    2132 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
    2133                                       %% than skip between lines in the table.
    2134 \fi%
    2135 \ifdim\multitableparskip=0pt
    2136 \global\multitableparskip=\multitablelinespace
    2137 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
    2138                                       %% than skip between lines in the table.
    2139 \fi}
     2343% @defininfoenclose.
     2344\let\definfoenclose=\comment
    21402345
    21412346
     
    21552360% The name of an index should be no more than 2 characters long
    21562361% for the sake of vms.
    2157 
    2158 \def\newindex #1{
    2159 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
    2160 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
    2161 \expandafter\xdef\csname#1index\endcsname{%     % Define \xxxindex
    2162 \noexpand\doindex {#1}}
     2362%
     2363\def\newindex#1{%
     2364  \iflinks
     2365    \expandafter\newwrite \csname#1indfile\endcsname
     2366    \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
     2367  \fi
     2368  \expandafter\xdef\csname#1index\endcsname{%     % Define @#1index
     2369    \noexpand\doindex{#1}}
    21632370}
    21642371
     
    21692376% Define @defcodeindex, like @defindex except put all entries in @code.
    21702377
    2171 \def\newcodeindex #1{
    2172 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
    2173 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
    2174 \expandafter\xdef\csname#1index\endcsname{%     % Define \xxxindex
    2175 \noexpand\docodeindex {#1}}
     2378\def\newcodeindex#1{%
     2379  \iflinks
     2380    \expandafter\newwrite \csname#1indfile\endcsname
     2381    \openout \csname#1indfile\endcsname \jobname.#1
     2382  \fi
     2383  \expandafter\xdef\csname#1index\endcsname{%
     2384    \noexpand\docodeindex{#1}}
    21762385}
    21772386
     
    21802389% @synindex foo bar    makes index foo feed into index bar.
    21812390% Do this instead of @defindex foo if you don't want it as a separate index.
    2182 \def\synindex #1 #2 {%
    2183 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
    2184 \expandafter\let\csname#1indfile\endcsname=\synindexfoo
    2185 \expandafter\xdef\csname#1index\endcsname{%     % Define \xxxindex
    2186 \noexpand\doindex {#2}}%
     2391% The \closeout helps reduce unnecessary open files; the limit on the
     2392% Acorn RISC OS is a mere 16 files.
     2393\def\synindex#1 #2 {%
     2394  \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
     2395  \expandafter\closeout\csname#1indfile\endcsname
     2396  \expandafter\let\csname#1indfile\endcsname=\synindexfoo
     2397  \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
     2398    \noexpand\doindex{#2}}%
    21872399}
    21882400
    21892401% @syncodeindex foo bar   similar, but put all entries made for index foo
    21902402% inside @code.
    2191 \def\syncodeindex #1 #2 {%
    2192 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
    2193 \expandafter\let\csname#1indfile\endcsname=\synindexfoo
    2194 \expandafter\xdef\csname#1index\endcsname{%     % Define \xxxindex
    2195 \noexpand\docodeindex {#2}}%
     2403\def\syncodeindex#1 #2 {%
     2404  \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
     2405  \expandafter\closeout\csname#1indfile\endcsname
     2406  \expandafter\let\csname#1indfile\endcsname=\synindexfoo
     2407  \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
     2408    \noexpand\docodeindex{#2}}%
    21962409}
    21972410
     
    22142427
    22152428\def\indexdummies{%
     2429\def\ { }%
    22162430% Take care of the plain tex accent commands.
    22172431\def\"{\realbackslash "}%
     
    22432457% laboriously list every single command here.)
    22442458\def\@{@}% will be @@ when we switch to @ as escape char.
    2245 %\let\{ = \lbracecmd
    2246 %\let\} = \rbracecmd
     2459% Need these in case \tex is in effect and \{ is a \delimiter again.
     2460% But can't use \lbracecmd and \rbracecmd because texindex assumes
     2461% braces and backslashes are used only as delimiters.
     2462\let\{ = \mylbrace
     2463\let\} = \myrbrace
    22472464\def\_{{\realbackslash _}}%
    22482465\def\w{\realbackslash w }%
     
    22552472\def\less{\realbackslash less}%
    22562473\def\hat{\realbackslash hat}%
    2257 %\def\char{\realbackslash char}%
    22582474\def\TeX{\realbackslash TeX}%
    22592475\def\dots{\realbackslash dots }%
    2260 \def\copyright{\realbackslash copyright }%
     2476\def\result{\realbackslash result}%
     2477\def\equiv{\realbackslash equiv}%
     2478\def\expansion{\realbackslash expansion}%
     2479\def\print{\realbackslash print}%
     2480\def\error{\realbackslash error}%
     2481\def\point{\realbackslash point}%
     2482\def\copyright{\realbackslash copyright}%
    22612483\def\tclose##1{\realbackslash tclose {##1}}%
    22622484\def\code##1{\realbackslash code {##1}}%
     2485\def\uref##1{\realbackslash uref {##1}}%
     2486\def\url##1{\realbackslash url {##1}}%
     2487\def\env##1{\realbackslash env {##1}}%
     2488\def\command##1{\realbackslash command {##1}}%
     2489\def\option##1{\realbackslash option {##1}}%
    22632490\def\dotless##1{\realbackslash dotless {##1}}%
    22642491\def\samp##1{\realbackslash samp {##1}}%
     
    22682495\def\i##1{\realbackslash i {##1}}%
    22692496\def\b##1{\realbackslash b {##1}}%
     2497\def\sc##1{\realbackslash sc {##1}}%
    22702498\def\cite##1{\realbackslash cite {##1}}%
    22712499\def\key##1{\realbackslash key {##1}}%
     
    22752503\def\dfn##1{\realbackslash dfn {##1}}%
    22762504\def\emph##1{\realbackslash emph {##1}}%
     2505\def\acronym##1{\realbackslash acronym {##1}}%
     2506%
     2507% Handle some cases of @value -- where the variable name does not
     2508% contain - or _, and the value does not contain any
     2509% (non-fully-expandable) commands.
     2510\let\value = \expandablevalue
     2511%
    22772512\unsepspaces
     2513% Turn off macro expansion
     2514\turnoffmacros
    22782515}
    22792516
     
    23322569\let\tclose=\indexdummyfont
    23332570\let\code=\indexdummyfont
     2571\let\url=\indexdummyfont
     2572\let\uref=\indexdummyfont
     2573\let\env=\indexdummyfont
     2574\let\command=\indexdummyfont
     2575\let\option=\indexdummyfont
    23342576\let\file=\indexdummyfont
    23352577\let\samp=\indexdummyfont
     
    23472589
    23482590{\catcode`\@=0 \catcode`\\=\other
    2349 @gdef@realbackslash{\}}
     2591 @gdef@realbackslash{\}}
    23502592
    23512593\let\indexbackslash=0  %overridden during \printindex.
    2352 
    2353 \let\SETmarginindex=\relax %initialize!
    2354 % workhorse for all \fooindexes
    2355 % #1 is name of index, #2 is stuff to put there
    2356 \def\doind #1#2{%
     2594\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
     2595
     2596% For \ifx comparisons.
     2597\def\emptymacro{\empty}
     2598
     2599% Most index entries go through here, but \dosubind is the general case.
     2600%
     2601\def\doind#1#2{\dosubind{#1}{#2}\empty}
     2602
     2603% Workhorse for all \fooindexes.
     2604% #1 is name of index, #2 is stuff to put there, #3 is subentry --
     2605% \empty if called from \doind, as we usually are.  The main exception
     2606% is with defuns, which call us directly.
     2607%
     2608\def\dosubind#1#2#3{%
    23572609  % Put the index entry in the margin if desired.
    23582610  \ifx\SETmarginindex\relax\else
     
    23652617      \escapechar=`\\
    23662618      {%
    2367         \let\folio=0% We will expand all macros now EXCEPT \folio.
     2619        \let\folio = 0% We will expand all macros now EXCEPT \folio.
    23682620        \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
    23692621        % so it will be output as is; and it will print as backslash.
    23702622        %
    2371         % First process the index-string with all font commands turned off
    2372         % to get the string to sort by.
    2373         {\indexnofonts \xdef\indexsorttmp{#2}}%
     2623        \def\thirdarg{#3}%
    23742624        %
    2375         % Now produce the complete index entry, with both the sort key and the
    2376         % original text, including any font commands.
     2625        % If third arg is present, precede it with space in sort key.
     2626        \ifx\thirdarg\emptymacro
     2627          \let\subentry = \empty
     2628        \else
     2629          \def\subentry{ #3}%
     2630        \fi
     2631        %
     2632        % First process the index entry with all font commands turned
     2633        % off to get the string to sort by.
     2634        {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
     2635        %
     2636        % Now the real index entry with the fonts.
    23772637        \toks0 = {#2}%
     2638        %
     2639        % If third (subentry) arg is present, add it to the index
     2640        % string.  And include a space.
     2641        \ifx\thirdarg\emptymacro \else
     2642          \toks0 = \expandafter{\the\toks0 \space #3}%
     2643        \fi
     2644        %
     2645        % Set up the complete index entry, with both the sort key
     2646        % and the original text, including any font commands.  We write
     2647        % three arguments to \entry to the .?? file, texindex reduces to
     2648        % two when writing the .??s sorted result.
    23782649        \edef\temp{%
    23792650          \write\csname#1indfile\endcsname{%
    23802651            \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
    23812652        }%
    2382         \temp
     2653        %
     2654        % If a skip is the last thing on the list now, preserve it
     2655        % by backing up by \lastskip, doing the \write, then inserting
     2656        % the skip again.  Otherwise, the whatsit generated by the
     2657        % \write will make \lastskip zero.  The result is that sequences
     2658        % like this:
     2659        % @end defun
     2660        % @tindex whatever
     2661        % @defun ...
     2662        % will have extra space inserted, because the \medbreak in the
     2663        % start of the @defun won't see the skip inserted by the @end of
     2664        % the previous defun.
     2665        %
     2666        % But don't do any of this if we're not in vertical mode.  We
     2667        % don't want to do a \vskip and prematurely end a paragraph.
     2668        %
     2669        % Avoid page breaks due to these extra skips, too.
     2670        %
     2671        \iflinks
     2672          \ifvmode
     2673            \skip0 = \lastskip
     2674            \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
     2675          \fi
     2676          %
     2677          \temp % do the write
     2678          %
     2679          %
     2680          \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
     2681        \fi
    23832682      }%
    23842683    }%
     
    23862685  }%
    23872686}
    2388 
    2389 \def\dosubind #1#2#3{%
    2390 {\count10=\lastpenalty %
    2391 {\indexdummies % Must do this here, since \bf, etc expand at this stage
    2392 \escapechar=`\\%
    2393 {\let\folio=0%
    2394 \def\rawbackslashxx{\indexbackslash}%
    2395 %
    2396 % Now process the index-string once, with all font commands turned off,
    2397 % to get the string to sort the index by.
    2398 {\indexnofonts
    2399 \xdef\temp1{#2 #3}%
    2400 }%
    2401 % Now produce the complete index entry.  We process the index-string again,
    2402 % this time with font commands expanded, to get what to print in the index.
    2403 \edef\temp{%
    2404 \write \csname#1indfile\endcsname{%
    2405 \realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
    2406 \temp }%
    2407 }\penalty\count10}}
    24082687
    24092688% The index entry written in the file actually looks like
     
    24392718% Define the macros used in formatting output of the sorted index material.
    24402719
    2441 % This is what you call to cause a particular index to get printed.
    2442 % Write
    2443 % @unnumbered Function Index
    2444 % @printindex fn
    2445 
     2720% @printindex causes a particular index (the ??s file) to get printed.
     2721% It does not print any chapter heading (usually an @unnumbered).
     2722%
    24462723\def\printindex{\parsearg\doprintindex}
    2447 
    24482724\def\doprintindex#1{\begingroup
    24492725  \dobreak \chapheadingskip{10000}%
     
    24522728  \tolerance = 9500
    24532729  \indexbreaks
    2454   \def\indexbackslash{\rawbackslashxx}%
    2455   % Index files are almost Texinfo source, but we use \ as the escape
    2456   % character.  It would be better to use @, but that's too big a change
    2457   % to make right now.
    2458   \catcode`\\ = 0
     2730  %
     2731  % See if the index file exists and is nonempty.
     2732  % Change catcode of @ here so that if the index file contains
     2733  % \initial {@}
     2734  % as its first line, TeX doesn't complain about mismatched braces
     2735  % (because it thinks @} is a control sequence).
    24592736  \catcode`\@ = 11
    2460   \escapechar = `\\
    2461   \begindoublecolumns
    2462   %
    2463   % See if the index file exists and is nonempty.
    24642737  \openin 1 \jobname.#1s
    24652738  \ifeof 1
     
    24682741    % index.  The easiest way to prevent this problem is to make sure
    24692742    % there is some text.
    2470     (Index is nonexistent)
     2743    \putwordIndexNonexistent
    24712744  \else
    24722745    %
     
    24762749    \read 1 to \temp
    24772750    \ifeof 1
    2478       (Index is empty)
     2751      \putwordIndexIsEmpty
    24792752    \else
     2753      % Index files are almost Texinfo source, but we use \ as the escape
     2754      % character.  It would be better to use @, but that's too big a change
     2755      % to make right now.
     2756      \def\indexbackslash{\rawbackslashxx}%
     2757      \catcode`\\ = 0
     2758      \escapechar = `\\
     2759      \begindoublecolumns
    24802760      \input \jobname.#1s
     2761      \enddoublecolumns
    24812762    \fi
    24822763  \fi
    24832764  \closein 1
    2484   \enddoublecolumns
    24852765\endgroup}
    24862766
     
    24882768% Change them to control the appearance of the index.
    24892769
    2490 % Same as \bigskipamount except no shrink.
    2491 % \balancecolumns gets confused if there is any shrink.
    2492 \newskip\initialskipamount \initialskipamount 12pt plus4pt
    2493 
    2494 \def\initial #1{%
    2495 {\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
    2496 \ifdim\lastskip<\initialskipamount
    2497 \removelastskip \penalty-200 \vskip \initialskipamount\fi
    2498 \line{\secbf#1\hfill}\kern 2pt\penalty10000}}
     2770\def\initial#1{{%
     2771  % Some minor font changes for the special characters.
     2772  \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
     2773  %
     2774  % Remove any glue we may have, we'll be inserting our own.
     2775  \removelastskip
     2776  %
     2777  % We like breaks before the index initials, so insert a bonus.
     2778  \penalty -300
     2779  %
     2780  % Typeset the initial.  Making this add up to a whole number of
     2781  % baselineskips increases the chance of the dots lining up from column
     2782  % to column.  It still won't often be perfect, because of the stretch
     2783  % we need before each entry, but it's better.
     2784  %
     2785  % No shrink because it confuses \balancecolumns.
     2786  \vskip 1.67\baselineskip plus .5\baselineskip
     2787  \leftline{\secbf #1}%
     2788  \vskip .33\baselineskip plus .1\baselineskip
     2789  %
     2790  % Do our best not to break after the initial.
     2791  \nobreak
     2792}}
    24992793
    25002794% This typesets a paragraph consisting of #1, dot leaders, and then #2
     
    25022796% entries.  The paragraph is indented by \leftskip.
    25032797%
    2504 \def\entry #1#2{\begingroup
     2798\def\entry#1#2{\begingroup
    25052799  %
    25062800  % Start a new paragraph if necessary, so our assignments below can't
     
    25252819  % \hangafter is reset to 1 (which is the value we want) at the start
    25262820  % of each paragraph, so we need not do anything with that.
    2527   \hangindent=2em
     2821  \hangindent = 2em
    25282822  %
    25292823  % When the entry text needs to be broken, just fill out the first line
    25302824  % with blank space.
    25312825  \rightskip = 0pt plus1fil
     2826  %
     2827  % A bit of stretch before each entry for the benefit of balancing columns.
     2828  \vskip 0pt plus1pt
    25322829  %
    25332830  % Start a ``paragraph'' for the index entry so the line breaking
     
    25842881\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
    25852882  % Grab any single-column material above us.
    2586   \output = {\global\setbox\partialpage
    2587     =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
    2588   \eject
    2589   %
    2590   % Now switch to the double-column output routine.
    2591   \output={\doublecolumnout}%
     2883  \output = {%
     2884    %
     2885    % Here is a possibility not foreseen in manmac: if we accumulate a
     2886    % whole lot of material, we might end up calling this \output
     2887    % routine twice in a row (see the doublecol-lose test, which is
     2888    % essentially a couple of indexes with @setchapternewpage off).  In
     2889    % that case we just ship out what is in \partialpage with the normal
     2890    % output routine.  Generally, \partialpage will be empty when this
     2891    % runs and this will be a no-op.  See the indexspread.tex test case.
     2892    \ifvoid\partialpage \else
     2893      \onepageout{\pagecontents\partialpage}%
     2894    \fi
     2895    %
     2896    \global\setbox\partialpage = \vbox{%
     2897      % Unvbox the main output page.
     2898      \unvbox\PAGE
     2899      \kern-\topskip \kern\baselineskip
     2900    }%
     2901  }%
     2902  \eject % run that output routine to set \partialpage
     2903  %
     2904  % Use the double-column output routine for subsequent pages.
     2905  \output = {\doublecolumnout}%
    25922906  %
    25932907  % Change the page size parameters.  We could do this once outside this
     
    25952909  % format, but then we repeat the same computation.  Repeating a couple
    25962910  % of assignments once per index is clearly meaningless for the
    2597   % execution time, so we may as well do it once.
     2911  % execution time, so we may as well do it in one place.
    25982912  %
    25992913  % First we halve the line length, less a little for the gutter between
    26002914  % the columns.  We compute the gutter based on the line length, so it
    26012915  % changes automatically with the paper format.  The magic constant
    2602   % below is chosen so that the gutter has the same value (well, +- <
    2603   % 1pt) as it did when we hard-coded it.
     2916  % below is chosen so that the gutter has the same value (well, +-<1pt)
     2917  % as it did when we hard-coded it.
    26042918  %
    26052919  % We put the result in a separate register, \doublecolumhsize, so we
     
    26142928  % Double the \vsize as well.  (We don't need a separate register here,
    26152929  % since nobody clobbers \vsize.)
     2930  \advance\vsize by -\ht\partialpage
    26162931  \vsize = 2\vsize
    26172932}
     2933
     2934% The double-column output routine for all double-column pages except
     2935% the last.
     2936%
    26182937\def\doublecolumnout{%
    26192938  \splittopskip=\topskip \splitmaxdepth=\maxdepth
     
    26212940  % (undoubled) page height minus any material left over from the
    26222941  % previous page.
    2623   \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
    2624   % box0 will be the left-hand column, box1 the right.
     2942  \dimen@ = \vsize
     2943  \divide\dimen@ by 2
     2944  %
     2945  % box0 will be the left-hand column, box2 the right.
    26252946  \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
    26262947  \onepageout\pagesofar
    2627   \unvbox255 \penalty\outputpenalty
     2948  \unvbox255
     2949  \penalty\outputpenalty
    26282950}
    26292951\def\pagesofar{%
    2630   % The contents of the output page -- any previous material,
    2631   % followed by the two boxes we just split.
     2952  % Re-output the contents of the output page -- any previous material,
     2953  % followed by the two boxes we just split, in box0 and box2.
    26322954  \unvbox\partialpage
     2955  %
    26332956  \hsize = \doublecolumnhsize
    2634   \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}%
     2957  \wd0=\hsize \wd2=\hsize
     2958  \hbox to\pagewidth{\box0\hfil\box2}%
    26352959}
    26362960\def\enddoublecolumns{%
    2637   \output={\balancecolumns}\eject % split what we have
    2638   \endgroup
    2639   % Back to normal single-column typesetting, but take account of the
    2640   % fact that we just accumulated some stuff on the output page.
    2641   \pagegoal=\vsize
     2961  \output = {%
     2962    % Split the last of the double-column material.  Leave it on the
     2963    % current page, no automatic page break.
     2964    \balancecolumns
     2965    %
     2966    % If we end up splitting too much material for the current page,
     2967    % though, there will be another page break right after this \output
     2968    % invocation ends.  Having called \balancecolumns once, we do not
     2969    % want to call it again.  Therefore, reset \output to its normal
     2970    % definition right away.  (We hope \balancecolumns will never be
     2971    % called on to balance too much material, but if it is, this makes
     2972    % the output somewhat more palatable.)
     2973    \global\output = {\onepageout{\pagecontents\PAGE}}%
     2974  }%
     2975  \eject
     2976  \endgroup % started in \begindoublecolumns
     2977  %
     2978  % \pagegoal was set to the doubled \vsize above, since we restarted
     2979  % the current page.  We're now back to normal single-column
     2980  % typesetting, so reset \pagegoal to the normal \vsize (after the
     2981  % \endgroup where \vsize got restored).
     2982  \pagegoal = \vsize
    26422983}
    26432984\def\balancecolumns{%
    2644   % Called on the last page of the double column material.
    2645   \setbox0=\vbox{\unvbox255}%
     2985  % Called at the end of the double column material.
     2986  \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
    26462987  \dimen@ = \ht0
    26472988  \advance\dimen@ by \topskip
    26482989  \advance\dimen@ by-\baselineskip
    2649   \divide\dimen@ by 2
     2990  \divide\dimen@ by 2 % target to split to
     2991  %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
    26502992  \splittopskip = \topskip
    26512993  % Loop until we get a decent breakpoint.
    2652   {\vbadness=10000 \loop \global\setbox3=\copy0
    2653     \global\setbox1=\vsplit3 to\dimen@
    2654     \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}%
     2994  {%
     2995    \vbadness = 10000
     2996    \loop
     2997      \global\setbox3 = \copy0
     2998      \global\setbox1 = \vsplit3 to \dimen@
     2999    \ifdim\ht3>\dimen@
     3000      \global\advance\dimen@ by 1pt
     3001    \repeat
     3002  }%
     3003  %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
    26553004  \setbox0=\vbox to\dimen@{\unvbox1}%
    26563005  \setbox2=\vbox to\dimen@{\unvbox3}%
     3006  %
    26573007  \pagesofar
    26583008}
    2659 \catcode `\@=\other
     3009\catcode`\@ = \other
    26603010
    26613011
     
    26633013% Define chapters, sections, etc.
    26643014
    2665 \newcount \chapno
    2666 \newcount \secno        \secno=0
    2667 \newcount \subsecno     \subsecno=0
    2668 \newcount \subsubsecno  \subsubsecno=0
     3015\newcount\chapno
     3016\newcount\secno        \secno=0
     3017\newcount\subsecno     \subsecno=0
     3018\newcount\subsubsecno  \subsubsecno=0
    26693019
    26703020% This counter is funny since it counts through charcodes of letters A, B, ...
    2671 \newcount \appendixno  \appendixno = `\@
     3021\newcount\appendixno  \appendixno = `\@
    26723022\def\appendixletter{\char\the\appendixno}
    26733023
    2674 \newwrite \contentsfile
    2675 % This is called from \setfilename.
    2676 \def\opencontents{\openout \contentsfile = \jobname.toc}
    2677 
    26783024% Each @chapter defines this as the name of the chapter.
    2679 % page headings and footings can use it.  @section does likewise
    2680 
    2681 \def\thischapter{} \def\thissection{}
    2682 \def\seccheck#1{\if \pageno<0 %
    2683 \errmessage{@#1 not allowed after generating table of contents}\fi
    2684 %
    2685 }
    2686 
    2687 \def\chapternofonts{%
    2688 \let\rawbackslash=\relax%
    2689 \let\frenchspacing=\relax%
    2690 \def\result{\realbackslash result}
    2691 \def\equiv{\realbackslash equiv}
    2692 \def\expansion{\realbackslash expansion}
    2693 \def\print{\realbackslash print}
    2694 \def\TeX{\realbackslash TeX}
    2695 \def\dots{\realbackslash dots}
    2696 \def\copyright{\realbackslash copyright}
    2697 \def\tt{\realbackslash tt}
    2698 \def\bf{\realbackslash bf }
    2699 \def\w{\realbackslash w}
    2700 \def\less{\realbackslash less}
    2701 \def\gtr{\realbackslash gtr}
    2702 \def\hat{\realbackslash hat}
    2703 \def\char{\realbackslash char}
    2704 \def\tclose##1{\realbackslash tclose {##1}}
    2705 \def\code##1{\realbackslash code {##1}}
    2706 \def\samp##1{\realbackslash samp {##1}}
    2707 \def\r##1{\realbackslash r {##1}}
    2708 \def\b##1{\realbackslash b {##1}}
    2709 \def\key##1{\realbackslash key {##1}}
    2710 \def\file##1{\realbackslash file {##1}}
    2711 \def\kbd##1{\realbackslash kbd {##1}}
    2712 % These are redefined because @smartitalic wouldn't work inside xdef.
    2713 \def\i##1{\realbackslash i {##1}}
    2714 \def\cite##1{\realbackslash cite {##1}}
    2715 \def\var##1{\realbackslash var {##1}}
    2716 \def\emph##1{\realbackslash emph {##1}}
    2717 \def\dfn##1{\realbackslash dfn {##1}}
    2718 }
     3025% page headings and footings can use it.  @section does likewise.
     3026\def\thischapter{}
     3027\def\thissection{}
    27193028
    27203029\newcount\absseclevel % used to calculate proper heading level
     
    27883097}
    27893098
    2790 
     3099% @chapter, @appendix, @unnumbered.
    27913100\def\thischaptername{No Chapter Title}
    27923101\outer\def\chapter{\parsearg\chapteryyy}
    27933102\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
    2794 \def\chapterzzz #1{\seccheck{chapter}%
     3103\def\chapterzzz #1{%
    27953104\secno=0 \subsecno=0 \subsubsecno=0
    2796 \global\advance \chapno by 1 \message{\putwordChapter \the\chapno}%
     3105\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
    27973106\chapmacro {#1}{\the\chapno}%
    27983107\gdef\thissection{#1}%
     
    28013110% because we don't want its macros evaluated now.
    28023111\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
    2803 {\chapternofonts%
    2804 \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
    2805 \escapechar=`\\%
    2806 \write \contentsfile \temp  %
    2807 \donoderef %
     3112\toks0 = {#1}%
     3113\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
     3114                                  {\the\chapno}}}%
     3115\temp
     3116\donoderef
    28083117\global\let\section = \numberedsec
    28093118\global\let\subsection = \numberedsubsec
    28103119\global\let\subsubsection = \numberedsubsubsec
    2811 }}
     3120}
    28123121
    28133122\outer\def\appendix{\parsearg\appendixyyy}
    28143123\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
    2815 \def\appendixzzz #1{\seccheck{appendix}%
     3124\def\appendixzzz #1{%
    28163125\secno=0 \subsecno=0 \subsubsecno=0
    2817 \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
     3126\global\advance \appendixno by 1
     3127\message{\putwordAppendix\space \appendixletter}%
    28183128\chapmacro {#1}{\putwordAppendix{} \appendixletter}%
    28193129\gdef\thissection{#1}%
    28203130\gdef\thischaptername{#1}%
    28213131\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
    2822 {\chapternofonts%
    2823 \edef\temp{{\realbackslash chapentry
    2824   {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
    2825 \escapechar=`\\%
    2826 \write \contentsfile \temp  %
    2827 \appendixnoderef %
     3132\toks0 = {#1}%
     3133\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
     3134                       {\putwordAppendix{} \appendixletter}}}%
     3135\temp
     3136\appendixnoderef
    28283137\global\let\section = \appendixsec
    28293138\global\let\subsection = \appendixsubsec
    28303139\global\let\subsubsection = \appendixsubsubsec
    2831 }}
     3140}
    28323141
    28333142% @centerchap is like @unnumbered, but the heading is centered.
     
    28353144\def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
    28363145
     3146% @top is like @unnumbered.
    28373147\outer\def\top{\parsearg\unnumberedyyy}
     3148
    28383149\outer\def\unnumbered{\parsearg\unnumberedyyy}
    28393150\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
    2840 \def\unnumberedzzz #1{\seccheck{unnumbered}%
     3151\def\unnumberedzzz #1{%
    28413152\secno=0 \subsecno=0 \subsubsecno=0
    28423153%
     
    28503161% as a result of the \message, we just want `@cite' itself.  We use
    28513162% \the<toks register> to achieve this: TeX expands \the<toks> only once,
    2852 % simply yielding the contents of the <toks register>.
     3163% simply yielding the contents of <toks register>.  (We also do this for
     3164% the toc entries.)
    28533165\toks0 = {#1}\message{(\the\toks0)}%
    28543166%
    28553167\unnumbchapmacro {#1}%
    28563168\gdef\thischapter{#1}\gdef\thissection{#1}%
    2857 {\chapternofonts%
    2858 \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
    2859 \escapechar=`\\%
    2860 \write \contentsfile \temp  %
    2861 \unnumbnoderef %
     3169\toks0 = {#1}%
     3170\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
     3171\temp
     3172\unnumbnoderef
    28623173\global\let\section = \unnumberedsec
    28633174\global\let\subsection = \unnumberedsubsec
    28643175\global\let\subsubsection = \unnumberedsubsubsec
    2865 }}
    2866 
     3176}
     3177
     3178% Sections.
    28673179\outer\def\numberedsec{\parsearg\secyyy}
    28683180\def\secyyy #1{\numhead1{#1}} % normally calls seczzz
    2869 \def\seczzz #1{\seccheck{section}%
     3181\def\seczzz #1{%
    28703182\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
    28713183\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
    2872 {\chapternofonts%
    2873 \edef\temp{{\realbackslash secentry %
    2874 {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
    2875 \escapechar=`\\%
    2876 \write \contentsfile \temp %
    2877 \donoderef %
    2878 \penalty 10000 %
    2879 }}
     3184\toks0 = {#1}%
     3185\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
     3186                                  {\the\chapno}{\the\secno}}}%
     3187\temp
     3188\donoderef
     3189\nobreak
     3190}
    28803191
    28813192\outer\def\appendixsection{\parsearg\appendixsecyyy}
    28823193\outer\def\appendixsec{\parsearg\appendixsecyyy}
    28833194\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
    2884 \def\appendixsectionzzz #1{\seccheck{appendixsection}%
     3195\def\appendixsectionzzz #1{%
    28853196\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
    28863197\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
    2887 {\chapternofonts%
    2888 \edef\temp{{\realbackslash secentry %
    2889 {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
    2890 \escapechar=`\\%
    2891 \write \contentsfile \temp %
    2892 \appendixnoderef %
    2893 \penalty 10000 %
    2894 }}
     3198\toks0 = {#1}%
     3199\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
     3200                                  {\appendixletter}{\the\secno}}}%
     3201\temp
     3202\appendixnoderef
     3203\nobreak
     3204}
    28953205
    28963206\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
    28973207\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
    2898 \def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
     3208\def\unnumberedseczzz #1{%
    28993209\plainsecheading {#1}\gdef\thissection{#1}%
    2900 {\chapternofonts%
    2901 \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
    2902 \escapechar=`\\%
    2903 \write \contentsfile \temp %
    2904 \unnumbnoderef %
    2905 \penalty 10000 %
    2906 }}
    2907 
     3210\toks0 = {#1}%
     3211\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
     3212\temp
     3213\unnumbnoderef
     3214\nobreak
     3215}
     3216
     3217% Subsections.
    29083218\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
    29093219\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
    2910 \def\numberedsubseczzz #1{\seccheck{subsection}%
     3220\def\numberedsubseczzz #1{%
    29113221\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
    29123222\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
    2913 {\chapternofonts%
    2914 \edef\temp{{\realbackslash subsecentry %
    2915 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
    2916 \escapechar=`\\%
    2917 \write \contentsfile \temp %
    2918 \donoderef %
    2919 \penalty 10000 %
    2920 }}
     3223\toks0 = {#1}%
     3224\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
     3225                                    {\the\chapno}{\the\secno}{\the\subsecno}}}%
     3226\temp
     3227\donoderef
     3228\nobreak
     3229}
    29213230
    29223231\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
    29233232\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
    2924 \def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
     3233\def\appendixsubseczzz #1{%
    29253234\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
    29263235\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
    2927 {\chapternofonts%
    2928 \edef\temp{{\realbackslash subsecentry %
    2929 {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
    2930 \escapechar=`\\%
    2931 \write \contentsfile \temp %
    2932 \appendixnoderef %
    2933 \penalty 10000 %
    2934 }}
     3236\toks0 = {#1}%
     3237\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
     3238                                {\appendixletter}{\the\secno}{\the\subsecno}}}%
     3239\temp
     3240\appendixnoderef
     3241\nobreak
     3242}
    29353243
    29363244\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
    29373245\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
    2938 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
     3246\def\unnumberedsubseczzz #1{%
    29393247\plainsubsecheading {#1}\gdef\thissection{#1}%
    2940 {\chapternofonts%
    2941 \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
    2942 \escapechar=`\\%
    2943 \write \contentsfile \temp %
    2944 \unnumbnoderef %
    2945 \penalty 10000 %
    2946 }}
    2947 
     3248\toks0 = {#1}%
     3249\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
     3250                                    {\the\toks0}}}%
     3251\temp
     3252\unnumbnoderef
     3253\nobreak
     3254}
     3255
     3256% Subsubsections.
    29483257\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
    29493258\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
    2950 \def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
     3259\def\numberedsubsubseczzz #1{%
    29513260\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
    29523261\subsubsecheading {#1}
    29533262  {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
    2954 {\chapternofonts%
    2955 \edef\temp{{\realbackslash subsubsecentry %
    2956   {#1}
    2957   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
    2958   {\noexpand\folio}}}%
    2959 \escapechar=`\\%
    2960 \write \contentsfile \temp %
    2961 \donoderef %
    2962 \penalty 10000 %
    2963 }}
     3263\toks0 = {#1}%
     3264\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
     3265  {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
     3266\temp
     3267\donoderef
     3268\nobreak
     3269}
    29643270
    29653271\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
    29663272\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
    2967 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
     3273\def\appendixsubsubseczzz #1{%
    29683274\gdef\thissection{#1}\global\advance \subsubsecno by 1 %
    29693275\subsubsecheading {#1}
    29703276  {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
    2971 {\chapternofonts%
    2972 \edef\temp{{\realbackslash subsubsecentry{#1}%
    2973   {\appendixletter}
    2974   {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
    2975 \escapechar=`\\%
    2976 \write \contentsfile \temp %
    2977 \appendixnoderef %
    2978 \penalty 10000 %
    2979 }}
     3277\toks0 = {#1}%
     3278\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
     3279  {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
     3280\temp
     3281\appendixnoderef
     3282\nobreak
     3283}
    29803284
    29813285\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
    29823286\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
    2983 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
     3287\def\unnumberedsubsubseczzz #1{%
    29843288\plainsubsubsecheading {#1}\gdef\thissection{#1}%
    2985 {\chapternofonts%
    2986 \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
    2987 \escapechar=`\\%
    2988 \write \contentsfile \temp %
    2989 \unnumbnoderef %
    2990 \penalty 10000 %
    2991 }}
     3289\toks0 = {#1}%
     3290\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
     3291                                    {\the\toks0}}}%
     3292\temp
     3293\unnumbnoderef
     3294\nobreak
     3295}
    29923296
    29933297% These are variants which are not "outer", so they can appear in @ifinfo.
     
    30183322% Define @majorheading, @heading and @subheading
    30193323
    3020 % NOTE on use of \vbox for chapter headings, section headings, and
    3021 % such:
     3324% NOTE on use of \vbox for chapter headings, section headings, and such:
    30223325%       1) We use \vbox rather than the earlier \line to permit
    30233326%          overlong headings to fold.
     
    30663369\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
    30673370
    3068 \def\CHAPPAGoff{
     3371\def\CHAPPAGoff{%
    30693372\global\let\contentsalignmacro = \chappager
    30703373\global\let\pchapsepmacro=\chapbreak
    30713374\global\let\pagealignmacro=\chappager}
    30723375
    3073 \def\CHAPPAGon{
     3376\def\CHAPPAGon{%
    30743377\global\let\contentsalignmacro = \chappager
    30753378\global\let\pchapsepmacro=\chappager
     
    31253428\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
    31263429                       \parindent=0pt\raggedright
    3127                        \rm #1\hfill}}\bigskip \par\penalty 10000 %
     3430                       \rm #1\hfill}}\bigskip \par\nobreak
    31283431}
    31293432
     
    31363439\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
    31373440                       \parindent=0pt
    3138                        \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
     3441                       \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
    31393442}
    31403443
     
    31893492
    31903493
    3191 \message{toc printing,}
     3494\message{toc,}
     3495\newwrite\tocfile
     3496
     3497% Write an entry to the toc file, opening it if necessary.
     3498% Called from @chapter, etc.  We supply {\folio} at the end of the
     3499% argument, which will end up as the last argument to the \...entry macro.
     3500%
     3501% We open the .toc file here instead of at @setfilename or any other
     3502% given time so that @contents can be put in the document anywhere.
     3503%
     3504\newif\iftocfileopened
     3505\def\writetocentry#1{%
     3506  \iftocfileopened\else
     3507    \immediate\openout\tocfile = \jobname.toc
     3508    \global\tocfileopenedtrue
     3509  \fi
     3510  \iflinks \write\tocfile{#1{\folio}}\fi
     3511}
     3512
     3513\newskip\contentsrightmargin \contentsrightmargin=1in
     3514\newcount\savepageno
     3515\newcount\lastnegativepageno \lastnegativepageno = -1
     3516
    31923517% Finish up the main text and prepare to read what we've written
    3193 % to \contentsfile.
    3194 
    3195 \newskip\contentsrightmargin \contentsrightmargin=1in
     3518% to \tocfile.
     3519%
    31963520\def\startcontents#1{%
    31973521   % If @setchapternewpage on, and @headings double, the contents should
     
    32003524   % From: Torbjorn Granlund <tege@matematik.su.se>
    32013525   \contentsalignmacro
    3202    \immediate\closeout \contentsfile
    3203    \ifnum \pageno>0
    3204       \pageno = -1              % Request roman numbered pages.
    3205    \fi
     3526   \immediate\closeout\tocfile
     3527   %
    32063528   % Don't need to put `Contents' or `Short Contents' in the headline.
    32073529   % It is abundantly clear what they are.
    32083530   \unnumbchapmacro{#1}\def\thischapter{}%
     3531   \savepageno = \pageno
    32093532   \begingroup                  % Set up to handle contents files properly.
    32103533      \catcode`\\=0  \catcode`\{=1  \catcode`\}=2  \catcode`\@=11
    3211       \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
     3534      % We can't do this, because then an actual ^ in a section
     3535      % title fails, e.g., @chapter ^ -- exponentiation.  --karl, 9jul97.
     3536      %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
    32123537      \raggedbottom             % Worry more about breakpoints than the bottom.
    32133538      \advance\hsize by -\contentsrightmargin % Don't use the full line length.
     3539      %
     3540      % Roman numerals for page numbers.
     3541      \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
    32143542}
    32153543
    32163544
    32173545% Normal (long) toc.
    3218 \outer\def\contents{%
    3219    \startcontents{\putwordTableofContents}%
    3220       \input \jobname.toc
     3546\def\contents{%
     3547   \startcontents{\putwordTOC}%