summaryrefslogtreecommitdiff
path: root/language/korean/kotex-utf/contrib/dhucs-paralist.sty
blob: 71a5827f1d5760fdda799441a97033649f7bb0ba (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
%% File `dhucs-paralist.sty`
%%
%% Copyright (c) 2007-2013 Dohyun Kim <nomos at krug org>
%% modification from dhucs-enumerate.sty by Kangsoo Kim <karnes 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.
%%
\ProvidesPackage{dhucs-paralist}
  [2015/09/10 partially support paralist.sty under dhucs]

\RequirePackage{paralist}

\ifx 가가\g@addto@macro\pl@hook{%
    \ifx ^^^^ac00\pl@temp \def\@tempa{\pl@label\gana}\else
    \ifx ^^^^2170\pl@temp \def\@tempa{\pl@label\hroman}\else
    \ifx ^^^^2160\pl@temp \def\@tempa{\pl@label\hRoman}\else
    \ifx ^^^^249c\pl@temp \def\@tempa{\pl@label\peng}\else
    \ifx ^^^^24d0\pl@temp \def\@tempa{\pl@label\oeng}\else
    \ifx ^^^^2474\pl@temp \def\@tempa{\pl@label\pnum}\else
    \ifx ^^^^2460\pl@temp \def\@tempa{\pl@label\onum}\else
    \ifx ^^^^320e\pl@temp \def\@tempa{\pl@label\pgana}\else
    \ifx ^^^^326e\pl@temp \def\@tempa{\pl@label\ogana}\else
    \ifx ^^^^3260\pl@temp \def\@tempa{\pl@label\ojaso}\else
    \ifx ^^^^3131\pl@temp \def\@tempa{\pl@label\jaso}\else
    \ifx ^^^^3200\pl@temp \def\@tempa{\pl@label\pjaso}%
    \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
    \expandafter\endinput
\fi

\g@addto@macro\pl@hook{%
  \ifx ^^ea\pl@temp  % 가,
    \let\@tempa\@dhucs@paralist@EA\else %%%%%
  \ifx ^^e2\pl@temp  % ①, ⑴, ⒜, ⓐ, ⅰ, Ⅰ
    \let\@tempa\@dhucs@paralist@Eii\else %%%%%
  \ifx ^^e3\pl@temp  % ㄱ, ㉠, ㉮, ㈀, ㈎
    \let\@tempa\@dhucs@paralist@Eiii
  \fi\fi\fi
}
\def\@dhucs@paralist@error#1{%
  \PackageError{dhucs-paralist}
  {You can't use `\unexpanded{#1}' as enum label}
  {Legal enum labels of hangul-ucs are: \MessageBreak\space\space
  \unexpanded{가, ㄱ, ㉠, ㉮, ㈀, ㈎, ①, ⑴, ⒜, ⓐ, ⅰ, Ⅰ}.}%
}
\def\@dhucs@paralist@EA#1#2#3{%
  \ifnum\pdfstrcmp{#1#2#3}{^^ea^^b0^^80}=\z@ \def\@tempa{\pl@label\gana}\else
    \@dhucs@paralist@error{#1#2#3}%
  \fi
  \@tempa\relax
}
\def\@dhucs@paralist@Eii#1#2#3{%
  \ifnum\pdfstrcmp{#1#2#3}{^^e2^^85^^b0}=\z@ \def\@tempa{\pl@label\hroman}\else
  \ifnum\pdfstrcmp{#1#2#3}{^^e2^^85^^a0}=\z@ \def\@tempa{\pl@label\hRoman}\else
  \ifnum\pdfstrcmp{#1#2#3}{^^e2^^92^^9c}=\z@ \def\@tempa{\pl@label\peng}\else
  \ifnum\pdfstrcmp{#1#2#3}{^^e2^^93^^90}=\z@ \def\@tempa{\pl@label\oeng}\else
  \ifnum\pdfstrcmp{#1#2#3}{^^e2^^91^^b4}=\z@ \def\@tempa{\pl@label\pnum}\else
  \ifnum\pdfstrcmp{#1#2#3}{^^e2^^91^^a0}=\z@ \def\@tempa{\pl@label\onum}\else
    \@dhucs@paralist@error{#1#2#3}%
  \fi\fi\fi\fi\fi\fi
  \@tempa\relax
}
\def\@dhucs@paralist@Eiii#1#2#3{%
  \ifnum\pdfstrcmp{#1#2#3}{^^e3^^88^^8e}=\z@ \def\@tempa{\pl@label\pgana}\else
  \ifnum\pdfstrcmp{#1#2#3}{^^e3^^89^^ae}=\z@ \def\@tempa{\pl@label\ogana}\else
  \ifnum\pdfstrcmp{#1#2#3}{^^e3^^89^^a0}=\z@ \def\@tempa{\pl@label\ojaso}\else
  \ifnum\pdfstrcmp{#1#2#3}{^^e3^^84^^b1}=\z@ \def\@tempa{\pl@label\jaso}\else
  \ifnum\pdfstrcmp{#1#2#3}{^^e3^^88^^80}=\z@ \def\@tempa{\pl@label\pjaso}\else
    \@dhucs@paralist@error{#1#2#3}%
  \fi\fi\fi\fi\fi
  \@tempa\relax
}
\endinput