% \iffalse meta-comment
%
% Copyright 1994 the LaTeX3 project and the individual authors.
% All rights reserved. For further copyright information see the file
% legal.txt, and any other copyright indicated in this file.
% 
% This file is part of the LaTeX2e system.
% ----------------------------------------
% 
%  This system is distributed in the hope that it will be useful,
%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% 
% 
% IMPORTANT NOTICE:
% 
% For error reports in case of UNCHANGED versions see bugs.txt.
% 
% Please do not request updates from us directly.  Distribution is
% done through Mail-Servers and TeX organizations.
% 
% You are not allowed to change this file.
% 
% You are allowed to distribute this file under the condition that
% it is distributed together with all files mentioned in manifest.txt.
% 
% If you receive only some of these files from someone, complain!
% 
% You are NOT ALLOWED to distribute this file alone.  You are NOT
% ALLOWED to take money for the distribution or use of either this
% file or a changed version, except for a nominal charge for copying
% etc.
% \fi
%%%%
%%%% Patch file for the LaTeX2e kernel dated 1994/06/01
%%%% Patch 3 (1994/07/27)

\def\fmtversion@topatch{1994/06/01} % This patch will not work with
                                    % any other release.

\def\patch@level{3} % Patch level 3 (for June 1994 release)



%%% \fbox bug (from ltboxes.dtx)
%%%  Make \long and add \leavevmode
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\long\def\fbox#1{%
  \setbox\@tempboxa\hbox{%
    \color@begingroup
      \kern\fboxsep#1\kern\fboxsep
    \color@endgroup}%
  \@frameb@x\relax}

