%\iffalse meta-comment, etc.
%% This is footmisc.dtx, and it's -*-LaTeX-*- text
%
% We use the same body for the \cs{ProvidesFile} as for the
% \cs{ProvidesPackage} command.
%
%    \begin{macrocode}
%<*!debugins>
\NeedsTeXFormat{LaTeX2e}
%</!debugins>
%<*dtx>
\ProvidesFile{footmisc.dtx}%
%</dtx>
%<package>\ProvidesPackage{footmisc}%
%<*!debugins>
        [1999/12/02 v3.3j2
%</!debugins>
%<package>     a miscellany of footnote facilities%
%<*dtx>
               footmisc package source file%
%</dtx>
%<*!debugins>
                   ]% $Id: footmisc.dtx,v 1.2 1999/03/31 12:29:44 rf Exp rf $
%</!debugins>
%    \end{macrocode}
%
% Code to enable LaTeX processing of the file without the intervention
% of a driver file.
%    \begin{macrocode}
%<*driver>
\setcounter{errorcontextlines}{999}
\documentclass{ltxdoc}
\GetFileInfo{footmisc.dtx}
\EnableCrossrefs
% to get documented source of the package, comment out the next line,
% and uncomment the following one; otherwise, create yourself
% (somewhere on your LaTeX input path) a file ltxdoc.cfg that contains
% simply          \AtBeginDocument{\AlsoImplementation}
\OnlyDescription
%\AlsoImplementation
\setcounter{StandardModuleDepth}{1}
\begin{document}
\DocInput{footmisc.dtx}
\end{document}
%</driver>
%    \end{macrocode}
% \fi
%
% \CheckSum{1037}
%
% \title{\texttt{footmisc} ---\\
%        a portmanteau package\\
%        for customising footnotes in \LaTeXe\thanks{This file has
%          version number \fileversion, last revised \filedate}}
% \author{Robin Fairbairns\thanks{University of Cambridge Computer
%     Laboratory, Pembroke St., Cambridge, CB2 3QG, UK
%     (\texttt{rf10@cam.ac.uk})}}
% \maketitle
%
% \section*{\emph{CAVEAT}}
%
% This package replaces my earlier \textsf{footnote} package, which I
% have now withdrawn.  Please remove all instances of
% \emph{my} \textsf{footnote.sty} from your system: bug reports for
% \emph{my} \textsf{footnote.sty} will be ignored.
%
% The reason for this confusion is the existence of a package
% \textsf{footnote} by Mark Wooding, which appeared somewhat after
% mine.  We were unable to reach a compromise as to whose package's
% name was to change, so I chose to act the good network citizen\dots
%
% \section*{Support}
%
% Some support of this package is available \emph{for unchanged copies
%   of the package} via email to me at the address given above; it
% will remain so at least as long as the address remains valid.  I
% don't guarantee anything, but I will probably look at any bug
% reports you may submit, and may correct problems reported (either in
% my code or in yours\dots).
%
% \section*{Copyright statement}
%
% \noindent Program: \texttt{footmisc.dtx}\par
% \noindent Copyright 1995 1996 1998 1999 Robin Fairbairns
%
% This program can redistributed and/or modified under the terms
% of the LaTeX Project Public License Distributed from CTAN
% archives in directory \texttt{macros/latex/base/lppl.txt}; either
% version 1 of the License, or (at your option) any later version.
%
% \section{User interface}
%
% The \textsf{footmisc} package provides several different
% customisations of the way foonotes are represented in \LaTeXe{}
% documents (the sources of the code in this package are various, but
% all of it has been massaged by the author; where the code comes from
% elsewhere, there are attributions given below, somewhere or other).
%
% The interface to the
% package's options is very simple~--- each one is presented as an
% option in the |\usepackage| command.  For example, to use a useful
% and consistent set, the author invokes the package with the
% command |\usepackage[perpage,para,symbol]{footmisc}|.
%
% \subsection{Option \texttt{perpage}}
%
% This option resets footnote numbering for each page of the document.
% It is derived from |pagefoots.sty| by Brian T. Schellenberger
% (|bts@unx.sas.com|), but I've done quite a lot of
% \LaTeX(2\ensuremath{_{\textstyle\varepsilon}})-isation of the code.
% It needs two passes to do this correctly (though it comes as close
% as possible on the first pass).  You generally have to make two
% passes with \LaTeX{} anyway, to get the cross-references right, so
% an additional pass for this purpose shouldn't cause any additional
% problem.  The option includes code to report that `\emph{Label(s)
%   may have changed}', which will help the poor user to realise that
% (yet) another run is in order\dots
%
% \subsection{Options \texttt{PPwarn} and \texttt{PPaux}}
%
% Bugs in this code have been known in the past to cause the process
% of re-running \LaTeX{} to eliminate `\emph{Label(s) may have
% changed}' messages not to terminate.  The author fondly believes
% (after yet another campaign starting in the Christmas holiday of
% 1996) that he has finally squashed all those bugs.
%
% Notwithstanding, being a pragmatic sort of a guy (on a good day),
% the author makes provision for these two debugging options.
% \texttt{PPwarn} makes record (`\emph{Package footmisc warning}') in the
% log of a footnote whose processing is in error, giving the apparent
% page on which it appears, its `natural' number, and its recorded
% value (or the fact that it doesn't seem to have a recorded value).
% The warnings sometimes mention that the footnote is `unprocessed';
% this can happen in two situations:
% \begin{itemize}
% \item when there's no mention of the footnote in any \texttt{.aux}
%   file, in which case the footnote is reported as `not recorded',
%   and
% \item when the footnote has somehow got awry despite being in a file
%   excluded from the present run by virtue of its omission from an
%   \cs{includeonly} command.
% \end{itemize}
%
% The \texttt{PPaux} option writes even more cryptic debugging
% messages to the \texttt{.aux} file; these are really only of any use
% to one who is conversant with the extraordinary inner workings of
% the \texttt{perpage} option.
%
% Since the warnings can only be regarded as distractions for the
% ordinary user, and the \texttt{.aux} output is a mere inefficiency
% in the ordinary course of events, their very existence is suppressed
% in the distribution of the package.  Budding macro-debuggers should
% enable docstrip option \texttt{PPdebug} in file
% \texttt{footmisc.ins} to cause their code to be generated, or use
% the alternative installation file \texttt{footmisc.din} that is
% created by the basic installation process.
%
% \subsection{Option \texttt{para}}
%
% This option (derived from code by Dominik Wujastyk and Chris Rowley)
% causes footnotes to be typeset as a single paragraph at the bottom
% of the page on which they occur.  In the case that there is only one
% footnote on the page, no effect will be observed.  However, if there
% are several footnotes on the page, they will be run together in the
% page foot, each introduced by its footnote mark.  This arrangement
% can save considerable space, but one should bear in mind Jill
% Knuth's admonition on page 125 of the \TeX book: \textsl{Don't use
% footnotes in your books, Don}.  The original demand for the option
% came from the needs of those preparing critical editions; such
% documents typically have large numbers of small footnotes, which
% look ridiculous if each is typeset in a paragraph of its own.  One
% imagines that even Jill Knuth would accept such usage\dots
%
% \subsection{Option \texttt{symbol}}
%
% This option causes footnotes within the document to be `numbered'
% with symbols rather than numbers; since the symbol set (derived from
% command |\fnsymbol|) is somewhat restricted (it contains only 9
% distinct symbols, and does not wrap round), this option only makes
% sense in documents which have very few footnotes in total, or which
% invoke option \texttt{perpage}.
%
% \subsection{Option \texttt{symbol*}}
%
% This is the \texttt{symbol} option, but with protection against the
% tedium that arises because of the instability of the
% \texttt{perpage} option.  When executing the \texttt{perpage}
% option, the package often allocates footnotes to the wrong pages,
% only to correct itself on a later run (having warned the user of the
% need for the later run with a `\emph{Label(s) may have changed}'
% message).  In these circumstances the \texttt{symbol} option is
% prone to producing \LaTeX{} errors, which stop processing, and
% confound automatic generation procedures.  In the same situation,
% the \texttt{symbol*} option produces information messages and a
% warning message at end document, and the user may scan the log for
% those messages \emph{after} processing has stabilised.  The option
% produces numbers (10 and higher) in place of symbols, when the
% footnote number was too large.
%
% \subsection{Option \texttt{bottom}}
%
% This option forces footnotes to the bottom of the page; this is only
% noticeably useful in case that \cs{raggedbottom} is in effect, when
% \LaTeX{} would normally set the footnotes a mere
% \cs{skip}\cs{footins} distant from the bottom of the text.
%
% \subsection{Option \texttt{marginal}}
%
% This option adjusts the position of footnote mark relative to the
% start of the line in which they appear (the the option is
% incompatible with option \texttt{para}, for obvious reasons).
%
% When this option is in effect, the footnote is set
% \cs{footnotemargin} relative to the left margin of the page; the
% default setting for \cs{footnotemargin} is -0.8em, which means that
% the footnote mark will be set jutting 0.8em into the margin.  If
% \cs{footnotemargin} is a positive length, the footnote mark will be
% set with its right edge \cs{footnotemargin} from the margin.  (In
% the absence of the option, \cs{footnotemargin} is set to 1.8em.)
%
% \subsection{Option \texttt{flushmargin}}
%
% This option is as option marginal, but sets the footnote marker
% flush with, but just inside the margin from, the text of the
% footnote.
%
% \subsection{Option \texttt{norule}}
%
% This option suppresses the `normal' footnote rule, and advances
% \cs{skip}\cs{footins} a bit to compensate
%
% \subsection{Option \texttt{splitrule}}
%
% This option makes puts a full-width rule above the split-off part of
% a split footnote.  (Remember that split footnotes don't happen if
% you're doing paragraph footnotes.)
%
% The option provides three different \cs{footnoterule} commands:\\
% \begin{tabular}{ll}
% \cs{mpfootnoterule} & for use in minipages \\
% \cs{pagefootnoterule} & for normal footnotes on regular pages \\
% \cs{splitfootnoterule} & for the tail of a split footnote
% \end{tabular}\\
% By default, \cs{mpfootnoterule} and \cs{pagefootnoterule} retain the
% original definition of \cs{footnoterule} (which nay have been
% modified by a \texttt{norule} option), while \cs{splitfootnoterule}
% becomes a full-width rule.
%
% \subsection{The \texttt{stable} option}
%
% This option deals with the problem of placing footnotes in section
% titles (and so on).  While there is (sometimes, just) justification
% for putting footnotes in titles, \LaTeX's treatment of the content
% of titles militates against them.  Of course, the title argument is
% ordinarily a moving one, and \cs{footnote} is a fragile command, but
% the real problem comes from the way the argument actually moves~---
% which is to two places.  The argument moves to the table of
% contents, where the footnote will (at least) look odd.  But the
% argument also moves to the marks that make up page headers, etc.,
% and \emph{there} it creates havoc, since page headers are executed
% in page make-up, and page make-up \emph{must not} create footnotes.
%
% If you use the \texttt{stable} option, the footnote won't move to
% the table of contents or the page headers, but it will be typeset
% correctly within the title itself.
%
% The situation with \cs{footnotemark} is less dire (it could in
% principle appear in page headers, for example); footnote marks
% appearing on pages other than where their text appears are none the
% less confusing, and the stable option treats \cs{footnotemark} in
% the same way that it treats \cs{footnote}.
%
% \subsection{The \texttt{multiple} option}
%
% This option deals with the case where the author needs to type
% things like
% \begin{verbatim}
%   mumble\footnote{blah}\footnote{grumble}
% \end{verbatim}
% Without special treatment, \LaTeX{} would output something like
% \begin{quote}
%   mumble\textsuperscript{1314}
% \end{quote}
% (one assumes that such an author has a multiplicity of footnotes:
% this sort of case occurs in literary analysis, for example).
%
% What the \texttt{multiple} makes of the above is
% \begin{quote}
%   mumble\textsuperscript{13,14}
% \end{quote}
% which is what most people would expect.  The comma separator
% actually derives from the definition of \cs{multfootsep}, which
% may be changed by \cs{renewcommand} if the option is in effect.
%
% The option also treats \cs{footnotemark} in the same way.
%
% \StopEventually{}
%
% \section{Code: Preliminaries}
%
% Well~--- here we go: let's make the package file:
%
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
% Now declare what environment we need:
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
%    \end{macrocode}
%
% Sometimes, we need a little verbosity for debugging.  This can be
% achieved by un-commenting this line:
%
%    \begin{macrocode}
%\setcounter{errorcontextlines}{999}
%    \end{macrocode}
%
% \section{The package's `initial code'}
%
% This command is defined differently in Matt Swift's \textsf{newclude}
% package (yet to hit the streets), and we also define it here in a
% compatible way
%
%    \begin{macrocode}
\providecommand\protected@writeaux{%
  \protected@write\@auxout
}
%    \end{macrocode}
%
% We make the following (\cs{@@dvance@macro}) generalisable as follows
% (the global form isn't used in this package \dots\ yet):
%
%    \begin{macrocode}
\def\l@advance@macro{\@@dvance@macro\edef}
\def\@@dvance@macro#1#2#3{\expandafter\@tempcnta#2\relax
  \advance\@tempcnta#3\relax
  #1#2{\the\@tempcnta}%
}
%    \end{macrocode}
%
% Now we define a jolly little macro to advance a macro count (|#1|)
% by a given amount (|#2|).
%    \begin{macrocode}
\let\@advance@macro\l@advance@macro
%    \end{macrocode}
%
% Finally, we define the length used by the \texttt{marginal} option,
% and initialise it as if we've not had the option.
%    \begin{macrocode}
\newdimen\footnotemargin
\footnotemargin1.8em\relax
%    \end{macrocode}
%
% \section{Package options}
%
% Most of the code of the package is contained within the option
% processing, one way or another (that which isn't, is executed after
% \cs{ProcessOptions} as a result of flags set in the option
% processing).
%
% \subsection{The \texttt{symbol} option}
%
% This is a declaration that appears in the original \LaTeX{} book.
% Since it appeared in the old |pagefoots.sty| (presumably since it
% goes so naturally with the |perpage| option), I've added this
% trivial piece of customisation to the package.
%
%    \begin{macrocode}
\DeclareOption{symbol}{\renewcommand\thefootnote{\fnsymbol{footnote}}}
%    \end{macrocode}
%
% \subsection{The \texttt{symbol*} option}
%
% The robust version of the \texttt{symbol} option.
%
%    \begin{macrocode}
\DeclareOption{symbol*}{\renewcommand\thefootnote{%
    \ifnum\c@footnote<10
      \fnsymbol{footnote}%
    \else
      \arabic{footnote}%
      \PackageInfo{footmisc}{Footnote number \the\c@footnote\space
        out of range}%
      \protect\@fnsymbol@orange
    \fi
  }
  \global\let\@diagnose@fnsymbol@orange\relax
  \AtEndDocument{\@diagnose@fnsymbol@orange}
  \def\@fnsymbol@orange{\gdef\@diagnose@fnsymbol@orange{%
    \PackageWarningNoLine{footmisc}{Some footnote number(s)
      were out of range
      \MessageBreak
      see log for details}%
    }%
  }
}
%    \end{macrocode}
%
% \subsection{The \texttt{para} option}
%
% The basis of the code for this option comes from \TeX{}book, p.398
% ff.~(``Dirty Tricks''), though it does (of course) avoid
% redefining |\\| which has some other (somewhat significant) uses in
% \LaTeX{}!  The user should be aware of
% Knuth's note on the limitations of this method of doing the job: the
% \TeX{} stack is used four times per footnote, and the stack is
% limited (see the \TeX{}book, p.300 ff.).  If you have very large
% numbers of footnotes (in the hundreds), and encounter the error
% ``|! TeX capacity exceeded, sorry (... save size ...)|'', you may
% need to break your text into smaller sections and compile the
% separately.  Fortunately (say the comments on the original
% |fnpara.sty|) this is very easy to do with \LaTeX{}, provided that
% you reset the footnote counter to make the joins seamless.
%
% First we define a means of hiding |\par| in a case where we need it
% within the declaration of the |para| option
%
%    \begin{macrocode}
\def\FN@unhbox@par#1{\unhbox#1\par}
%    \end{macrocode}
%
% We need some temporary boxes, and \LaTeX{} only defines one
%
%    \begin{macrocode}
\let\FN@tempboxa\@tempboxa
\newbox\FN@tempboxb
\newbox\FN@tempboxc
%    \end{macrocode}
%
% Define the |para| option
%    \begin{macrocode}
\newif\ifFN@para  \FN@parafalse
\DeclareOption{para}{%
%    \end{macrocode}
%
% Another direct crib from the \TeX{}book:
%
%    \begin{macrocode}
  \newskip\footglue \footglue=1em plus.3em minus.3em
%    \end{macrocode}
%
% The standard classes set the footnote mark flush with the text of
% the footnote, but that's not appropriate for paragraph footnotes, we
% find.
%
% There's not much point in patching this code from the original,
% since the only things it has in common with the original are the
% footnote mark and the footnote text (which last is the argument).
% Note that the \cs{leavevmode} isn't necessary except in the case of
% footnotes in minipages, which otherwise end up with the
% \cs{@makefnmark} being executed in restricted vertical mode, which
% results in its \cs{hbox} ending up in a line of its own.
%
%    \begin{macrocode}
  \long\def\@makefntext#1{\leavevmode
    \@makefnmark\nobreak
    \hskip.5em\relax#1%
  }
%    \end{macrocode}
%
% We also need to patch the output routine's handling of footnotes.
% Since this isn't the only instance of this requirement in this
% package, we simply set a flag for it to be done later.
%
%    \begin{macrocode}
  \FN@paratrue
%    \end{macrocode}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% We need to record a value for the baseline skip when in footnotes:
%
%    \begin{macrocode}
{\footnotesize \newdimen\footnotebaselineskip
  \global
  \footnotebaselineskip=\normalbaselineskip}
%    \end{macrocode}
%
% Now we derive a fudge factor from the baselineskip we've just
% established\footnote{We use \cs{strip@pt} which is defined for use
% in the \LaTeXe{} kernel, but not documented: this is a potential
% problem, but I don't imagine it will be, since the definition is
% obviously \emph{right}}:
% 
%    \begin{macrocode}
\@tempdima=\footnotebaselineskip \multiply\@tempdima by 1024
\divide \@tempdima by \columnwidth \multiply\@tempdima by 64
\xdef\fudgefactor{\strip@pt\@tempdima }
%    \end{macrocode}
%
%    \begin{macrocode}
\def\makefootnoteparagraph{\unvbox\footins \makehboxofhboxes
  \setbox\FN@tempboxa=\hbox{\unhbox\FN@tempboxa \removehboxes}
%    \end{macrocode}
%CCCC  ---now we are ready to set the paragraph:
%    \begin{macrocode}
    \hsize\columnwidth
    \@parboxrestore
    \baselineskip=\footnotebaselineskip
    \noindent
%    \end{macrocode}
%CCCC ---this is where the strut is needed:
%    \begin{macrocode}
  \rule{\z@}{\footnotesep}%
  \FN@unhbox@par{\FN@tempboxa}
}
\def\makehboxofhboxes{\setbox\FN@tempboxa=\hbox{}
  \loop\setbox\FN@tempboxb=\lastbox \ifhbox\FN@tempboxb
  \setbox\FN@tempboxa=\hbox{\box\FN@tempboxb\unhbox\FN@tempboxa}\repeat}
\def\removehboxes{\setbox\FN@tempboxa=\lastbox
  \ifhbox\FN@tempboxa{\removehboxes}\unhbox\FN@tempboxa \fi}
%
}
%    \end{macrocode}
%
% \subsection{The \texttt{perpage} option}
%
% A footnote-numbering modification from Brian T. Schellenberger.
% Brian's code is ``redistributable by anybody to anybody for any
% price'', subject to crediting his contribution (which I do herewith:
% a nice piece of stuff, Brian), and subject to reasonable conditions
% about distributing modified versions (which include sending a copy
% back to him).
% 
%    \begin{macrocode}
\newif\ifFN@perpage  \FN@perpagefalse
\DeclareOption{perpage}{%
%    \end{macrocode}
%
% The footnote code itself.
%
% \cs{PP@footnote}: stuff for handling footnotes numbered per page.
%
%    \begin{macrocode}
\def \PP@footnote
  {%
%    \end{macrocode}
%
% Are we in a minipage?  If so, there's no issue, since they're all
% done and finished in themselves, and footnotes can't defer to a new
% page\dots
%
%    \begin{macrocode}
  \if@minipage\else
%    \end{macrocode}
%
% Make a \cs{newfoot@mark} for the next time
%
%    \begin{macrocode}
     \if@filesw
        \edef \@tempa
           {%
           \noexpand\protected@writeaux\relax
              {%
              \string\newfoot@mark{\thepage}%
                 {\the\c@footnote}{\noexpand\thepage}%
              }%
           }%
        \@tempa
     \fi
%    \end{macrocode}
%
% Now we look at the name that might have been created by a
% \cs{newfoot@mark} when the |.aux| file was scanned at begin
% document.
%
%    \begin{macrocode}
     \edef \@tempa {ft@\thepage-\the\c@footnote}%
     \expandafter\ifx\csname\@tempa\endcsname \relax
     \else
%    \end{macrocode}
%
% Are records of the `found' footnote details wanted in the |.aux|
% file?
%    \begin{macrocode}
%<*PPdebug>
       \ifPP@auxwanted
         \edef\@tempb{\@foot@found{\thepage/%
             \the\c@footnote/\csname\@tempa\endcsname}}%
         \write\@auxout{\@tempb}%
       \fi
%</PPdebug>
%    \end{macrocode}
%
% The name is defined: we need to replace the footnote number with
% what (should have) happened last time
%
%    \begin{macrocode}
       \begingroup
         \global\expandafter\c@footnote
           \csname\@tempa\endcsname\relax
         \xdef \@thefnmark {\thefootnote}%
%    \end{macrocode}
%
% In some perverse situations, the same pattern of footnote and page
% will recur, so we preserve the information for the end-document
% check, and cancel this name:
%
%    \begin{macrocode}
         \expandafter\xdef\csname old\@tempa\endcsname
                       {\csname\@tempa\endcsname}%
         \global\expandafter\let
               \csname\@tempa\endcsname\relax
        \endgroup
     \fi
%    \end{macrocode}
%
% Close the conditional (minipage) around the whole thing
%
%    \begin{macrocode}
  \fi
  }
%    \end{macrocode}
%
% Macros for use while reading the |.aux| file at \cs{begin}|{document}|:
%
% \cs{ft@page} is the page we appear to be on.
%
%    \begin{macrocode}
\def\ft@page{0}
%    \end{macrocode}
%
% \cs{ft@prevpage} is the apparent page at the time of the previous
% footnote; we need to know this to `simulate' the effect of resetting
% the footnote counter when the page number is stepped.
%
%    \begin{macrocode}
\def\ft@prevpage{-1}
%    \end{macrocode}
%
% \cs{ft@foot} is the footnote number last used.
%
%    \begin{macrocode}
\def\ft@foot{0}
%    \end{macrocode}
%
% \cs{newfoot@mark}s appear in the |.aux| file (unless this is the
% first time around); each one contains:
% \begin{itemize}
% \item nominal page where the typesetting seemed to be happening at
%   the time the \cs{footnote} was typeset, as by \cs{thepage},
%   \cs{immediate} at the time the footnote was encountered.
% \item nominal footnote number on that page.
% \item actual page it occurs on, as by \cs{thepage} deferred to
%   \cs{shipout} time.
% \end{itemize}
%
%    \begin{macrocode}
\def \newfoot@mark #1#2#3{%
%    \end{macrocode}
%
% Create an idea of what the footnote ought to be, in \cs{@tempb}
%
%    \begin{macrocode}
  \edef\@tempb{\ft@foot}%
  \@advance@macro\@tempb1%
  \def\@tempa{#1}%
  \ifx\@tempa\ft@prevpage\else
    \edef\ft@prevpage{\@tempa}%
    \def\@tempb{1}%
  \fi
%    \end{macrocode}
%
% We don't even try to play funny games if the actual page isn't a
% number:
%
%    \begin{macrocode}
  \@ifdigit{#3}{%
%    \end{macrocode}
%
% Well, it is a number: is it different from the page number we might
% expect?  If \cs{ft@page} has got ahead of itself, reset it to zero;
% if the actual page has gone ahead of \cs{ft@page}, we set
% \cs{ft@page} from it and reset \cs{ft@foot}
%
%    \begin{macrocode}
    \expandafter\ifnum \ft@page > #3\relax
      \def\ft@page{0}%
    \else
      \expandafter\ifnum \ft@page < #3\relax
        \def\ft@page{#3}%
        \def\ft@foot{0}%
    \fi\fi}%
%    \end{macrocode}
%
% if the `actual page' wasn't numeric, we simply reset \cs{ft@page}
%
%    \begin{macrocode}
   {\def\ft@page{0}}%
%    \end{macrocode}
%
% Now advance our `expected' footnote number; if it's different from
% what would be typeset without our intervention, create a macro
% \cs{ft@}\meta{apparent-page}|-|\meta{natural-footnote} that contains
% the number that in fact needs to be typeset.
%    \begin{macrocode}
  \@advance@macro\ft@foot1%
  \def\@tempa{#2}%
  \ifx \@tempa\ft@foot \else
    \ifx\@tempb\ft@foot \else
      \expandafter \xdef \csname ft@#1-#2\endcsname {\ft@foot}%
    \fi
  \fi
}
%    \end{macrocode}
%
% \cs{@foot@found} is a no-op in the debugging code:
%    \begin{macrocode}
%<PPdebug>\let\@foot@found\@gobble
%    \end{macrocode}
%
% Don't need that definition in the body of the code (though something
% similar is resurrected at end document).
%
%    \begin{macrocode}
\@onlypreamble\newfoot@mark
%<PPdebug>\AtBeginDocument{\let\@foot@found\relax}
%    \end{macrocode}
%
% A simple bit of code to detect whether the argument it's offered is
% a number (at least to the extent of starting with a digit).
%
% Apparent external interface is:
%
% \noindent \cs{@ifdigit}\marg{poss digits}\marg{digit
%   text}\marg{non-digit text}
%
%    \begin{macrocode}
\def\@ifdigit#1{\expandafter\@digithelp\string#1\@digithelp}%
%    \end{macrocode}
%
% Behold, a piece of horrible code, slowly reducing in number of
% tokens as I find ways to improve it, which does the guts of
% \cs{@ifdigit}.  (The original was a sequence of \cs{if}s comparing
% to each digit in turn; this one at least is more fun\dots)
%
%    \begin{macrocode}
\def\@digithelp#1#2\@digithelp{%
  \ifnum `#1<`0
    \expandafter\@secondoftwo
  \else
    \ifnum `#1>`9
      \@triple@expandafter\@secondoftwo
    \else
      \@triple@expandafter\@firstoftwo
    \fi
  \fi}
%    \end{macrocode}
%
% Since we use \cs{@triple@expandafter}, we had better define it.  (I
% think the kernel could do with it, in fact\dots)
%
%    \begin{macrocode}
\providecommand\@triple@expandafter{\expandafter
  \expandafter\expandafter}
%    \end{macrocode}
%
% \cs{enddoc@newfoot@mark} is used to detect channges at the end of
% the run, when the new |.aux| file is scanned.  It's mostly the same
% as \cs{newfoot@mark}, except at its last gasp\dots
%
%    \begin{macrocode}
\def \enddoc@newfoot@mark #1#2#3{%
  \edef\@tempb{\ft@foot}%
  \@advance@macro\@tempb1%
  \def\@tempa{#1}%
  \ifx\@tempa\ft@prevpage\else
    \edef\ft@prevpage{\@tempa}%
    \def\@tempb{1}%
  \fi
  \@ifdigit{#3}{%
    \expandafter\ifnum \ft@page > #3\relax
      \def\ft@page{0}%
    \else
      \expandafter\ifnum \ft@page < #3\relax
        \def\ft@page{#3}%
        \def\ft@foot{0}%
    \fi\fi}%
   {\def\ft@page{0}}%
%    \end{macrocode}
%
% If our `expected' footnote number is different from what would be
% typeset without our intervention, check there was a macro
% \cs{ft@}\meta{apparent-page}|-|\meta{natural-footnote} containing
% the number that in fact needs to be typeset.
%
%    \begin{macrocode}
  \@advance@macro\ft@foot1%
  \def\@tempa{#2}%
  \ifx \@tempa\ft@foot \else
    \ifx\@tempb\ft@foot\else
      \expandafter \ifx \csname oldft@#1-#2\endcsname \ft@foot
%    \end{macrocode}
%
% Well, it was right \dots\ so junk it
%
%    \begin{macrocode}
        \global\expandafter\let
               \csname oldft@#1-#2\endcsname \relax
      \else
%    \end{macrocode}
%
% Log (or even warn) about the failure if the user asked for it
%
%    \begin{macrocode}
%<*PPdebug>
        \ifPP@warnwanted
          \expandafter\ifx\csname oldft@#1-#2\endcsname\relax
          \else
            \PackageWarningNoLine{footmisc}{Footnote #2 on page #1 has moved:%
              \MessageBreak
              recorded value \csname oldft@#1-#2\endcsname,
              should be \ft@foot}%
          \fi
        \fi
%</PPdebug>
%    \end{macrocode}
%
% It was wrong: it was probably undefined in the first case, so we
% simply pass on to the un-modified version of the original
% \cs{ft@}\meta{p}\verb'-'\meta{f} macro.  That could still be around
% if it was originally defined in the \verb'.aux' of a file excluded
% by its omission from a \cs{includeonly} statement.
%
%    \begin{macrocode}
        \expandafter \ifx \csname ft@#1-#2\endcsname \ft@foot
          \global\expandafter\let
                 \csname ft@#1-#2\endcsname \relax
        \else
%    \end{macrocode}
%
% Well, there are limits to our enthusiasm to prove that this was an
% OK footnote: we log it if necessary, and flag that there's a need
% for another pass\dots
%
%    \begin{macrocode}
%<*PPdebug>
          \ifPP@warnwanted
            \PackageWarningNoLine{footmisc}{Unprocessed footnote #2 on page #1
              \expandafter\ifx\csname ft@#1-#2\endcsname\relax
                not recorded;\MessageBreak
              \else
                \MessageBreak
                recorded value \csname ft@#1-#2\endcsname,
              \fi
              should be \ft@foot}%
          \fi
%</PPdebug>
          \@tempswatrue
        \fi
      \fi
    \fi
  \fi
}
%    \end{macrocode}
%
% At the end of the document, redefine \cs{newfoot@mark} to perform
% a check for footnote labels misbehaving when the |.aux| file is
% scanned:
%
%    \begin{macrocode}
\AtEndDocument{%
  \def\ft@page{0}
  \def\ft@foot{0}
  \let\newfoot@mark\enddoc@newfoot@mark
  }
%    \end{macrocode}
%
% Mark we've patching to do, and arrange that the reset list (of
% \cs{c@page} takes most of the strain\dots
%
%    \begin{macrocode}
\FN@perpagetrue
\@addtoreset{footnote}{page}%
}
%    \end{macrocode}
%
% \subsection{The \texttt{PPwarn} and \texttt{PPaux} options}
%
% These set a flag, and define the command to use for error messages
%
%    \begin{macrocode}
%<*PPdebug>
\newif\ifPP@warnwanted    \PP@warnwantedfalse
\DeclareOption{PPwarn}{\PP@warnwantedtrue}
\newif\ifPP@auxwanted     \PP@auxwantedfalse
\DeclareOption{PPaux}{\PP@auxwantedtrue}
%</PPdebug>
%    \end{macrocode}
%
% \subsection{The \texttt{bottom} option}
%
% All this needs to do is to set a flag to say that it should happen
%    \begin{macrocode}
\newif\ifFN@bottom  \FN@bottomfalse
\DeclareOption{bottom}{%
  \FN@bottomtrue
}
%    \end{macrocode}
%
% \subsection{The \texttt{marginal} option}
%
% Again, the processing of the option is pretty trivial:
%    \begin{macrocode}
\DeclareOption{marginal}{%
  \footnotemargin-0.8em\relax
}
%    \end{macrocode}
%
% \subsection{The \texttt{flushmargin} option}
%
% Again, the processing of the option is pretty trivial:
%    \begin{macrocode}
\DeclareOption{flushmargin}{%
  \footnotemargin0pt\relax
}
%    \end{macrocode}
%
% \subsection{The \texttt{norule} option}
%
% Pretty simple too\dots
%
%    \begin{macrocode}
\DeclareOption{norule}{%
  \renewcommand\footnoterule{}%
  \advance\skip\footins 4\p@\@plus2\p@\relax
}
%    \end{macrocode}
%
% \subsection{The \texttt{splitrule} option}
%
% This is from a posting by Donald Arseneau dated 13 November 1996.
% The code relies on the fact that \LaTeX{} only uses inserts for
% footnotes, so that if any insert is going to be split, it's going to
% be a footnote.
%
%    \begin{macrocode}
\DeclareOption{splitrule}{%
  \gdef\split@prev{0}
%    \end{macrocode}
%
% Define defaults for the three footnote rules: note, we inherit the
% current state of \cs{footnoterule} for the two `regular' footnote
% defaults, and if we've been preceded by option \texttt{norule}, they
% will both become null\dots
%    \begin{macrocode}
  \let\pagefootnoterule\footnoterule
  \let\mpfootnoterule\footnoterule
  \def\splitfootnoterule{\kern-3\p@ \hrule \kern2.6\p@}
%    \end{macrocode}
%
% Now redefine \cs{footnoterule} to distinguish the three situations.
%    \begin{macrocode}
  \def\footnoterule{\relax
    \ifx \@listdepth\@mplistdepth
%    \end{macrocode}
%
% In a minipage
%    \begin{macrocode}
      \mpfootnoterule 
    \else
      \ifnum\split@prev=\z@
%    \end{macrocode}
%
% Normal footnote on a regular page
%    \begin{macrocode}
        \pagefootnoterule
      \else
%    \end{macrocode}
%
% Second part of a split footnote 
%    \begin{macrocode}
        \splitfootnoterule
      \fi 
%    \end{macrocode}
%
% Remember a split for next page
%    \begin{macrocode}
      \xdef\split@prev{\the\insertpenalties}%
    \fi
  }%
}
%    \end{macrocode}
%
% \subsection{The \texttt{stable} option}
%
% Simply set a flag: the code of this gets executed at the very end of
% the package.
%    \begin{macrocode}
\newif\ifFN@stablefootnote  \FN@stablefootnotefalse
\DeclareOption{stable}{\FN@stablefootnotetrue}
%    \end{macrocode}
%
% \subsection{The \texttt{multiple} option}
%
% Again, simply set a flag, for code that gets executed at the very
% very very end of the package.
%    \begin{macrocode}
\newif\ifFN@multiplefootnote  \FN@multiplefootnotefalse
\DeclareOption{multiple}{\FN@multiplefootnotetrue
  \providecommand\multfootsep{,}}
%    \end{macrocode}
%
% \subsection{The start of the endgame}
%
% Exercise the options that the user has requested\dots
%    \begin{macrocode}
\ProcessOptions
%    \end{macrocode}
%
% \section{Hacking kernel commands}
%
% Various standard commands (some of them internal ones) need to be
% hacked to achieve our effects, and we do all of this now, according
% to flags set in option processing.
%
% \subsection{The output routine}
%
% Now; do we need to mess about with the output routine?  If either
% |para| or |bottom| has been invoked, we do.
%    \begin{macrocode}
\let  \if@tempswa  \ifFN@bottom
\ifFN@para    \@tempswatrue \fi
\if@tempswa
%    \end{macrocode}
% \dots{} so we've patching to do.
%
% First, we ensure that \cs{@makecol} is as expected from the time at
% which these macros were written: since we're going to patch it, we
% had better be sure that we're patching the right thing.
%    \begin{macrocode}
  \CheckCommand*\@makecol{\ifvoid \footins
      \setbox\@outputbox \box\@cclv
    \else
      \setbox\@outputbox \vbox{%
        \boxmaxdepth\@maxdepth
        \unvbox\@cclv
        \vskip \skip\footins
        \color@begingroup
          \normalcolor\footnoterule
          \unvbox\footins
        \color@endgroup
      }%
    \fi
    \xdef\@freelist{\@freelist\@midlist}%
    \global\let\@midlist\@empty
    \@combinefloats
    \ifvbox\@kludgeins
      \@makespecialcolbox
    \else
      \setbox\@outputbox \vbox to\@colht{%
        \@texttop \dimen@\dp\@outputbox
        \unvbox\@outputbox
        \vskip -\dimen@\@textbottom
      }%
    \fi
    \global\maxdepth\@maxdepth
  }
%    \end{macrocode}
%
% Now we start building up the revised version of \cs{@makecol}: the
% definition starts out in \cs{toks@}
%    \begin{macrocode}
  \toks@{\ifvoid \footins
      \setbox\@outputbox \box\@cclv
    \else
  }
%    \end{macrocode}
%
% Was option \textsf{bottom} was requested?
%    \begin{macrocode}
    \ifFN@bottom
%    \end{macrocode}
%
% In this case, we've to fix the size of \cs{vbox} that \cs{@makecol}
% uses if there's a footnote present on the page, and then stick a
% \cs{vfill} in it:
%
%    \begin{macrocode}
    \toks@\expandafter{\the\toks@
      \setbox\@outputbox \vbox to\@colht\bgroup
        \boxmaxdepth\@maxdepth
        \unvbox\@cclv
        \vfill\relax
        \vskip\skip\footins
        \color@begingroup
          \normalcolor\footnoterule
    }
%    \end{macrocode}
%
% That completes \textsf{bottom}; if we're not doing that option, put
% the `normal' code in here.
%    \begin{macrocode}
  \else
    \toks@\expandafter{\the\toks@
      \setbox\@outputbox \vbox\bgroup
      \boxmaxdepth\@maxdepth
      \unvbox\@cclv
      \vskip \skip\footins
      \color@begingroup
        \normalcolor\footnoterule
    }
  \fi
%    \end{macrocode}
%
% Similarly, if we're doing paragraph footnotes, the actual grubby end
% of the work is done in the output routine; the need for this is
% signalled by the flag being odd.
%
%    \begin{macrocode}
  \ifFN@para
%    \end{macrocode}
%
% The output routine part of it simply makes a box out of the
% paragraph of footnotes, and then stuffing the contents of the box
% into that which is going to be \cs{ship}ped |out|.
%    \begin{macrocode}
    \toks@\expandafter{\the\toks@
          \global\setbox\FN@tempboxc\vbox{\makefootnoteparagraph}%
          \unvbox\FN@tempboxc
        \color@endgroup
      \egroup
    }
%    \end{macrocode}
% (Note: the rest of the definition of \cs{@makecol} happens a
% \emph{long} way away, after the redefinition of \cs{@footnotetext}.)
%
% Paragraph footnotes also require that we patch \cs{@footnotetext},
% so we do this here, too:
%    \begin{macrocode}
    \@ifl@t@r\fmtversion{1997/12/01}{%
      \CheckCommand\@footnotetext[1]{%
        \insert\footins{%
          \reset@font\footnotesize
          \interlinepenalty\interfootnotelinepenalty
          \splittopskip\footnotesep
          \splitmaxdepth \dp\strutbox
          \floatingpenalty\@MM 
          \hsize\columnwidth
          \@parboxrestore
          \protected@edef\@currentlabel{%
            \csname p@footnote\endcsname\@thefnmark
          }%
          \color@begingroup
            \@makefntext{\rule\z@\footnotesep
            \ignorespaces#1\@finalstrut\strutbox
          }%
          \color@endgroup
        }%
      }%
    }{%
      \CheckCommand\@footnotetext[1]{%
        \insert\footins{%
          \reset@font\footnotesize
          \interlinepenalty\interfootnotelinepenalty
          \splittopskip\footnotesep
          \splitmaxdepth \dp\strutbox
          \floatingpenalty\@MM 
          \hsize\columnwidth
          \@parboxrestore
          \protected@edef\@currentlabel
            {\csname p@footnote\endcsname\@thefnmark}%
          \color@begingroup
            \@makefntext{\rule\z@\footnotesep
            \ignorespaces#1\@finalstrut\strutbox
          }
%    \end{macrocode}
%
% The 1997/06/01 \LaTeX{} source really doesn't have a comment mark
% after that closing brace.
%    \begin{macrocode}
          \color@endgroup
        }%
      }%
    }
    \renewcommand\@footnotetext[1]{%
      \insert\footins{%
        \reset@font\footnotesize
        \interlinepenalty\interfootnotelinepenalty
        \splittopskip\footnotesep
        \splitmaxdepth \dp\strutbox
        \floatingpenalty\@MM 
        \hsize\columnwidth
        \@parboxrestore
        \protected@edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
        \color@begingroup
%    \end{macrocode}
%
% We set the paragraph in an \cs{hbox} and apply the fudge factor
% here:
%
%    \begin{macrocode}
          \setbox\FN@tempboxa=\hbox{%
%    \end{macrocode}
%
% This needs a parameter; the rule should be moved to the beginning of
% the footnote paragraph, but the \cs{ignorespaces} should be left
% here.
%
%    \begin{macrocode}
             \@makefntext{\ignorespaces#1\strut
%    \end{macrocode}
%
% We insert a penalty\footnote{Well, a negative penalty~--- perhaps,
% more of an encouragement\dots} here to help line breaking in the
% footnote paragraph; the value is taken from the \TeX{}book.
%
%    \begin{macrocode}
            \penalty-10\relax
            \hskip\footglue
          }% end of \@makefntext parameter
        }% end of \hbox
        \dp\FN@tempboxa=0pt\ht\FN@tempboxa=\fudgefactor\wd\FN@tempboxa
        \box\FN@tempboxa
      }%
      \color@endgroup
    }
%    \end{macrocode}
%
% If we're not doing paragraph footnotes, we insert the little bit of
% code that would have been replaced by the stuff above:
%    \begin{macrocode}
  \else
    \toks@\expandafter{\the\toks@
          \unvbox\footins
        \color@endgroup
      \egroup
    }
  \fi
%    \end{macrocode}
%
% Finally, tag the rest of the definition of \cs{@makecol} onto
% \cs{toks@}, and create the new definition from the resulting object.
%    \begin{macrocode}
  \toks@\expandafter{\the\toks@
    \fi
    \xdef\@freelist{\@freelist\@midlist}%
    \global\let\@midlist\@empty
    \@combinefloats
    \ifvbox\@kludgeins
      \@makespecialcolbox
    \else
      \setbox\@outputbox \vbox to\@colht{%
        \@texttop \dimen@\dp\@outputbox
        \unvbox\@outputbox
        \vskip -\dimen@\@textbottom
      }%
    \fi
    \global\maxdepth\@maxdepth
  }
  \edef\@makecol{\the\toks@}
%    \end{macrocode}
%
% All of the above occurred conditionally on the `or' of
% \cs{ifFN@para} and \cs{ifFN@bottom}, so we now close the
% conditional.
%    \begin{macrocode}
\fi
%    \end{macrocode}
%
% \subsection{The other footnote commands}
%
% Now, do we need to patch \cs{footnote} for per-page footnotes?
%    \begin{macrocode}
\ifFN@perpage
  \CheckCommand*\footnote{\@ifnextchar [%]
    \@xfootnote
    {%
      \stepcounter\@mpfn \protected@xdef\@thefnmark{\thempfn}%
      \@footnotemark \@footnotetext
    }%
  }
  \renewcommand*\footnote{\@ifnextchar [%]
    \@xfootnote
    {%
      \stepcounter\@mpfn \protected@xdef\@thefnmark{\thempfn}%
      \PP@footnote\@footnotemark \@footnotetext
    }%
  }
%    \end{macrocode}
%
% And the analagous change for \cs{footnotemark}
%    \begin{macrocode}
  \CheckCommand*\footnotemark{%
    \@ifnextchar [%]
    \@xfootnotemark
    {%
      \stepcounter{footnote}%
      \protected@xdef\@thefnmark{\thefootnote}%
      \@footnotemark
    }%
  }
  \renewcommand*\footnotemark{%
    \@ifnextchar [%]
    \@xfootnotemark
    {%
      \stepcounter{footnote}%
      \protected@xdef\@thefnmark{\thefootnote}%
      \PP@footnote\@footnotemark
    }%
  }
\fi
%    \end{macrocode}
%
% Finally, if we're not doing paragraph footnotes, we redefine
% \cs{@makefntext} to take account of the value of
% \cs{footnotemargin}
%    \begin{macrocode}
\ifFN@para
\else
  \long\def\@makefntext#1{%
    \parindent1em
    \noindent
    \ifdim\footnotemargin>0pt
      \hb@xt@ \footnotemargin{\hss\@makefnmark}%
    \else
      \ifdim\footnotemargin=0pt
        \llap{\textsuperscript{\@thefnmark}}%
      \else
        \llap{\hb@xt@ -\footnotemargin{\textsuperscript{\@thefnmark}\hss}}%
      \fi
    \fi
    #1%
  }
\fi
%    \end{macrocode}
%
% \section{Post-endgame: dancing around the table}
%
% We have to insert the code that executes the \texttt{stable} and
% \texttt{multiple} options.  Since \texttt{stable} may suppress the
% setting of a footnote altogether, we put the \texttt{multiple}
% option first, as otherwise we might get isolated superscripted
% commas that separate footnotes that have otherwise been suppressed.
%
% \subsection{The code that executes the \texttt{multiple} option}
%
% The code simply executes a `normal' \cs{footnote} command, and then
% looks to see if the next command is also a \cs{footnote} command, in
% which case it inserts a separator.
%    \begin{macrocode}
\ifFN@multiplefootnote
  \let\MF@@footnote\footnote
  \renewcommand\footnote[2][]{\def\@tempa{#1}%
    \ifx\@tempa\@empty
      \MF@@footnote{#2}%
    \else
      \MF@@footnote[#1]{#2}%
    \fi
    \futurelet\@let@token\@next@footnote}
  %
  \let\MF@@footnotemark\footnotemark
  \renewcommand\footnotemark[1][]{\def\@tempa{#1}%
    \ifx\@tempa\@empty
      \MF@@footnotemark
    \else
      \MF@@footnotemark[2]%
    \fi
    \futurelet\@let@token\@next@footnote}
  %
  \def\@next@footnote{\ifx\@let@token\footnote
      \textsuperscript{\multfootsep}%
    \else
      \ifx\@let@token\footnotemark
        \textsuperscript{\multfootsep}%
      \fi
    \fi}
\fi
%    \end{macrocode}
%
% \subsection{The code that executes the \texttt{stable} option}
%
% The basic idea is to use the `original' code of \cs{footnote} (which
% this package may have hacked around something chronic) only if we're
% in typesetting mode (as determined by the state of the \cs{protect}
% command.  Otherwise, the command becomes an elaborate multistage
% `gobble'.
%    \begin{macrocode}
\ifFN@stablefootnote
\let\SF@@footnote\footnote
\def\footnote{\ifx\protect\@typeset@protect
    \expandafter\SF@@footnote
  \else
    \expandafter\SF@gobble@opt
  \fi
}
%    \end{macrocode}
%
% Define \cs{SF@gobble@opt} as a robust command that gobbles either
% an optional and a mandatory argument, or just a mandatory one.
%    \begin{macrocode}
\edef\SF@gobble@opt{\noexpand\protect
  \expandafter\noexpand\csname SF@gobble@opt \endcsname}
\expandafter\def\csname SF@gobble@opt \endcsname{
  \@ifnextchar[%]
    \SF@gobble@twobracket
    \@gobble
}
\def\SF@gobble@twobracket[#1]#2{}
%    \end{macrocode}
% Now the same for \cs{footnotemark}
%    \begin{macrocode}
\let\SF@@footnotemark\footnotemark
\def\footnotemark{\ifx\protect\@typeset@protect
    \expandafter\SF@@footnotemark
  \else
    \expandafter\SF@gobble@optonly
  \fi
}
\edef\SF@gobble@optonly{\noexpand\protect
  \expandafter\noexpand\csname SF@gobble@optonly \endcsname}
\expandafter\def\csname SF@gobble@optonly \endcsname{
  \@ifnextchar[%]
    \SF@gobble@bracket
    {}%
}
\def\SF@gobble@bracket[#1]{}
\fi
%</package>
%    \end{macrocode}
%
% \section{An installation file for the debugging version}
%
% We don't enable the debugging option by default, but this version of
% the installation file will enable it, for the benefit of the
% terminally curious.
%
%    \begin{macrocode}
%<*debugins>
\def\batchfile{footmisc.din}
\input docstrip.tex
\keepsilent
\Msg{*** Generating the footmisc package, debugging version ***}
\askforoverwritefalse
\generate{\file{footmisc.sty}{\from{footmisc.dtx}{package,PPdebug}}}  

\ifToplevel{
\Msg{***********************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the file}
\Msg{* footmisc.sty into a directory searched by TeX}
\Msg{*}
\Msg{* To produce the documentation run the file `footmisc.dtx'}
\Msg{* through LaTeX.  To produce a code listing at the same time,}
\Msg{* include the command:}
\Msg{* \space\space\string\AtBeginDocument{\string\AlsoImplementation}}
\Msg{* in file ltxdoc.cfg}
\Msg{*}
\Msg{* Happy TeXing}
\Msg{*}
\Msg{***********************************************************}
}

%</debugins>
%    \end{macrocode}
%
% \Finale
%
%
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
