%%% ====================================================================
%%%  @LaTeX-style-file{
%%%     author          = "Nelson H. F. Beebe",
%%%     version         = "1.02",
%%%     date            = "15 September 1994",
%%%     time            = "23:15:40 MDT",
%%%     filename        = "fparith.sty",
%%%     address         = "Center for Scientific Computing
%%%                        Department of Mathematics
%%%                        University of Utah
%%%                        Salt Lake City, UT 84112
%%%                        USA",
%%%     telephone       = "+1 801 581 5254",
%%%     FAX             = "+1 801 581 4148",
%%%     checksum        = "42101 212 957 8790",
%%%     email           = "beebe@math.utah.edu (Internet)",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "bibliography, floating-point arithmetic",
%%%     supported       = "yes",
%%%     docstring       = "This LaTeX style option file is used by the
%%%                        companion fparith.ltx file to produce a
%%%                        bibliography in which references can appear
%%%                        either in each section (if the bibunits
%%%                        style is included before this one), or at
%%%                        the end of the document.  Sectional
%%%                        bibliographies are essential for the
%%%                        production of certain types of annotated
%%%                        bibliographies.
%%%
%%%                        In either case, citations in each should be
%%%                        grouped inside a Bibunit environment, like
%%%                        this:
%%%
%%%                        \begin{Bibunit}
%%%                          \Cite{tag-1,tag-2,...,tag-n}
%%%                        \end{Bibunit}
%%%
%%%                        \Cite, rather than \cite or \nocite, must
%%%                        be used, so that it can be internally
%%%                        redefined to either of the latter, as
%%%                        appropriate, while still preserving the
%%%                        normal effect of \cite and \nocite commands
%%%                        that might appear in the .bib file entries.
%%%
%%%                        If you want all citations to also appear a
%%%                        second time, in a master bibliography at
%%%                        the end of your document, then just use the
%%%                        normal
%%%
%%%                        \bibliographystyle{...}
%%%                        \bibliography{...}
%%%
%%%                        commands; otherwise, these two commands
%%%                        should be omitted.
%%%
%%%                        Each sectional bibliography from a Bibunit
%%%                        environment produces a corresponding .aux
%%%                        file named with the base \jobname plus a
%%%                        numeric extension, e.g. foo.1.aux,
%%%                        foo.2,aux, ...;  each of these must be
%%%                        processed by BibTeX to create files
%%%                        foo.1.bbl, foo.2.bbl, ...  There will also
%%%                        be a normal .aux file, foo.aux, which
%%%                        BibTeX needs to process if there is a
%%%                        separate master bibliography at the end.
%%%
%%%                        Because each .aux file requires separate
%%%                        BibTeX processing, it is possible to have
%%%                        different bibliography styles and
%%%                        bibliography data bases in each of them.
%%%                        However, we do not provide for this
%%%                        possibility here.
%%%
%%%                        If the showtags option appears before this
%%%                        one in the \documentstyle command, then its
%%%                        action is adjusted to place the boxed
%%%                        citation tag in smaller type to the left of
%%%                        the reference tag, instead of on a separate
%%%                        line above the reference, so as to produce
%%%                        a more compact bibliography while still
%%%                        preserving useful information.
%%%
%%%                        The checksum field above contains a CRC-16
%%%                        checksum as the first value, followed by the
%%%                        equivalent of the standard UNIX wc (word
%%%                        count) utility output of lines, words, and
%%%                        characters.  This is produced by Robert
%%%                        Solovay's checksum utility.",
%%%  }
%%% ====================================================================

%
% Set the tag box to the left of the line, instead of to the right.
\def \thecitetag #1%
{%
    \unskip                     % discard the \hfill glue set in \@showtag.
    \llap {\fbox {\footnotesize \sf #1}\quad }% left overlap the boxed label
    \hfil                       % and set it flush left
}

%
% Reduce \fboxsep from default 3pt so that boxes from adjacent
% one-line citations do not touch.
%
\fboxsep = 2pt

%
% Redefine \@showtag to reposition the next line (the first line of
% the bibliographic reference) to share a common baseline with the
% text in the tag box.
%
\def \@showtag #1%
{%
    \@tempdima=\textwidth
    \if@twocolumn
        \advance\@tempdima by -\columnsep
        \divide\@tempdima by 2
    \fi
    \setbox0=\hbox to \@tempdima{\hfil\thecitetag{\strut#1}}
    \ht0 = 0pt
    \dp0 = 0pt
    \box0 \nobreak
    \vskip -\baselineskip \nobreak
    \vskip -\fboxsep \nobreak
    \vskip -\fboxrule \nobreak
}

% Define the Bibunit environment so that its work with and without
% the bibunit style.
\ifx \bibunit \undefined

  % then bibunit style was not used, so Bibunit becomes a do-nothing
  % environment, while still preserving group semantics
  \newenvironment{Bibunit}%
  {
    \begingroup
      \let \Cite = \cite          % want citations in running text
  }
  {\endgroup}

\else

  % use the bibunit style commands to set the citations in each Bibunit
  % in a separate bibliography, without any citation cross-references
  % appearing in the running text.

  \newcounter{lastrefnum}       % memory of last reference number

  % Remove unwanted section headings for each bibliography fragment,
  % by commenting out the \section*{} line in \thebibliography from
  % article.doc.  Also, reset the reference number counter, enumi,
  % to the value last used for it, so that reference numbers increase
  % throughout the document, rather than restarting from 1 in each
  % section.
  \renewcommand{\thebibliography}[1]%
  {%
    %% SUPPRESS: \section*{References\@mkboth{REFERENCES}{REFERENCES}}
   \list
   {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \usecounter{enumi}}
    \setcounter{enumi}{\value{lastrefnum}}
    \def\newblock{\hskip .11em plus .33em minus .07em}%
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=1000\relax
  }%

  % Remember the last reference number at the end of the bibliography
  % before terminating the list environment
  \renewcommand{\endthebibliography}%
  {%
    \setcounter{lastrefnum}{\value{enumi}}%
    \endlist
  }%

  % Bibunit defines an in-line citation list that is set in unsorted
  % numbered style with additional ISBN, ISSN, LCCN, ..., data.
  \newenvironment{Bibunit}%
  {%
    \begin{bibunit}[is-unsrt]%
       \let \Cite = \nocite          % no citations in running text
  }%
  {%
    \putbib[fparith]%
    \end{bibunit}%
  }%

\fi

% We get subsections up to x.xxx and xx.xx, so some extra space is needed
% for NUMWIDTH in \@dottedtocline{LEVEL}{INDENT}{NUMWIDTH}{TITLE}{PAGE}
% which this macro gets used for in the table of contents
%\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}} % original value
 \def\l@subsection{\@dottedtocline{2}{1.5em}{3.0em}}

% We modify the sectioning commands from art10.doc to set text
% \raggedright
\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus
    -.2ex}{2.3ex plus .2ex}{\Large\bf\raggedright}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus -1ex minus
   -.2ex}{1.5ex plus .2ex}{\large\bf\raggedright}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus
   -1ex minus -.2ex}{1.5ex plus .2ex}{\normalsize\bf\raggedright}}
\def\paragraph{\@startsection
     {paragraph}{4}{\z@}{3.25ex plus 1ex minus .2ex}{-1em}
     {\normalsize\bf\raggedright}}
\def\subparagraph{\@startsection
     {subparagraph}{4}{\parindent}{3.25ex plus 1ex minus
     .2ex}{-1em}{\normalsize\bf\raggedright}}

\endinput
%===============================[The End]===============================