\long\def\@iframebox[#1][#2]#3{%
  \@begin@tempboxa\hbox{#3}%
    \setlength\@tempdima{#1}%
    \setbox\@tempboxa\hbox to\@tempdima
         {\kern\fboxsep\csname bm@#2\endcsname\kern\fboxsep}%
    \@frameb@x{\kern-\fboxrule}%
  \@end@tempboxa}

\def\@frameb@x#1{%
  \@tempdima\fboxrule
  \advance\@tempdima\fboxsep
  \advance\@tempdima\dp\@tempboxa
  \leavevmode
  \hbox{%
    \lower\@tempdima\hbox{%
      \vbox{%
        \hrule\@height\fboxrule
        \hbox{%
          \vrule\@width\fboxrule
          #1%
          \vbox{%
            \vskip\fboxsep
            \box\@tempboxa
            \vskip\fboxsep}%
          #1%
          \vrule\@width\fboxrule}%
        \hrule\@height\fboxrule}}}}

%%% New feature (from ltboxes.dtx).
%%% Make \sbox and \mbox long.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\long\def\mbox#1{\leavevmode\hbox{#1}}

\long\def\sbox#1#2{\setbox#1\hbox{%
  \color@setgroup#2\color@endgroup}}


%%% New feature (from ltdirchk.dtx and lterror.dtx)
%%% Automatic determination of TeX versions between 3 and 3.14
%%% Suggested by Bernd Raichle.
%%% The definition of \GenericError is not changed, but must be
%%% repeated here after the test.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifx\@TeXversion\@undefined
{\catcode`\^^J=\active
   \def\@tempa#1#2\@@{\if#1\string^3\fi}
   \edef\@tempa{\expandafter\@tempa\string^^J\@@}
   \ifx\@tempa\@empty\else\gdef\@TeXversion{3}\fi
}
\fi

\bgroup
\lccode`\@=`\ %
\lccode`\~=`\ %
\lccode`\}=`\ %
\lccode`\{=`\ %
\lccode`\T=`\T%
\lccode`\H=`\H%
\catcode`\ =11\relax%
\lowercase{%
\egroup%

\dimen@\ifx\@TeXversion\@undefined4\else\@TeXversion\fi\p@%
\ifdim\dimen@>3.14\p@\else
\DeclareRobustCommand{\GenericError}[4]{%
\begingroup%
\immediate\write\@unused{}%
\def\MessageBreak{^^J}%
\let\protect\string%
\edef%
%    %<-------------------do not delete this space!------------------->%
\@err@                                                                 %
{{#4}}%
\errhelp
%    %<-------------------do not delete this space!------------------->%
\@err@                                                                 %
\let
%    %<-------------------do not delete this space!------------------->%
\@err@                                                                 %
\errmessage
\def\MessageBreak{^^J#1}%
\def~{\typeout{! %
#2.^^J^^J%
#3^^J%
Type  H <return>  for immediate help.}%
%    %<-------------------do not delete this space!------------------->%
\@err@                                                                 %
{}}%
~%
\endgroup}
\fi}

%%% Allow 8bit chars again (for TeX3 only)
%%%   Please note that this means that such documents are not 
%%%   portable (unless ^^ notation is used). One can get incorrect
%%%   results without error messages.
%%%   This is a feature of TeX the program, not of LaTeX!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ifnum\inputlineno=\m@ne\else
\@tempcnta=128
\loop\ifnum\@tempcnta<256
   \catcode\@tempcnta=12
   \advance\@tempcnta 1
\repeat
\@tempcnta=\z@
\fi


%%% PR 557: \nocite{*} should not produce a warning
%%%   as a result \cite{*} will not warn either but that never 
%%%   worked with BibTeX in the first place.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\expandafter\let\csname b@*\endcsname\@empty



%%% \DeclareTextSymbol produced inefficient default
%%%   definitions.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\DeclareTextSymbol#1#2#3{%
   \expandafter\DeclareRobustCommand\expandafter#1%
      \expandafter{%
         \csname#2-cmd\expandafter\endcsname
         \csname#2\string#1\endcsname
      }%
   \expandafter\chardef\csname#2\string#1\endcsname#3\relax
}



%%% Combinations like \"\i didn't work in sectioning commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\DeclareTextAccent#1#2#3{%
   \DeclareTextCommand#1{#2}[1]{{\accent#3 ##1}}%
            \def\@tempa##1{\def#1####1{##1{####1}}}%
               \expandafter\@tempa\expandafter{#1}%
}
\input{T1enc.def}
\input{OT1enc.def}



%%% \{ \} bug (from ltoutenc.dtx)
%%% Redefine, so that \left\{ works again.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareRobustCommand{\{}{\ifmmode\lbrace\else\text@lbrace\fi}

\DeclareTextCommand{\text@lbrace}{OT1}{$\m@th\lbrace$}
\DeclareTextSymbol{\text@lbrace}{T1}{`\{}

\DeclareRobustCommand{\}}{\ifmmode\rbrace\else\text@rbrace\fi}

\DeclareTextCommand{\text@rbrace}{OT1}{$\m@th\rbrace$}
\DeclareTextSymbol{\text@rbrace}{T1}{`\}}


%%% \_ did not work in math (when T1 encoding was used)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\@underscore}
   {\leavevmode \kern.06em \vbox{\hrule \@width.3em}}
\DeclareTextCommand{\_}{OT1}{\@underscore}
\DeclareTextCommand{\_}{T1}
   {\ifmmode\@underscore\else\char95\relax\fi}

% simple solution:
% \DeclareTextCommand{\_}{T1}{\nfss@text{\char95}}


%%% \"{} produced error
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\@text@composite#1#2{%
   \csname\string#1-\string#2\@empty\endcsname\@firstofone
}


%%% The following were incorrectly defined by OT1 textencoding
%%%   and thus not available in T1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareRobustCommand\dag{\mathhexbox279}
\DeclareRobustCommand\ddag{\mathhexbox27A}
\DeclareRobustCommand\P{\mathhexbox27B}


%%% For \S we might need a different solution but for the
%%%   moment we always use the symbols coming from the math fonts.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareRobustCommand{\S}{\mathhexbox278}

%%% The \t accent could come out in wrong sizes or did
%%%   even produce an error
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareRobustCommand\t[1]
  {{$\m@th$\edef\@tempa{\the\font}%
  \the\textfont1 \accent127
  \@tempa #1}}


%%% Since we claim that there are no \p... macros
%%% we better
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareRobustCommand\ldots
   {\ifmmode\@ldots\else\mbox{$\m@th\@ldots\,$}\fi}
\let \pt \@undefined
\let \pldots \@undefined


%%% \text..{} would produce an error
%%% \text..{..\par..} would produce a funny error message
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def \DeclareTextFontCommand #1#2{%
  \DeclareRobustCommand#1[1]{%
    \ifmmode
      \nfss@text{#2##1}%
    \else
      \leavevmode
      {\text@command{##1}%
       #2\check@icl ##1\check@icr
       \expandafter}%
    \fi
                       }%
}

\def \text@command #1{%
  \def \@tempa {#1}%
  \ifx \@tempa \@empty
    \let \check@icl \@empty
    \let \check@icr \@empty
  \else
    \def \@tempb { }%
    \ifx \@tempa \@tempb
      \let \check@icl \@empty
      \let \check@icr \@empty
    \else
      \check@nocorr@ #1\nocorr\@nil
    \fi
  \fi
}
\let\check@nocorr\@undefined
\let \check@icl \@empty
\let \check@icr \@empty

\DeclareTextFontCommand{\textrm}{\rmfamily}
\DeclareTextFontCommand{\textsf}{\sffamily}
\DeclareTextFontCommand{\texttt}{\ttfamily}
\DeclareTextFontCommand{\textnormal}{\normalfont}
\DeclareTextFontCommand{\textbf}{\bfseries}
\DeclareTextFontCommand{\textmd}{\mdseries}
\DeclareTextFontCommand{\textit}{\itshape}
\DeclareTextFontCommand{\textsl}{\slshape}
\DeclareTextFontCommand{\textsc}{\scshape}
\DeclareTextFontCommand{\textup}{\upshape}
\DeclareTextFontCommand{\emph}{\em}


%%% \mathit and friends did not warn if used in text mode in 
%%% some cases
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\extract@alph@from@version#1#2#3{%
     \def\@tempa##1\install@mathalphabet#3##2##3\@nil{%
         \def\@tempb{##2}%
         \def\@tempc####1{\gdef#1{##1####1##3}}}%
     \expandafter\@tempa#1\@nil
     \def\@tempa\select@group#3##1##2\@nil{%
        \@tempc{%
           \getanddefine@fonts{#2}##2%
           \install@mathalphabet#3{%
              \relax\ifmmode \else \non@alpherr#3\fi
              \use@mathgroup##1{#2}}}%
        \gdef#3{\relax\ifmmode \else \non@alpherr#3\fi
                \use@mathgroup##1{#2}}}%
     \expandafter\@tempa\@tempb\@nil
     }

%%% pr/642 \loop could do one iteration too much in certain
%%%        situations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\loop#1\repeat{\def\iterate{#1\relax\expandafter\iterate\fi}%
  \iterate \let\iterate\relax} %  ^^^^^^


%%% pr/627 T1 breaks german 2.4a
%%%        until german.sty and friend are updated we force
%%%        reinitialisations of the \" accent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\AtBeginDocument{%
  \DeclareTextAccent{\"}{T1}{4}%
  \@ifpackageloaded{german}{%
     \DeclareTextCommand{\"}{OT1}{\newumlaut}%
    }{%
     \DeclareTextAccent{\"}{OT1}{127}%
    }%
  \DeclareTextComposite{\"}{T1}{a}{228}%
}


%%% pr/574 Allow \^{\i} and the like in toc entries
%%%        this is not the final fix
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\@text@composite#1#2{%
   \@text@composite@#1#2\@empty\@text@composite@
   \@firstofone
}

\def\@text@composite@#1#2#3\@text@composite@{%
  \csname\string#1-\string#2\endcsname}


%%% pr/610  Make color.sty work with figure* etc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\end@dblfloat{%
  \if@twocolumn
    \par\vskip\z@skip
    \color@endgroup
    \outer@nobreak
    \egroup %% \par\vskip\z@ added 15 Dec 87\egroup
    \ifnum\@floatpenalty <\z@
      \@largefloatcheck
      \@cons\@dbldeferlist\@currbox
    \fi
    \ifnum \@floatpenalty =-\@Mii
      \@Esphack
    \fi
  \else
    \end@float
  \fi}

%%% pr/560 Undo a change to tabular so that empty
%%%        p columns to not come out in small width
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\@finalstrut#1{%
%  \ifhmode
    \unskip\vrule\@width\z@\@height\z@\@depth\dp#1%
%  \fi
}


%%% pr/667 centred minipage/parbox with a `height' argument
%%%        did not work until after math had been set up.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\let\@parboxto\@empty
\long\def\@iiiparbox#1#2[#3]#4#5{%
  \leavevmode 
  \@pboxswfalse
  \setlength\@tempdima{#4}%
  \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\endgraf}%
    \ifx\@empty#2\else
      \setlength\@tempdimb{#2}%
      \def\@parboxto{to\@tempdimb}%
    \fi
    \if#1b\vbox
    \else\if #1t\vtop
    \else\ifmmode\vcenter
    \else\@pboxswtrue $\vcenter
    \fi\fi\fi
    \@parboxto{\let\hss\vss\let\unhbox\unvbox
       \csname bm@#3\endcsname}%
    \if@pboxsw \m@th$\fi
  \@end@tempboxa}


%%% Remove surplus braces from \ensuremath as it is
%%%        supposed to do "nothing" if already in math mode.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\DeclareRobustCommand\ensuremath[1]{\ifmmode#1\else$#1$\fi}


%%% pr/578 A temporary patch for providing \LaTeXe in compat mode.
%%%        If it still has the definition from latex209.def, it 
%%%        gets the original kernel definition restored.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\let \@@LaTeXe \LaTeXe
 
\AtBeginDocument{%
  \if@compatibility
    \edef \@tempa{%
      \noexpand\@latex@e@error{\noexpand\LaTeXe}%
      \expandafter\noexpand\csname @@\string\LaTeXe\endcsname
                  }%
    \ifx \LaTeXe \@tempa
      \let \LaTeXe \@@LaTeXe
    \fi
  \fi
}


\endinput



