%
\catcode`@=11
\let\@dump\dump
\let\dump\relax
\input latex.ltx
\input jtexbase.tex

%% addtion/modification of latex
%%
\makeatletter

% ltfss
%
\DeclareRobustCommand\jfontencoding[1]{%
    \expandafter\ifx\csname T@#1\endcsname\relax
      \@latex@error{Encoding scheme `#1' unknown}\@eha
    \else
      \edef\jf@encoding{#1}%
    \fi
}
\DeclareRobustCommand\jfontfamily[1]{\edef\jf@family{#1}}
\DeclareRobustCommand\jfontseries[1]{\edef\jf@series{#1}}
\DeclareRobustCommand\jfontshape [1]{\edef\jf@shape{#1}}
\let\jf@encoding\@empty
\let\jf@family\@empty
\let\jf@series\@empty
\let\jf@shape\@empty

\def\pickup@jfont{%
    \expandafter \ifx \jfont@name \relax
       \define@newjfont
    \fi}
\def\define@newjfont{%
  \begingroup
    \escapechar\m@ne
    \expandafter\expandafter\expandafter
       \split@name\expandafter\string\jfont@name\@nil
      \try@load@fontshape % try always
    \expandafter\ifx
       \csname\curr@fontshape\endcsname \relax
      \wrong@jfontshape\else
      \extract@jfont\fi
  \endgroup}
\def\DeclareErrorJFont#1#2#3#4#5{%
      \xdef\error@fontshape{%
          \noexpand\expandafter\noexpand\split@name\noexpand\string
          \expandafter\noexpand\csname#1/#2/#3/#4/#5\endcsname
          \noexpand\@nil}%
      \gdef\jdefault@family{#2}%
      \gdef\jdefault@series{#3}%
      \gdef\jdefault@shape{#4}%
      \global\let\jf@family\jdefault@family
      \global\let\jf@series\jdefault@series
      \global\let\jf@shape\jdefault@shape
}
\def\wrong@jfontshape{%
    \csname D@\f@encoding\endcsname      % install defaults if in math
    \edef\@tempa{\csname\curr@fontshape\endcsname}%
  \ifx\last@jfontshape\@tempa
     \errmessage{Corrupted NFSS tables}%
     \error@jfontshape
  \else
    \let\f@shape\jdefault@shape
    \expandafter\ifx\csname\curr@fontshape\endcsname\relax
       \let\f@series\jdefault@series
        \expandafter
          \ifx\csname\curr@fontshape\endcsname\relax
           \let\f@family\jdefault@family
        \fi \fi
  \fi
    \@font@warning{Font shape `\@tempa' undefined\MessageBreak
                  using `\curr@fontshape' instead}%
    \global\let\last@jfontshape\@tempa
    \G@defaultsubstrue
    \global\expandafter\expandafter\expandafter\let\expandafter\@tempa
           \csname\curr@fontshape\endcsname
    \xdef\jfont@name{\expandafter\noexpand
      \csname\curr@fontshape/\f@size\endcsname}%
    \pickup@jfont}

\def\extract@jfont{%
   \get@external@jfont
   \expandafter\expandafter\expandafter
   \gjfont\expandafter\jfont@name\external@font\relax
    \jfont@name \relax
    \csname \f@encoding+\f@family\endcsname
    \csname\curr@fontshape\endcsname
    \relax
       }
\def\get@external@jfont{%
   \let\external@font\@empty
   \edef\font@info{\expandafter\expandafter\expandafter\string
        \csname \curr@fontshape \endcsname}%
   \try@size@range
   \ifx\external@font\@empty
      \try@size@substitution
      \ifx\external@font\@empty
         \@latex@error{Font \expandafter \string\jfont@name\space
                     not found}\@eha
         \error@fontshape
         \get@external@jfont
   \fi\fi
}
% re-define \selectfont
\DeclareRobustCommand\selectfont
        {%
    \ifx\f@linespread\baselinestretch \else
      \set@fontsize\baselinestretch\f@size\f@baselineskip \fi
    \selectafont \selectjfont
    \size@update
    \enc@update
    }
\def\selectafont{%
    \xdef\font@name{%
      \csname\curr@fontshape/\f@size\endcsname}%
    \pickup@font
    \font@name}
\def\selectjfont{%
    \xdef\jfont@name{\expandafter\noexpand
      \csname\jf@encoding/\jf@family/\jf@series/\jf@shape/\f@size\endcsname}%
    \pickup@jfont
    \jfont@name}

\DeclareRobustCommand\rmfamily
        {\not@math@alphabet\rmfamily\mathrm
         \fontfamily\rmdefault\jfontfamily\jrmdefault\selectfont}
\DeclareRobustCommand\sffamily
        {\not@math@alphabet\sffamily\mathsf
         \fontfamily\sfdefault\jfontfamily\jsfdefault\selectfont}
\DeclareRobustCommand\ttfamily
        {\not@math@alphabet\ttfamily\mathtt
         \fontfamily\ttdefault\jfontfamily\jttdefault\selectfont}
\DeclareRobustCommand\bfseries
        {\not@math@alphabet\bfseries\mathbf
         \fontseries\bfdefault\jfontseries\jbfdefault\selectfont}
\DeclareRobustCommand\mdseries
        {\not@math@alphabet\mdseries\relax
         \fontseries\mddefault\jfontseries\jmddefault\selectfont}
\DeclareRobustCommand\upshape
        {\not@math@alphabet\upshape\relax
         \fontshape\updefault\jfontshape\jupdefault\selectfont}
\DeclareRobustCommand\slshape
        {\not@math@alphabet\slshape\relax
         \fontshape\sldefault\jfontshape\jsldefault\selectfont}
\DeclareRobustCommand\scshape
        {\not@math@alphabet\scshape\relax
         \fontshape\scdefault\jfontshape\jscdefault\selectfont}
\DeclareRobustCommand\itshape
        {\not@math@alphabet\itshape\mathit
         \fontshape\itdefault\jfontshape\jitdefault\selectfont}

\DeclareRobustCommand\normalfont
    {\fontencoding{\encodingdefault}\fontfamily{\familydefault}%
     \fontseries{\seriesdefault}\fontshape{\shapedefault}%
     \jfontencoding{\jencodingdefault}\jfontfamily{\jfamilydefault}%
     \jfontseries{\jseriesdefault}\jfontshape{\jshapedefault}%
     \selectfont}

\DeclareErrorJFont{JP}{dn}{m}{n}{10}  %%% don't modify this setting
                                      %%% overwrite it in jfontdef.cfg
                                      %%% if necessary
\IfFileExists{jfontdef.cfg}
           {\typeout{*************************************^^J%
                     *^^J%
                     * Local config file jfontdef.cfg used^^J%
                     *^^J%
                     *************************************}%
            \@@input jfontdef.cfg }
           {\@@input jfontdef.ltx }

\newcommand{\dm}{\protect\pdm}
\newcommand{\pdm}{\jfontseries\jmddefault\selectfont}
\newcommand{\dg}{\protect\pdg}
\newcommand{\pdg}{\jfontseries\jbfdefault\selectfont}
\let\@min\min
\renewcommand{\min}{\protect\pmin}
\newcommand{\pmin}{\ifmmode\@min\else\pdm\fi}
\let\goth\dg

% ltclass
%
\def\documentstyle{%
  \makeatletter\input{jlatex209.def}\makeatother
  \documentclass}
%\def\NeedsJTeXFormat#1{%

%%
%% end of addtion/modification of latex

%
%
\input sitekcode

\def\jfmtname{JLaTeX2e}%
\def\jfmtversion{1995/05/23}%

\let\dump\@dump
\makeatother
\dump
\endinput
