% This is the file KS.chr of the CJK package
%   for using Asian logographs (Chinese/Japanese/Korean) with LaTeX2e
%
% created by Werner Lemberg <wl@gnu.org>
%
% Version 4.5.1 (17-Jun-2002)

\def\fileversion{4.5.1}
\def\filedate{2002/06/17}
\ProvidesFile{KS.chr}[\filedate\space\fileversion]


% define macros for handling hangul fonts and characters.

\gdef\CJK@KSChr{
  \CJK@global\def\CJK@altchar##1##2##3{
    {\ifnum ##3 < \CJK@min
       \CJK@err
     \else
       \ifnum ##3 > \CJK@max
         \CJK@err
       \else
         \CJK@testLastCJK
         \ifCJK@
           \discretionary{}{}{}
         \fi

         \@tempcnta ##3\relax
         \advance\@tempcnta ##2\relax
         \edef\CJK@plane{##1}
         \usefont{\CJK@altEnc}{\CJK@family}{\CJK@series}{\CJK@shape}
         \CJKsymbol{\@tempcnta}

         \CJK@CJK
       \fi
     \fi}}

% the same, but the plane crosses the font file boundary.

  \CJK@global\def\CJK@altcharx##1##2##3##4{
    {\ifnum ##4 < \CJK@min
       \CJK@err
     \else
       \ifnum ##4 > \CJK@max
         \CJK@err
       \else
         \CJK@testLastCJK
         \ifCJK@
           \discretionary{}{}{}
         \fi

         \@tempcnta ##4\relax
         \@tempcntb 256\relax
         \advance\@tempcnta ##3\relax
         \advance\@tempcntb -##3\relax
         \chardef\@temp \@tempcntb
         \ifnum ##4 < \@temp
           \edef\CJK@plane{##1}
         \else
           \advance\@tempcnta -256\relax
           \edef\CJK@plane{##2}
         \fi
         \usefont{\CJK@altEnc}{\CJK@family}{\CJK@series}{\CJK@shape}
         \CJKsymbol{\@tempcnta}

         \CJK@CJK
       \fi
     \fi}}

  \CJK@global\def\CJK@char##1##2##3{
    {\ifnum ##3 < \CJK@min
       \CJK@err
     \else
       \ifnum ##3 > \CJK@max
         \CJK@err
       \else
         \CJK@testLastCJK
         \ifCJK@
           \discretionary{}{}{}
         \fi

         \@tempcnta ##3\relax
         \advance\@tempcnta ##2\relax
         \edef\CJK@plane{##1}
         \usefont{\CJK@enc}{\CJK@family}{\CJK@series}{\CJK@shape}
         \CJKsymbol{\@tempcnta}

         \CJK@CJK
       \fi
     \fi}}

% the same, but the plane crosses the font file boundary.

  \CJK@global\def\CJK@charx##1##2##3##4{
    {\ifnum ##4 < \CJK@min
       \CJK@err
     \else
       \ifnum ##4 > \CJK@max
         \CJK@err
       \else
         \CJK@testLastCJK
         \ifCJK@
           \discretionary{}{}{}
         \fi

         \@tempcnta ##4\relax
         \@tempcntb 256\relax
         \advance\@tempcnta ##3\relax
         \advance\@tempcntb -##3\relax
         \chardef\@temp \@tempcntb
         \ifnum ##4 < \@temp
           \edef\CJK@plane{##1}
         \else
           \advance\@tempcnta -256\relax
           \edef\CJK@plane{##2}
         \fi
         \usefont{\CJK@enc}{\CJK@family}{\CJK@series}{\CJK@shape}
         \CJKsymbol{\@tempcnta}

         \CJK@CJK
       \fi
     \fi}}

% for punctuation.

  \CJK@global\def\CJK@punctchar##1##2##3##4{
    {\ifnum ##4 < \CJK@min
       \CJK@err
     \else
       \ifnum ##4 > \CJK@max
         \CJK@err
       \else
         \CJK@numbToHex{\CJK@gtemp}{##4}
         \CJK@testLastCJK
         \ifCJK@
           \CJK@testPostPunct{\CJK@punctEnc}{##1}{\CJK@gtemp}
           \ifCJK@
           \else
             \discretionary{}{}{}
           \fi
         \fi

         \@tempcnta ##4\relax
         \advance\@tempcnta ##3\relax
         \edef\CJK@plane{##2}
         \usefont{\CJK@enc}{\CJK@family}{\CJK@series}{\CJK@shape}
         \CJKsymbol{\@tempcnta}

         \CJK@testPrePunct{\CJK@punctEnc}{##1}{\CJK@gtemp}
         \ifCJK@
           \CJK@kern
         \else
           \CJK@CJK
         \fi
       \fi
     \fi}}

  \CJK@global\def\CJK@punctcharx##1##2##3##4##5{
    {\ifnum ##5 < \CJK@min
       \CJK@err
     \else
       \ifnum ##5 > \CJK@max
         \CJK@err
       \else
         \CJK@numbToHex{\CJK@gtemp}{##5}
         \CJK@testLastCJK
         \ifCJK@
           \CJK@testPostPunct{\CJK@punctEnc}{##1}{\CJK@gtemp}
           \ifCJK@
           \else
             \discretionary{}{}{}
           \fi
         \fi

         \@tempcnta ##5\relax
         \@tempcntb 256\relax
         \advance\@tempcnta ##4\relax
         \advance\@tempcntb -##4\relax
         \chardef\@temp \@tempcntb
         \ifnum ##5 < \@temp
           \edef\CJK@plane{##2}
         \else
           \advance\@tempcnta -256\relax
           \edef\CJK@plane{##3}
         \fi
         \usefont{\CJK@enc}{\CJK@family}{\CJK@series}{\CJK@shape}
         \CJKsymbol{\@tempcnta}

         \CJK@testPrePunct{\CJK@punctEnc}{##1}{\CJK@gtemp}
         \ifCJK@
           \CJK@kern
         \else
           \CJK@CJK
         \fi
       \fi
     \fi}}}

\endinput