summaryrefslogtreecommitdiff
path: root/language/korean/cjk-ko/kotex.sty
blob: d2d4a0f90360f0dafaabbabca84c61676147f127 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
% kotex.sty
%
% (C) Copyright 2007-2015 Koaunghi Un <koaunghi at kornet net>
%                         Kangsoo Kim <karnes at gmail com>
%                         Dohyun Kim  <nomos at ktug org>
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or (at your option) any later version.
% The latest version of this license is in
%  http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2006/05/20 or later.
%
% -------------------------------------------------
%
% main style of ko.TeX
%
% Usage : \usepackage{kotex}          \usepackage[hangul]{kotex}
%         \usepackage[euc]{kotex}     \usepackage[euc,hangul]{kotex}
%         \usepackage[cjk]{kotex}     \usepackage[cjk,hangul]{kotex}

\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname ProvidesPackage\endcsname\relax\else
  \ProvidesPackage{kotex}[2015/04/19 v1.6 Korean TeX (ko.TeX)]
\fi

\ifx\directlua\relax \let\directlua\undefined \fi
\ifx\XeTeXrevision\relax \let\XeTeXrevision\undefined \fi

\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname selectfont\endcsname\relax
  \ifx\directlua\undefined
    \ifx\XeTeXrevision\undefined
      \input kotexutf
    \else
      \input xetexko.sty
    \fi
  \else
    \input luatexko.sty
  \fi
\endinput\fi


\newif\if@ko@euc
\let\@ko@cjk\undefined

\IfFileExists{kotexutf.sty}{}{\let\@ko@cjk\empty}

\DeclareOption{utf}{}
\DeclareOption{euc}{\@ko@euctrue}
\DeclareOption{cjk}{\let\@ko@cjk\empty}
\DeclareOption*{
  \ifx\directlua\undefined
    \ifx\XeTeXrevision\undefined
      \if@ko@euc
        \PassOptionsToPackage{\CurrentOption}{kotex-euc}
      \else
        \ifx\@ko@cjk\undefined
          \PassOptionsToPackage{\CurrentOption}{kotexutf}
        \else
          \PassOptionsToPackage{\CurrentOption}{cjkutf8-ko}
        \fi
      \fi
    \else
      \PassOptionsToPackage{\CurrentOption}{xetexko}
    \fi
  \else
    \PassOptionsToPackage{\CurrentOption}{luatexko}
  \fi
}
\InputIfFileExists{kotex.cfg}{}{}
\ProcessOptions\relax

%%% compatibility
\if@ko@euc \else
 \let\gtfamily\sffamily
 \DeclareTextFontCommand{\textgt}{\gtfamily}
\fi

%%% load one of ko.TeX packages
\ifx\directlua\undefined
  \ifx\XeTeXrevision\undefined
    \if@ko@euc
      \RequirePackage{kotex-euc}
    \else
      \ifx\@ko@cjk\undefined
        \RequirePackage{kotexutf}
      \else
        \RequirePackage{cjkutf8-ko}
      \fi
    \fi
  \else
    \RequirePackage{xetexko}
  \fi
\else
  \RequirePackage{luatexko}
  \if@ko@euc
    \luatexuhcinputencoding=1
  \fi
\fi

\endinput