summaryrefslogtreecommitdiff
path: root/language/korean/cjk-ko
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /language/korean/cjk-ko
Initial commit
Diffstat (limited to 'language/korean/cjk-ko')
-rw-r--r--language/korean/cjk-ko/ChangeLog77
-rw-r--r--language/korean/cjk-ko/README171
-rw-r--r--language/korean/cjk-ko/cjk-ko-doc.pdfbin0 -> 166434 bytes
-rw-r--r--language/korean/cjk-ko/cjk-ko-doc.tex183
-rw-r--r--language/korean/cjk-ko/cjkutf8-josa.sty131
-rw-r--r--language/korean/cjk-ko/cjkutf8-ko.sty466
-rw-r--r--language/korean/cjk-ko/cjkutf8-nanummjhanja.sty62
-rw-r--r--language/korean/cjk-ko/kolabels-utf.sty96
-rw-r--r--language/korean/cjk-ko/konames-utf.sty140
-rw-r--r--language/korean/cjk-ko/kotex.sty103
10 files changed, 1429 insertions, 0 deletions
diff --git a/language/korean/cjk-ko/ChangeLog b/language/korean/cjk-ko/ChangeLog
new file mode 100644
index 0000000000..995f110bab
--- /dev/null
+++ b/language/korean/cjk-ko/ChangeLog
@@ -0,0 +1,77 @@
+2016-04-04 Dohyun Kim <nomos at ktug org>
+
+ Version 1.8
+
+ * cjkutf8-ko.sty: package option [truetype] activates `\CJK@addcmap'
+ * cjkutf8-ko.sty: pass unknown options to CJKutf8.sty
+ * cjkutf8-ko.sty: ignore variation selectors for Korean hanja
+
+2015-07-18 Dohyun Kim <nomos at ktug org>
+
+ Version 1.7
+
+ * cjkutf8-ko.sty: use `mj' when nanumtype1 is missing
+ * cjkutf8-ko.sty: no error even when glyphtounicode is missing
+ * cjkutf8-ko.sty: hyperref bookmarks were broken
+ * konames-utf.sty: add \newif\if@hanja if undefined
+
+2015-04-19 Dohyun Kim <nomos at ktug org>
+
+ Version 1.6
+
+ * kotex.sty: [euc] option triggers relevant luatexko commands
+ * cjkutf8-ko.sty: make utf-8 characters robust.
+
+2015-03-20 Dohyun Kim <nomos at ktug org>
+
+ Version 1.5
+
+ * cjkutf8-ko.sty: fix a bug wrt inter-word glue between hangul.
+
+2014-07-27 Dohyun Kim <nomos at ktug org>
+
+ Version 1.4
+
+ * kotex.sty: adaptation to recent update of unicode-letters.tex
+
+2013-12-06 Dohyun Kim <nomos at ktug org>
+
+ Version 1.3
+
+ * cjkutf8-ko.sty:
+ - new package options for cjk font setting, mj=<font> and
+ gt=<font>
+ - allow italic correction after CJK char
+ - move char definition of U+00B7 to AtBeginDocument
+
+ * cjkutf8-josa.sty:
+ - fix a bug regarding in-line \jong \jung \rieul
+
+2013-07-03 Dohyun Kim <nomos at ktug org>
+
+ Version 1.2
+
+ * cjkutf8-ko.sty:
+ - there was a clash with \makeindex of memoir class as reported
+ by Juho Lee
+ - move caption setting to AtBeginDocument
+ - codes for non-eTeX engines are removed
+
+ * cjk-ko-doc.tex: explicitly state that [usedotemph] option
+ declares \normalem (see the manual of ulem package).
+
+2013-03-23 Dohyun Kim <nomos at ktug org>
+
+ Version 1.1
+
+ * kotex.sty: package option [cjk] is not needed any more, if
+ kotexutf.sty does not exist.
+
+ * cjk-ko-doc.pdf: produced by dvipdfmx instead of pdflatex.
+
+ * Author's email address has changed.
+
+2013-02-27 Dohyun Kim <nomos at ktug org>
+
+ Initial release. Version 1.0
+
diff --git a/language/korean/cjk-ko/README b/language/korean/cjk-ko/README
new file mode 100644
index 0000000000..f55358523d
--- /dev/null
+++ b/language/korean/cjk-ko/README
@@ -0,0 +1,171 @@
+CJK-ko package version 1.8 (2016/04/04)
+=======================================
+
+This package supports typesetting of modern Korean documents with the help
+of LaTeX2e CJK package written by Werner Lemberg. Unlike CJK package,
+only UTF-8 input encoding is supported. This package however provides
+some enhanced features focused on Korean typesetting culture, one of them
+being allowing line-break between Latin and CJK characters.
+
+Currently this package requires nanumtype1 package.
+
+
+Author
+------
+
+Please report any errors or suggestions to
+ Dohyun Kim <nomos at ktug org>
+or leave messages in the issue tracker at:
+ <http://github.com/dohyunkim/cjk-ko>.
+
+
+License
+-------
+
+### GPL (Gnu General Public License):
+
+ cjkutf8-ko.sty
+ cjkutf8-josa.sty
+ cjkutf8-nanummjhanja.sty
+These files are derivatives of CJK package or written by the author.
+
+### LPPL (LaTeX Project Public License):
+
+ kotex.sty
+ konames-utf.sty
+ kolabels-utf.sty
+These files are copied or modified from ko.TeX package.
+
+### Public domain:
+
+ cjk-ko-doc.tex
+ README
+ ChangeLog
+
+See each file for more details.
+
+
+Files
+-----
+
+### TeXinputs
+
+ cjkutf8-ko.sty -> tex/latex/cjk-ko/
+ cjkutf8-josa.sty -> tex/latex/cjk-ko/
+ cjkutf8-nanummjhanja.sty -> tex/latex/cjk-ko/
+ kotex.sty -> tex/latex/cjk-ko/
+ kolabels-utf.sty -> tex/latex/cjk-ko/
+ konames-utf.sty -> tex/latex/cjk-ko/
+
+### Documents
+
+ cjk-ko-doc.tex -> doc/latex/cjk-ko/
+ cjk-ko-doc.pdf -> doc/latex/cjk-ko/
+ README -> doc/latex/cjk-ko/
+ ChangeLog -> doc/latex/cjk-ko/
+
+
+Loading of the package
+----------------------
+
+ \usepackage{cjkutf8-ko}
+or
+
+ \usepackage[cjk]{kotex}
+
+
+### package options
+
+ [cjk]
+Option for kotex.sty. If this option is not given and if kotexutf.sty
+does exist, kotexutf package will be loaded instead.
+
+ [hangul]
+Load Hangul captions. line/word spacing is adjusted as well.
+
+ [hanja]
+Load Hanja captions. same as [hangul] option for line/word spacing.
+
+ [nojosa]
+Disable automatic Josa selection
+
+ [usedotemph]
+Enable \dotemph command. CJKfntef.sty and CJKulem.sty will be loaded
+automatically.
+
+ [usecjkt1font]
+CJK fonts will be used for Latin characters as well. Only Nanum T1 font is
+currently available.
+
+ [mj=<font>], [gt=<font>]
+Declare Myeongjo (serif) and Gothic (sans-serif) font families respectively.
+`c70<font>.fd` should be existant.
+
+ [truetype]
+When TrueType fonts are declared by mj or gt option, it is recommended to
+declare this option as well, which enables text extraction from resulting PDF.
+
+Other unknown options will be passed to CJKutf8.sty.
+
+
+User commands
+-------------
+
+ \CJKscale
+- scale font size of CJK character
+- eg: \CJKscale{0.95}
+- cannot be used with [usecjkt1font] option
+- allowed only in the preamble
+- under [hangul] option, line/word spacing and indent size are
+ adjusted automatically
+
+ \lowerCJKchar
+- lower CJK characters
+- eg: \lowerCJKchar{0.1em}
+- cannot be used with [usecjkt1font] option
+- allowed only in the preamble
+
+ \dotemph
+- emphasize Hangul or Hanja by putting dot above
+- eg: \dotemph{드러냄표}
+- available only when [usedotemph] option is given
+- users can redefine these commands:
+
+ \def\dotemphchar{\Unicode{"02}{"D9}}
+ \def\dotemphraise{0.2em}
+
+For other commands see CJK package documents.
+
+
+Automatic Josa selection
+------------------------
+
+Josa commands:
+
+ \은 \는 \이 \가 \을 \를 \와 \과 \로 \으로 \라 \이라
+
+example:
+
+ \label{fig:aaa} ... \ref{fig:aaa}\을
+ \label{fig:aaa} ... \pageref{fig:aaa}\을
+ \cite{hong}\을 ... \bibitem[홍길동\jong]{hong}
+
+Automatic Josa selection works correctly only after
+\ref \pageref \cite commands and after ascii characters.
+For other cases these commands are available:
+
+ \jung: keyword is terminated by Jungseong
+ \jong: keyword is terminated by Jongseong
+ \rieul: keyword is terminated by Jongseong Rieul
+
+
+Korean counters
+---------------
+
+Same as ko.TeX package:
+
+ \jaso \gana \ojaso \ogana \pjaso \pgana \onum \pnum \oeng \peng
+ \hnum \Hnum \hroman \hRoman \hNum \hanjanum
+
+
+*END of README*
diff --git a/language/korean/cjk-ko/cjk-ko-doc.pdf b/language/korean/cjk-ko/cjk-ko-doc.pdf
new file mode 100644
index 0000000000..d4c97178ae
--- /dev/null
+++ b/language/korean/cjk-ko/cjk-ko-doc.pdf
Binary files differ
diff --git a/language/korean/cjk-ko/cjk-ko-doc.tex b/language/korean/cjk-ko/cjk-ko-doc.tex
new file mode 100644
index 0000000000..23ee6cbbda
--- /dev/null
+++ b/language/korean/cjk-ko/cjk-ko-doc.tex
@@ -0,0 +1,183 @@
+%% cjk-ko-doc.tex
+%%
+%% This file is in public domain
+
+\ifcase\pdfoutput
+\documentclass[dvipdfmx,b5paper]{article}
+\else
+\documentclass[b5paper]{article}
+\fi
+\usepackage{geometry}
+\usepackage[cjk,hangul,usedotemph]{kotex}
+\usepackage{xcolor,hologo}
+\usepackage[pdfencoding=auto,
+ pdftitle={cjk-ko 간단 매뉴얼},
+ pdfauthor={Dohyun Kim},
+ pdfkeywords={CJK, LaTeX, Korean, ko.TeX}
+]{hyperref}
+
+\def\cs#1{\texttt{\color{teal}\char92 \chardef\{=123 \chardef\}=125 #1}}
+\def\koTeX{\textsf{k}\kern-.1em\textit{o}.\kern-.1667em\TeX}
+\def\cjkko{\mbox{CJK-\textsf{k}\kern-.1em\textit{o}}}
+
+\linespread{1.3}
+
+\title{\cjkko\ 간단 매뉴얼}
+\author{Dohyun Kim \normalsize $<$\texttt{nomos at ktug org}$>$ \and
+ \normalsize $<$\url{http://github.com/dohyunkim/cjk-ko}$>$}
+\date{Version 1.8\quad \today}
+\begin{document}
+\maketitle
+
+\begin{abstract}
+ For introduction in English, please see \verb|README| file in this package.
+
+ 본래 \TeX\ Writer라는 iOS 앱을 위해 만들었던 한글 패키지를 \TeX\ Live용으로
+ 수정했다. 특히 \TeX\ Live 버전에서는 나눔글꼴을 트루타입 대신 Type1
+ 글꼴---물론 subfont들이다---로 변환해 넣음으로써 다양한 DVI 툴을 이용할 수
+ 있게 했다.
+
+ 1.3 버전부터는 나눔글꼴이 아닌 다른 한글 폰트를 패키지 옵션으로 지정해서 쓸
+ 수 있다.
+\end{abstract}
+
+\tableofcontents
+
+\section{소개}
+ \begin{itemize}
+ \item CJK 패키지의 \texttt{UTF8} 환경 이용
+ \item 복잡한 환경 지시 없이 \texttt{kotex}만 부르면 바로 한글 가능
+ \begin{itemize}
+ \item[] \hskip2cm \fbox{\vtop{\hsize=.5\textwidth\baselineskip=1.1em
+ \cs{begin\{document\}}\par
+ \cs{begin\{CJK\}\{UTF8\}\{mj\}}\par
+ \leavevmode\llap{불필요 $\rightarrow$\quad}\quad $\cdots$\par
+ \cs{end\{CJK\}}\par
+ \cs{end\{document\}}}}
+ \end{itemize}
+ \item 한글 문서에 최적화된 줄바꿈 기능~--- 예: 괄호 앞뒤, 수식 뒤
+ \item 영문자와 한글의 조화 추구~--- 예: 한글 글자 크기 조정 허용
+ \item 기초적인 자동조사 기능
+ \item 오로지 \dotemph{현대 한국어} 문서를 위한 패키지~---
+ 중세한글, 일본어, 중국어는 지원하지 않는다.
+ \end{itemize}
+
+\section{Package options}
+ \begin{description}
+ \item[불러오기]: \quad\cs{usepackage[cjk]\{kotex\}}
+ \medskip
+ \item[패키지 옵션] 열거되지 않은 옵션은 CJKutf8 패키지에 그대로 전달된다.
+ \begin{itemize}
+ \item[\texttt{cjk}] \TeX\ Live에선 이 옵션이 없으면 kotexutf\,가
+ 로드된다. 단, \verb|kotexutf.sty| 파일을 찾을 수 없다면
+ 이 옵션이 없더라도 \cjkko\ 패키지를 부른다.
+ \item[\texttt{hangul}] 한글 캡션, 줄 간격, 단어 간격, frenchspacing
+ 등의 조정이 이루어진다. 문서의 주된 언어가 한글이라고 선언하는 옵션
+ \item[\texttt{hanja}] \verb|[hangul]| $+$ 한자 캡션
+ \item[\texttt{nojosa}] 자동조사 기능 끄기. 이 옵션을 주더라도
+ 자동조사 명령이 에러를 내는 건 아니다.
+ \item[\texttt{usedotemph}] \cs{dotemph} 명령 허용\\
+ --- 이 옵션은 ulem 패키지도 부르므로 \uline{밑줄 긋기} 가능.
+ 단, \cs{normalem} 명령이 선언돼 있으므로 \cs{emph} 명령이
+ 밑줄긋기로 동작하게 하려면 \cs{ULforem} 선언이 있어야 한다.
+ \item[\texttt{usecjkt1font}] 영문자도 한글 글꼴로 식자.
+ 라틴 알파벳이 거의 없는 소설책 따위에 유용할 수 있다.
+ \item[\texttt{mj=<font>}] CJK 명조 글꼴을 지정한다. 예컨대
+ \verb|[mj=utbt]|.
+ \item[\texttt{gt=<font>}] CJK 고딕 글꼴을 지정한다. ttfamily에도
+ 이 글꼴이 쓰인다.
+ \item[\texttt{truetype}] 트루타입 폰트를 사용자 글꼴로 지시했다면
+ 이 옵션을 주어야 텍스트 추출이 가능해진다. PDF\LaTeX 에서만 유의미하다.
+ \end{itemize}
+ \end{description}
+
+\section{User commands}
+ \begin{description}
+ \item[\cs{CJKscale}] 한글만 글자크기 조정
+ \begin{itemize}\leftskip-1cm
+ \item 예: \cs{CJKscale\{0.95\}}
+ \item \verb|[usecjkt1font]| 옵션과는 같이 쓸 수 없다.
+ \item \verb|[hangul]| 옵션 아래서는 단어 간격, 줄 간격,
+ 들여쓰기 크기도 자동 조정
+ \item 전처리부에서만 쓸 수 있다.
+ \end{itemize}
+ \item[\cs{lowerCJKchar}] 한글만 아래로 끌어내려 식자
+ \begin{itemize}\leftskip-1cm
+ \item 예: \cs{lowerCJKchar\{-0.07em\} \% 끌어올려 식자}
+ \item \verb|[usecjkt1font]| 옵션과는 같이 쓸 수 없다.
+ \item 전처리부에서만 쓸 수 있다.
+ \end{itemize}
+ \item[\cs{dotemph}] \dotemph{드러냄표}
+ \begin{itemize}\leftskip-1cm
+ \item 예: \cs{dotemph\{드러냄표\}}
+ \item \verb|[usedotemph]| 옵션 아래에서만 쓸 수 있다.
+ \item \koTeX 과 마찬가지로 \cs{dotemphraise} \cs{dotemphchar} 명령
+ 재정의 가능
+ \end{itemize}
+ \item[기타] 사용자 명령은 CJK 패키지 문서를 참조
+ \end{description}
+
+\section{자동 조사}
+ \begin{itemize}
+ \item \koTeX 과 마찬가지로 \cs{은} \cs{는} \cs{이} \cs{가}
+ \cs{을} \cs{를} \cs{와} \cs{과} \cs{로} \cs{으로} \cs{라}
+ \cs{이라}\,를 쓸 수 있다.
+ \item \cs{ref} \cs{pageref} \cs{cite} 뒤에서만 정상 동작
+ \item 아스키문자 뒤에서만 정상 동작
+ \item 한글 뒤에는 \cs{jong} \cs{jung} \cs{rieul} 명령을
+ 첨가해 바로잡을 수 있다.\par
+ \begin{itemize}
+ \item[예:] \cs{cite\{hong\}}\cs{을} \ldots\\
+ \hskip1.3em\ \cs{bibitem[홍길동}\cs{jong]\{hong\}}
+ \end{itemize}
+ \end{itemize}
+
+\section{한글 카운터}
+\koTeX\ 패키지와 동일하다. 사용례: \cs{pagenumbering\{onum\}}
+\begin{itemize}\leftskip=1cm \labelsep=1em \itemsep=0pt plus0pt
+ \def\cs#1{\texttt{\bfseries #1}}
+ \item[\cs{jaso}] ㄱ ㄴ ㄷ ㄹ ㅁ ㅂ ㅅ ㅇ ㅈ ㅊ ㅋ ㅌ ㅍ ㅎ
+ \item[\cs{gana}] 가 나 다 라 마 바 사 아 자 차 카 타 파 하
+ \item[\cs{ojaso}] ㉠ ㉡ ㉢ ㉣ ㉤ ㉥ ㉦ ㉧ ㉨ ㉩ ㉪ ㉫ ㉬ ㉭
+ \item[\cs{ogana}] ㉮ ㉯ ㉰ ㉱ ㉲ ㉳ ㉴ ㉵ ㉶ ㉷ ㉸ ㉹ ㉺ ㉻
+ \item[\cs{pjaso}] ㈀ ㈁ ㈂ ㈃ ㈄ ㈅ ㈆ ㈇ ㈈ ㈉ ㈊ ㈋ ㈌ ㈍
+ \item[\cs{pgana}] ㈎ ㈏ ㈐ ㈑ ㈒ ㈓ ㈔ ㈕ ㈖ ㈗ ㈘ ㈙ ㈚ ㈛
+ \item[\cs{onum}] ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮
+ \item[\cs{pnum}] ⑴ ⑵ ⑶ ⑷ ⑸ ⑹ ⑺ ⑻ ⑼ ⑽ ⑾ ⑿ ⒀ ⒁ ⒂
+ \item[\cs{oeng}] ⓐ ⓑ ⓒ ⓓ ⓔ ⓕ ⓖ ⓗ ⓘ ⓙ ⓚ ⓛ $\cdots$ ⓩ
+ \item[\cs{peng}] ⒜ ⒝ ⒞ ⒟ ⒠ ⒡ ⒢ ⒣ ⒤ ⒥ ⒦ ⒧ $\cdots$ ⒵
+ \item[\cs{hnum}] 하나 둘 셋 넷 다섯 여섯 일곱 여덟 아홉 열 열하나 $\cdots$ 스물넷
+ \item[\cs{Hnum}] 첫 둘 셋 넷 다섯 여섯 일곱 여덟 아홉 열 열한 $\cdots$ 스물넷
+ \item[\cs{hroman}] ⅰ ⅱ ⅲ ⅳ ⅴ ⅵ ⅶ ⅷ ⅸ ⅹ ⅺ ⅻ
+ \item[\cs{hRoman}] Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ Ⅻ
+ \item[\cs{hNum}] 일 이 삼 사 오 육 칠 팔 구 십 십일 십이 $\cdots$ 이십사
+ \item[\cs{hanjanum}] 一 二 三 四 五 六 七 八 九 十 十一 十二 $\cdots$ 二十四
+\end{itemize}
+
+\section{\texttt{kotex.sty}}
+다양한 \koTeX\ 패키지로의 준자동적인 연결을 담당하는 스타일 파일이다.
+\begin{itemize}
+ \item \verb|[cjk]| 옵션을 주면 \cjkko\ 패키지를 로드한다.
+ 다만 \hologo{XeTeX} 혹은 \hologo{LuaTeX} 엔진이 가동되고 있다면
+ 이 옵션은 무시된다.
+ \item \verb|[euc]| 옵션을 주면 \verb|kotex-euc| 패키지를 로드한다.(이
+ 패키지는 텍라이브에 들어있지 않으므로 KTUG 사설 저장소로부터
+ 설치해야 한다) \hologo{XeTeX} 엔진 하에서는 이 옵션은 무시된다.
+ 그러나 \hologo{LuaTeX} 엔진이 가동되고 있다면
+ \verb|\luatexuhcinputencoding=1| 명령이 자동으로 실행된다.
+ \item 위 두 가지 옵션이 모두 지시되지 않았다면 현재 동작 중인 텍 엔진을
+ 감지해서 \verb|kotexutf.sty|, \verb|xetexko.sty|, 혹은 \verb|luatexko.sty|
+ 가운데 하나를 로드한다. 플레인텍에서도 마찬가지로 동작한다.
+ \item 어느 경우이든 사용자가 지시한 여타 패키지 옵션들은 새로 불려지는
+ 패키지에 모두 투명하게 전달된다.
+\end{itemize}
+
+\section{License}
+\begin{itemize}
+ \item GPL~--- \verb|cjkutf8-*| 파일의 라이선스는 CJK 패키지와
+ 같을 수밖에 없다.
+ \item LPPL~--- \verb|ko*| 파일들은 \koTeX\ 패키지에서 유래한다.
+\end{itemize}
+\nobreak\hfill \fboxsep=-\fboxrule \fbox{\vbox to1em{\hbox to1em{\hss}\vss}}
+
+\end{document}
diff --git a/language/korean/cjk-ko/cjkutf8-josa.sty b/language/korean/cjk-ko/cjkutf8-josa.sty
new file mode 100644
index 0000000000..55e3872062
--- /dev/null
+++ b/language/korean/cjk-ko/cjkutf8-josa.sty
@@ -0,0 +1,131 @@
+% cjkutf8-josa.sty
+%
+% Copyright (c) 2016 Dohyun Kim <nomos at ktug org>
+%
+% This program is free software; you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% This program 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. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program in doc/COPYING; if not, write to the Free
+% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+% MA 02110-1301 USA
+
+\ProvidesPackage{cjkutf8-josa}[2016/04/04 v1.8 Automatic Josa selection for cjk-ko]
+
+\AtBeginDocument{
+ \ifx\use@josa\undefined\else
+ % redefine \@setref
+ \let\CJKKO@orig@setref\@setref
+ \def\@setref#1#2#3{\CJKKO@orig@setref{#1}{#2}{#3}%
+ \bgroup
+ \ifx#1\relax\else
+ \ifx\protect\relax % not from kotexutf
+ \let\protect\noexpand % not from kotexutf
+ \xdef\josa@str{\expandafter#2#1}%
+ \fi
+ \fi
+ \egroup}
+ % redefine \@cite@ofmt
+ \let\CJKKO@orig@cite@ofmt\@cite@ofmt
+ \def\@cite@ofmt#1{\CJKKO@orig@cite@ofmt{#1}%
+ \bgroup
+ \let\protect\noexpand % not from kotexutf
+ \let\@safe@activesfalse\@empty % babel ?
+ \def\hyper@@link[##1]##2##3##4{##4}%
+ \def\beamer@sort##1##2{}%
+ \def\hyperlink##1##2{##2}% for beamer: not from kotexutf
+ \xdef\josa@str{#1}%
+ \egroup}
+ \fi
+ \@ifpackageloaded{hyperref}{\g@addto@macro\pdfstringdefPreHook{%
+ \let\jong\relax
+ \let\rieul\relax
+ \let\jung\relax
+ \def\^^ea{^^ea}%
+ \def\^^eb{^^eb}%
+ \def\^^ec{^^ec}%
+ }}{}
+}
+
+%%% user commands: \jong \jung \rieul
+\protected\def\jong {\let\josa@str\empty\chardef\@josa\z@ }
+\protected\def\rieul{\let\josa@str\empty\chardef\@josa\@ne}
+\protected\def\jung {\let\josa@str\empty\chardef\@josa\tw@}
+\jung
+
+\def\makejosa#1#2{%
+ \bgroup
+ \expandafter\make@josa\josa@str\@nil{#1}{#2}%
+ \egroup}
+
+\def\make@josa{\afterassignment\make@@josa\let\@let@token= }
+\def\make@@josa{%
+ \ifx\@let@token\@nil
+ \expandafter\make@@@josa
+ \else
+ \ifx\@let@token 1\rieul\else
+ \ifx\@let@token 3\jong \else
+ \ifx\@let@token 6\jong \else
+ \ifx\@let@token 7\rieul\else
+ \ifx\@let@token 8\rieul\else
+ \ifx\@let@token 0\jong \else
+ \ifx\@let@token l\rieul\else
+ \ifx\@let@token m\jong \else
+ \ifx\@let@token n\jong \else
+ \ifx\@let@token L\rieul\else
+ \ifx\@let@token M\jong \else
+ \ifx\@let@token N\jong \else
+ \ifx\@let@token\jong \jong \else
+ \ifx\@let@token\rieul\rieul\else
+ \jung
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \expandafter\make@josa
+ \fi}
+
+\def\make@@@josa#1#2{%
+ \ifcase\@josa #2% jong
+ \or \ifx\empty#1\empty\else#2\fi % rieul
+ \else #1% jung
+ \fi}
+
+\def\error@josa{\PackageError{cjkutf8-josa}{Undefined Control Sequence}{}}
+
+\DeclareRobustCommand*\^^ea[2]{%
+ \ifx#1^^b0\ifx#2^^80\makejosa{가}{이}\else\error@josa\fi % \가
+ \else\ifx#1^^b3\ifx#2^^bc\makejosa{와}{과}\else\error@josa\fi % \과
+ \else\error@josa\fi\fi}
+\DeclareRobustCommand*\^^eb[2]{%
+ \ifx#1^^8a\ifx#2^^94\makejosa{는}{은}\else\error@josa\fi % \는
+ \else\ifx#1^^9d\ifx#2^^bc\makejosa{라}{이라}\else\error@josa\fi % \라
+ \else\ifx#1^^a1\ifx#2^^9c\makejosa{}{으}로\else\error@josa\fi % \로
+ \else\ifx#1^^a5\ifx#2^^bc\makejosa{를}{을}\else\error@josa\fi % \를
+ \else\error@josa\fi\fi\fi\fi}
+\DeclareRobustCommand*\^^ec[2]{%
+ \let\reserved@a#1\let\reserved@b#2%
+ \futurelet\@let@token\@josa@begin@ec}
+\def\@josa@begin@ec{%
+ \ifx\reserved@a^^99%
+ \ifx\reserved@b^^80\makejosa{와}{과}\else\error@josa\fi % \와
+ \else\ifx\reserved@a^^9c%
+ \ifx\reserved@b^^bc\makejosa{}{으}\else\error@josa\fi % \으로
+ \else\ifx\reserved@a^^9d%
+ \ifx\reserved@b^^80\makejosa{는}{은}% \은
+ \else\ifx\reserved@b^^84\makejosa{를}{을}% \을
+ \else\ifx\reserved@b^^b4%
+ \ifx\@let@token^^ea\makejosa\relax{이}% \이라
+ \else\ifx\@let@token^^eb\makejosa\relax{이}% \이라
+ \else\ifx\@let@token^^ec\makejosa\relax{이}% \이라
+ \else\ifx\@let@token^^ed\makejosa\relax{이}% \이라
+ \else\makejosa{가}{이}% \이
+ \fi\fi\fi\fi
+ \else\error@josa \fi\fi\fi
+ \else\error@josa \fi\fi\fi}
+
+\endinput
diff --git a/language/korean/cjk-ko/cjkutf8-ko.sty b/language/korean/cjk-ko/cjkutf8-ko.sty
new file mode 100644
index 0000000000..8d3e943638
--- /dev/null
+++ b/language/korean/cjk-ko/cjkutf8-ko.sty
@@ -0,0 +1,466 @@
+% cjkutf8-ko.sty
+%
+% Copyright (c) 2016 Dohyun Kim <nomos at ktug org>
+%
+% This program is free software; you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% This program 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. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program in doc/COPYING; if not, write to the Free
+% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+% MA 02110-1301 USA
+
+\ProvidesPackage{cjkutf8-ko}[2016/04/04 v1.8 Hangul typesetting on CJKutf8]
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname eTeXversion\endcsname\relax
+ \PackageError{cjkutf8-ko}
+ {e-TeX engine is required}
+ {Please update your TeX system to the latest distribution}
+\endinput\fi
+
+\newif\if@hangul
+\newif\if@hanja
+\let\use@josa\empty
+
+\DeclareOption{hangul}{\@hangultrue}
+\DeclareOption{hanja}{\@hanjatrue\@hangultrue}
+\DeclareOption{usecjkt1font}{\let\usecjk@@font\empty\@hangultrue}
+\DeclareOption{usedotemph}{\let\usedot@mph\empty}
+\DeclareOption{nojosa}{\let\use@josa\undefined}
+\DeclareOption{truetype}{\let\use@cjk@cmap@\relax}
+\DeclareOption*{\expandafter\CJKKO@userfont@option\CurrentOption=\end}
+\def\CJKKO@userfont@option#1=#2\end{%
+ \ifx\empty#2\empty
+ \PassOptionsToPackage{#1}{CJKutf8}
+ \else
+ \def\reserved@a{mj}\def\reserved@b{gt}\def\reserved@c{#1}
+ \ifx\reserved@a\reserved@c
+ \edef\CJKKO@mjfont{\CJKKO@removetrailingEQ#2}
+ \IfFileExists{c70\CJKKO@mjfont.fd}{}{%
+ \PackageError{cjkutf8-ko}{`c70\CJKKO@mjfont.fd' does not exist}{}
+ \let\CJKKO@mjfont\undefined
+ }
+ \else
+ \ifx\reserved@b\reserved@c
+ \edef\CJKKO@gtfont{\CJKKO@removetrailingEQ#2}
+ \IfFileExists{c70\CJKKO@gtfont.fd}{}{%
+ \PackageError{cjkutf8-ko}{`c70\CJKKO@gtfont.fd' does not exist}{}
+ \let\CJKKO@gtfont\undefined
+ }
+ \else
+ \PackageError{cjkutf8-ko}
+ {Unknown hangul font type: #1}
+ {Allowed font types are `mj' and `gt'}
+ \fi
+ \fi
+ \fi
+}
+\def\CJKKO@removetrailingEQ#1={#1}
+\ProcessOptions\relax
+
+\ifx\CJKKO@mjfont\undefined
+ \IfFileExists{c70nanummj.fd}{\def\CJKKO@mjfont{nanummj}}{
+ \def\CJKKO@mjfont{mj}
+ \ifx\usedot@mph\undefined\else
+ \def\dotemphraise{1ex}
+ \def\dotemphchar{\Unicode{"02}{"D9}}
+ \fi
+ }
+\fi
+\ifx\CJKKO@gtfont\undefined
+ \IfFileExists{c70nanumgt.fd}{\def\CJKKO@gtfont{nanumgt}}{\def\CJKKO@gtfont{mj}}
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+% font settings
+\ifx\usecjk@@font\undefined\else
+ \PassOptionsToPackage{T1}{CJKutf8}
+ \RequirePackage{textcomp}
+ \IfFileExists{t1\CJKKO@mjfont.fd}{\let\rmdefault\CJKKO@mjfont}{}
+ \IfFileExists{t1\CJKKO@gtfont.fd}{\let\sfdefault\CJKKO@gtfont}{}
+\fi
+
+\RequirePackage{CJKutf8}
+
+\g@addto@macro\rmfamily{\CJKfamily{\CJKKO@mjfont}}
+\g@addto@macro\sffamily{\CJKfamily{\CJKKO@gtfont}}
+\g@addto@macro\ttfamily{\CJKfamily{\CJKKO@gtfont}}
+
+\AtBeginDocument{
+ \edef\reserved@a{\familydefault}
+ \edef\reserved@b{\rmdefault}
+ \ifx\reserved@a\reserved@b
+ \CJKfamily{\CJKKO@mjfont}
+ \g@addto@macro\normalfont{\CJKfamily{\CJKKO@mjfont}}
+ \if@hangul\ifx\usecjk@@font\undefined
+ \IfFileExists{t1\CJKKO@mjfont .fd}{%
+ \CJKKO@hangulspaceglue{t1\CJKKO@mjfont m}% space glue from hangul font
+ }{}
+ \fi\fi
+ \else
+ \CJKfamily{\CJKKO@gtfont}
+ \g@addto@macro\normalfont{\CJKfamily{\CJKKO@gtfont}}
+ \if@hangul\ifx\usecjk@@font\undefined
+ \IfFileExists{t1\CJKKO@gtfont .fd}{%
+ \CJKKO@hangulspaceglue{t1\CJKKO@gtfont m}% space glue from hangul font
+ }{}
+ \fi\fi
+ \fi
+ \let\reset@font\normalfont
+}
+
+\def\CJKKO@hangulspaceglue#1{\@ifclassloaded{minimal}{}{%
+ \bgroup
+ \@for\reserved@a:=,\small,\footnotesize,\large,\Large,\LARGE\do{%
+ \reserved@a
+ \font\x=#1 at \f@size\p@
+ \fontdimen2\font=\fontdimen2\x
+ \fontdimen3\font=.5\fontdimen2\x
+ \fontdimen4\font=.3333\fontdimen2\x
+ \fontdimen7\font=\fontdimen7\x }%
+ \egroup }}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% dotemph
+% Users can redefine \dotemphchar and \dotemphraise
+\ifx\usedot@mph\undefined
+ \def\dotemph{\PackageError{cjkutf8-ko}
+ {To enable \string\dotemph, package option [usedotemph] is required}
+ {CJKfntef.sty will be automatically loaded if [usedotemph] option is given}}
+\else
+ % CJKglue should be skip only. seems to do with \LA@CJKglue in CJKulem.sty
+ \RequirePackage{ulem}[2000/05/26]
+ \addto@hook\UL@hook{\let\CJKglue\HangulGlue}
+ \RequirePackage{CJKfntef}
+ \normalem % users should declare \ULforem to enable underlining for \emph
+ \ifx\dotemphraise\undefined \def\dotemphraise{0.5ex}\fi
+ \ifx\dotemphchar\undefined \def\dotemphchar{\bfseries\Unicode{"02}{"D9}}\fi
+ % user command: dotemph
+ \DeclareRobustCommand*\dotemph{%
+ \CJKunderanysymbol{-\dotemphraise}{\dotemphchar}}
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+% start CJK env
+\def\HangulGlue{\hskip0pt plus.1ex minus.01em }
+\def\HangulPenalty{\ifnum\lastpenalty=\z@ \penalty50 \fi}
+\def\CJKglue{\HangulPenalty\HangulGlue}
+\def\CJKpostmathglue{\HangulPenalty\hskip.25ex plus.1ex minus.05ex }
+\CJKspace
+\CJK@envStart{}{UTF8}{\CJKKO@mjfont}
+\makeatletter
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+% italic correction after cjk
+\edef\maybe@ic@{%
+ \unexpanded{%
+ \let\CJKKO@wasCJK\undefined
+ \ifnum\lastkern=\@ne
+ \unkern\unkern
+ \let\CJKKO@wasCJK\empty
+ \fi
+ }%
+ \unexpanded\expandafter{\maybe@ic@
+ \ifx\CJKKO@wasCJK\empty
+ \CJK@CJK
+ \CJKKO@check@next@tok@
+ \let\CJKKO@wasCJK\undefined
+ \fi
+ }%
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% CJKscale: scale CJK char size
+\def\CJKscale#1{%
+ \ifx\usecjk@@font\undefined
+ \def\CJK@scale{#1}%
+ \else
+ \PackageError{cjkutf8-ko}
+ {\string\CJKscale\space is not allowed}
+ {\string\CJKscale\space cannot be used with option [usecjkt1font]}
+ \fi}
+\@onlypreamble\CJKscale
+\def\cancelCJKscale{\let\CJK@scale\undefined}
+\@onlypreamble\cancelCJKscale
+\AtBeginDocument{
+ \ifx\usecjk@@font\undefined
+ \ifx\CJK@scale\undefined\else
+ % redefine \CJK@empty
+ \def\CJK@empty#1{%
+ \@tempdimb \f@size\p@
+ \@tempdimb\CJK@scale\@tempdimb %%% inserted
+ \ifx\optional@arg \@empty
+ \else
+ \expandafter\ifx
+ \csname CJK@\mandatory@arg/\f@size/\the\@tempdimb\endcsname \relax
+ \@tempdimb \optional@arg\@tempdimb
+ #1{Font\space shape\space `\curr@fontshape'\space
+ will\space be\MessageBreak
+ scaled\space to\space size\space \the\@tempdimb}%
+ \expandafter
+ \gdef\csname CJK@\mandatory@arg/\f@size/\the\@tempdimb\endcsname{}%
+ \fi
+ \fi
+ \edef\external@font{%
+ \mandatory@arg\CJK@plane\space at \the\@tempdimb}%
+ \xdef\font@name{%
+ \csname \curr@fontshape/\f@size/\CJK@plane\endcsname}%
+ \expandafter\global\expandafter\let
+ \csname \CJK@curr@fontshape\expandafter\endcsname
+ \csname \curr@fontshape\endcsname}
+ \if@hangul % hangul is main language
+ % scale space glue
+ \@ifclassloaded{minimal}{}{%
+ \bgroup
+ \@for\reserved@a:=,\small,\footnotesize,\large,\Large,\LARGE\do{%
+ \fontdimen2\font=\CJK@scale\fontdimen2\font
+ \fontdimen3\font=\CJK@scale\fontdimen3\font
+ \fontdimen4\font=\CJK@scale\fontdimen4\font
+ \fontdimen7\font=\CJK@scale\fontdimen7\font}
+ \egroup
+ }
+ % scale parindent, footnotesep, footins
+ \parindent\CJK@scale\parindent
+ \footnotesep\CJK@scale\footnotesep
+ \skip\footins=\CJK@scale\skip\footins plus6pt minus3pt
+ % scale linespread
+ \@tempdima\baselinestretch\p@
+ \@tempdima\CJK@scale\@tempdima
+ \edef\reserved@a{\strip@pt\@tempdima}
+ \expandafter\expandafter\expandafter\linespread\expandafter{\reserved@a}
+ \selectfont
+ \fi
+ \fi\fi
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% insert CJKglue before opening ascii and letter
+\def\CJK@ignorespaces{%
+ \ifnum\lastkern=\@ne
+ \spacefactor\@m % was normal cjk, so sf=1000
+ \expandafter\expandafter\expandafter\CJKKO@check@next@tok
+ \fi}
+\def\CJKKO@check@next@tok{\futurelet\@let@token\CJKKO@check@next@tok@}
+\def\CJKKO@check@next@tok@{%
+ \ifx\@let@token(\CJKglue\else
+ \ifx\@let@token`\CJKglue\else
+ \ifx\@let@token[\CJKglue\else
+ \ifx\@let@token<\CJKglue\else
+ \ifx\@let@token\{\CJKglue\else
+ \ifcat\noexpand\@let@token\CJKKO@catcodeXI
+ \CJKglue
+ \fi\fi\fi\fi\fi\fi}
+
+\begingroup
+ \catcode`\A=11 \global\let\CJKKO@catcodeXI=A
+\endgroup
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% allow break after ascii (except opening) and before cjk
+%%% not a good solution. but...
+\sfcode16=998 % t1 ``
+\sfcode40=998 % (
+\sfcode60=998 % <
+\sfcode91=998 % [
+\sfcode92=998 % ot1 ``
+\sfcode96=998 % `
+\sfcode102=998 % oms {
+\sfcode123=998 % t1 {
+\def\CJK@testLastCJK{%
+ \global\CJK@false
+ \ifnum\lastkern=\@ne
+ \global \CJK@true
+ %%% inserted
+ \else
+ \ifhmode
+ \ifnum\lastkern=\tw@\else
+ \ifnum\lastskip=\z@ % last node is not space (?)
+ \ifnum\lastpenalty=\z@ % last node is not penalty (?)
+ \ifnum\spacefactor=998 \else % last char is not opening ascii
+ \ifx\CJK@plane\undefined\else
+ \CJK@testPostPunct{\CJK@@@enc}{\CJK@plane}{\CJK@gtemp}%
+ \fi
+ \ifCJK@
+ \global\CJK@false
+ \else % this char is not closing cjk
+ \ifnum\lastnodetype=10 \CJKpostmathglue % after math-off
+ \else \CJKglue \fi
+ \fi
+ \fi\fi\fi\fi\fi
+ %%% end of inserted
+ \fi}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+% half-width puncts
+\def\CJKKO@XXX@plane{30}
+\def\CJKKO@FF@plane{ff}
+\DeclareRobustCommand\CJKpunctsymbol[1]{%
+ \ifx\CJK@plane\CJKKO@XXX@plane
+ \ifcase#1\CJKsymbol{#1}% 3000
+ \or \CJKKO@normal@punct{#1}% 3001
+ \or \CJKKO@normal@punct{#1}% 3002
+ \or \CJKsymbol{#1}% 3003
+ \or \CJKsymbol{#1}% 3004
+ \or \CJKsymbol{#1}% 3005
+ \or \CJKsymbol{#1}% 3006
+ \or \CJKsymbol{#1}% 3007
+ \or \CJKKO@opening@punct{#1}% 3008
+ \or \CJKKO@normal@punct{#1}% 3009
+ \or \CJKKO@opening@punct{#1}% 300A
+ \or \CJKKO@normal@punct{#1}% 300B
+ \or \CJKKO@opening@punct{#1}% 300C
+ \or \CJKKO@normal@punct{#1}% 300D
+ \or \CJKKO@opening@punct{#1}% 300E
+ \or \CJKKO@normal@punct{#1}% 300F
+ \or \CJKKO@opening@punct{#1}% 3010
+ \or \CJKKO@normal@punct{#1}% 3011
+ \or \CJKsymbol{#1}% 3012
+ \or \CJKsymbol{#1}% 3013
+ \or \CJKKO@opening@punct{#1}% 3014
+ \or \CJKKO@normal@punct{#1}% 3015
+ \or \CJKKO@opening@punct{#1}% 3016
+ \or \CJKKO@normal@punct{#1}% 3017
+ \or \CJKKO@opening@punct{#1}% 3018
+ \or \CJKKO@normal@punct{#1}% 3019
+ \or \CJKKO@opening@punct{#1}% 301A
+ \or \CJKKO@normal@punct{#1}% 301B
+ \else \CJKsymbol{#1}%
+ \fi
+ \else
+ \ifx\CJK@plane\CJKKO@FF@plane
+ \ifnum#1="08 \CJKKO@opening@punct{#1}% FF08
+ \else\ifnum#1="09 \CJKKO@normal@punct{#1}% FF09
+ \else \CJKsymbol{#1}%
+ \fi\fi
+ \else
+ \CJKsymbol{#1}%
+ \fi
+ \fi}
+\def\CJKKO@opening@punct#1{\leavevmode\hbox to.5em{\hss\CJKsymbol{#1}}}
+\def\CJKKO@normal@punct#1{\leavevmode\hbox to.5em{\CJKsymbol{#1}\hss}}
+\AtBeginDocument{
+ \DeclareUnicodeCharacter{00B7}
+ {\leavevmode\kern.25em \Unicode{0}{"B7}\hskip.25em\relax}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% lowercjkchar: eg, \lowercjkchar{-0.1em}
+%%% do NOT use unit ex; hangul subfonts may not have x-height
+\def\lowercjkchar#1{%
+ \ifx\usecjk@@font\undefined
+ \def\CJK@charlower{#1}%
+ \else
+ \PackageError{cjkutf8-ko}
+ {\string\lowercjkchar\space is not allowed}
+ {\string\lowercjkchar\space cannot be used with option [usecjkt1font]}
+ \fi}
+\let\lowerCJKchar\lowercjkchar
+\@onlypreamble\lowercjkchar \@onlypreamble\lowerCJKchar
+\def\cancellowercjkchar{\let\CJK@charlower\undefined}
+\let\cancellowerCJKchar\cancellowercjkchar
+\@onlypreamble\cancellowercjkchar \@onlypreamble\cancellowerCJKchar
+\AtBeginDocument{
+ \ifx\usecjk@@font\undefined
+ \ifx\CJK@charlower\undefined\else
+ \DeclareRobustCommand{\CJKsymbol}[1]{%
+ \leavevmode\lower\CJK@charlower\hbox{% inserted
+ \symbol{#1}%
+ \ifCJK@bold@
+ \hbox to \CJKboldshift{\hss\symbol{#1}}%
+ \hbox to \CJKboldshift{\hss\symbol{#1}}%
+ \fi
+ }% inserted
+ }
+ \fi\fi
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% nanummj has no hanja : texlive only
+\def\CJKKO@mjdefault{nanummj}
+\ifx\CJKKO@mjfont\CJKKO@mjdefault
+ \RequirePackage{cjkutf8-nanummjhanja}
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% auto-josa, light version
+\RequirePackage{cjkutf8-josa}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+% hangul captions, labels, and spacing
+\RequirePackage{kolabels-utf}
+\if@hangul
+ \AtBeginDocument{\RequirePackage{konames-utf}}
+ \linespread{1.3888}
+ \footnotesep=1.3888\footnotesep
+ \skip\footins=1.3888\skip\footins plus6pt minus3pt
+ \frenchspacing
+\fi
+
+%\ifx\usecjk@@font\undefined
+% \CJKscale{0.95}
+% \lowercjkchar{-0.07em}
+%\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% use pdftex's pdfgentounicode
+\ifpdf
+ \ifx\pdfgentounicode\undefined\else
+ \ifx\use@cjk@cmap@\relax\else
+ \InputIfFileExists{glyphtounicode}{%
+ \let\CJK@addcmap\@gobble
+ \pdfgentounicode\@ne
+ }{}
+ \fi
+ \fi
+\fi
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% \makeindex in memoir class clashed with this package.
+%%% cause: memoir appempts to write index entries to a file
+%%% at the end of document without protecting active characters.
+%%% spotted by Juho Lee. thanks to him.
+%\AtEndDocument{\CJK@makeInactive}
+%%% still conflicts with package verbments.
+%%% so now we make utf8 characters robust.
+\count@"C2 \loop
+ \uccode\count@\count@
+ \lccode\count@\count@
+ \begingroup
+ \lccode`\~\count@
+ \lowercase{\endgroup
+ \protected\edef~{\unexpanded\expandafter{~}}}
+\ifnum\count@<"F4 \advance\count@\@ne \repeat
+% then we have to care about hyperref bookmarks.
+\ifx\pdfstringdefPreHook\undefined
+ \let\pdfstringdefPreHook\empty
+\fi
+\g@addto@macro\pdfstringdefPreHook{%
+ \count@"C2 \loop
+ \begingroup
+ \lccode`\~\count@
+ \lowercase{\endgroup
+ \edef~{\unexpanded\expandafter{~}}}%
+ \ifnum\count@<"F4 \advance\count@\@ne \repeat
+ % and dotemph as well
+ \let\dotemph\@firstofone
+}
+% protect against lowercase
+\count@"80 \loop
+ \uccode\count@\count@
+ \lccode\count@\count@
+\ifnum\count@<"BF \advance\count@\@ne \repeat
+
+%%% ignore variation selectors for korean hanja
+\DeclareUnicodeCharacter{FE00}{}
+\DeclareUnicodeCharacter{FE01}{}
+\DeclareUnicodeCharacter{FE02}{}
+
+\endinput
diff --git a/language/korean/cjk-ko/cjkutf8-nanummjhanja.sty b/language/korean/cjk-ko/cjkutf8-nanummjhanja.sty
new file mode 100644
index 0000000000..f96fae70aa
--- /dev/null
+++ b/language/korean/cjk-ko/cjkutf8-nanummjhanja.sty
@@ -0,0 +1,62 @@
+% cjkutf8-nanummjhanja.sty
+%
+% Copyright (c) 2016 Dohyun Kim <nomos at ktug org>
+%
+% This program is free software; you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation; either version 2 of the License, or
+% (at your option) any later version.
+%
+% This program 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. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program in doc/COPYING; if not, write to the Free
+% Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+% MA 02110-1301 USA
+
+\ProvidesPackage{cjkutf8-nanummjhanja}
+ [2016/04/04 v1.8 UHC hanja for Nanum Myeongjo]
+
+\def\CJKKO@mjdefault{nanummj}
+\def\CJKKO@mjhanjafamily{\def\CJK@family{uhcmj}}
+
+% redefine CJK@numbToHex
+\def\CJK@numbToHex#1#2{%
+ {\count\z@ #2\relax
+ \count\tw@ \count\z@
+ \divide\count\z@ \sixt@@n
+ \count@ \count\z@
+ \multiply\count@ \sixt@@n
+ \advance\count\tw@ -\count@
+ \xdef#1{%
+ \hexnumber@{\count\z@}\hexnumber@{\count\tw@}}}%
+ % inserted
+ \ifx\CJK@family\CJKKO@mjdefault
+ \expandafter\CJKKO@checkhanjaplane#1\fi}
+
+\def\CJKKO@checkhanjaplane#1#2{%
+ \begingroup
+ \count@\ifx#1A10\else
+ \ifx#1B11\else
+ \ifx#1C12\else
+ \ifx#1D13\else
+ \ifx#1E14\else
+ \ifx#1F15\else
+ #1\fi\fi\fi\fi\fi\fi
+ \@tempcnta\ifx#2A10\else
+ \ifx#2B11\else
+ \ifx#2C12\else
+ \ifx#2D13\else
+ \ifx#2E14\else
+ \ifx#2F15\else
+ #2\fi\fi\fi\fi\fi\fi
+ \multiply\count@\sixt@@n \advance\count@\@tempcnta
+ \ifnum\count@>"4D \ifnum\count@<"A0 \aftergroup\CJKKO@mjhanjafamily \else
+ \ifnum\count@>"F8 \ifnum\count@<"FB \aftergroup\CJKKO@mjhanjafamily
+ \fi\fi\fi\fi
+ \endgroup }
+
+\endinput
diff --git a/language/korean/cjk-ko/kolabels-utf.sty b/language/korean/cjk-ko/kolabels-utf.sty
new file mode 100644
index 0000000000..dcc4fba7b6
--- /dev/null
+++ b/language/korean/cjk-ko/kolabels-utf.sty
@@ -0,0 +1,96 @@
+% kolabels-utf.sty
+%
+% Copyright (C) 2009-2015 Koaunghi Un <koaunghi at kornet net>
+% Kangsoo Kim <karnes at ktug or kr>
+% 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.
+%
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{kolabels-utf}[2015/03/20 v1.5 UTF-8 Hangul item labels]
+
+% hangul item labels
+\newcommand*\jaso[1]{\@jaso{\@nameuse{c@#1}}}
+\newcommand*\@jaso[1]{\ifcase#1\or
+ ㄱ\or ㄴ\or ㄷ\or ㄹ\or ㅁ\or ㅂ\or ㅅ\or ㅇ\or
+ ㅈ\or ㅊ\or ㅋ\or ㅌ\or ㅍ\or ㅎ\else\@ctrerr\fi}
+\newcommand*\gana[1]{\@gana{\@nameuse{c@#1}}}
+\newcommand*\@gana[1]{\ifcase#1\or
+ 가\or 나\or 다\or 라\or 마\or 바\or 사\or 아\or
+ 자\or 차\or 카\or 타\or 파\or 하\else\@ctrerr\fi}
+\newcommand*\ojaso[1]{\@ojaso{\@nameuse{c@#1}}}
+\newcommand*\@ojaso[1]{\ifcase#1\or
+ ㉠\or ㉡\or ㉢\or ㉣\or ㉤\or ㉥\or ㉦\or ㉧\or
+ ㉨\or ㉩\or ㉪\or ㉫\or ㉬\or ㉭\else\@ctrerr\fi}
+\newcommand*\ogana[1]{\@ogana{\@nameuse{c@#1}}}
+\newcommand*\@ogana[1]{\ifcase#1\or
+ ㉮\or ㉯\or ㉰\or ㉱\or ㉲\or ㉳\or ㉴\or ㉵\or
+ ㉶\or ㉷\or ㉸\or ㉹\or ㉺\or ㉻\else\@ctrerr\fi}
+\newcommand*\pjaso[1]{\@pjaso{\@nameuse{c@#1}}}
+\newcommand*\@pjaso[1]{\ifcase#1\or
+ ㈀\or ㈁\or ㈂\or ㈃\or ㈄\or ㈅\or ㈆\or ㈇\or
+ ㈈\or ㈉\or ㈊\or ㈋\or ㈌\or ㈍\else\@ctrerr\fi}
+\newcommand*\pgana[1]{\@pgana{\@nameuse{c@#1}}}
+\newcommand*\@pgana[1]{\ifcase#1\or
+ ㈎\or ㈏\or ㈐\or ㈑\or ㈒\or ㈓\or ㈔\or ㈕\or
+ ㈖\or ㈗\or ㈘\or ㈙\or ㈚\or ㈛\else\@ctrerr\fi}
+\newcommand*\onum[1]{\@onum{\@nameuse{c@#1}}}
+\newcommand*\@onum[1]{\ifcase#1\or
+ ①\or ②\or ③\or ④\or ⑤\or ⑥\or ⑦\or ⑧\or
+ ⑨\or ⑩\or ⑪\or ⑫\or ⑬\or ⑭\or ⑮\else\@ctrerr\fi}
+\newcommand*\pnum[1]{\@pnum{\@nameuse{c@#1}}}
+\newcommand*\@pnum[1]{\ifcase#1\or
+ ⑴\or ⑵\or ⑶\or ⑷\or ⑸\or ⑹\or ⑺\or ⑻\or
+ ⑼\or ⑽\or ⑾\or ⑿\or ⒀\or ⒁\or ⒂\else\@ctrerr\fi}
+\newcommand*\oeng[1]{\@oeng{\@nameuse{c@#1}}}
+\newcommand*\@oeng[1]{\ifcase#1\or
+ ⓐ\or ⓑ\or ⓒ\or ⓓ\or ⓔ\or ⓕ\or ⓖ\or ⓗ\or ⓘ\or
+ ⓙ\or ⓚ\or ⓛ\or ⓜ\or ⓝ\or ⓞ\or ⓟ\or ⓠ\or ⓡ\or
+ ⓢ\or ⓣ\or ⓤ\or ⓥ\or ⓦ\or ⓧ\or ⓨ\or ⓩ\else\@ctrerr\fi}
+\newcommand*\peng[1]{\@peng{\@nameuse{c@#1}}}
+\newcommand*\@peng[1]{\ifcase#1\or
+ ⒜\or ⒝\or ⒞\or ⒟\or ⒠\or ⒡\or ⒢\or ⒣\or ⒤\or
+ ⒥\or ⒦\or ⒧\or ⒨\or ⒩\or ⒪\or ⒫\or ⒬\or ⒭\or
+ ⒮\or ⒯\or ⒰\or ⒱\or ⒲\or ⒳\or ⒴\or ⒵\else\@ctrerr\fi}
+\newcommand*\hnum[1]{\@hnum{\@nameuse{c@#1}}}
+\newcommand*\@hnum[1]{\ifcase#1\or
+ 하나\or 둘\or 셋\or 넷\or 다섯\or 여섯\or 일곱\or 여덟\or
+ 아홉\or 열\or 열하나\or 열둘\or 열셋\or 열넷\or 열다섯\or
+ 열여섯\or 열일곱\or 열여덟\or 열아홉\or 스물\or 스물하나\or
+ 스물둘\or 스물셋\or 스물넷\else\@ctrerr\fi}
+\newcommand*\Hnum[1]{\@Hnum{\@nameuse{c@#1}}}
+\newcommand*\@Hnum[1]{\ifcase#1\or
+ 첫\or 둘\or 셋\or 넷\or 다섯\or 여섯\or 일곱\or 여덟\or
+ 아홉\or 열\or 열한\or 열두\or 열셋\or 열넷\or 열다섯\or
+ 열여섯\or 열일곱\or 열여덟\or 열아홉\or 스무\or 스물한\or
+ 스물두\or 스물셋\or 스물넷\else\@ctrerr\fi 째}
+\newcommand*\hroman[1]{\@hroman{\@nameuse{c@#1}}}
+\newcommand*\@hroman[1]{\ifcase#1\or
+ ⅰ\or ⅱ\or ⅲ\or ⅳ\or ⅴ\or ⅵ\or ⅶ\or ⅷ\or
+ ⅸ\or ⅹ\or ⅺ\or ⅻ\else\@ctrerr\fi}
+\newcommand*\hRoman[1]{\@hRoman{\@nameuse{c@#1}}}
+\newcommand*\@hRoman[1]{\ifcase#1\or
+ Ⅰ\or Ⅱ\or Ⅲ\or Ⅳ\or Ⅴ\or Ⅵ\or Ⅶ\or Ⅷ\or
+ Ⅸ\or Ⅹ\or Ⅺ\or Ⅻ\else\@ctrerr\fi}
+
+% from kosections-utf.tex
+\def\hNum#1{\@hNum{\@nameuse{c@#1}}}
+\def\@hNum#1{\ifcase#1\or 일\or 이\or 삼\or 사\or 오\or 육\or 칠\or
+ 팔\or 구\or 십\or 십일\or 십이\or 십삼\or 십사\or 십오\or 십육\or
+ 십칠\or 십팔\or 십구\or 이십\or 이십일\or 이십이\or 이십삼\or
+ 이십사\else\@ctrerr\fi}
+\def\hanjanum#1{\@hanjanum{\@nameuse{c@#1}}}
+\def\@hanjanum#1{\ifcase#1\or 一\or 二\or 三\or
+ 四\or 五\or 六\or 七\or 八\or 九\or 十\or
+ 十一\or 十二\or 十三\or 十四\or 十五\or
+ 十六\or 十七\or 十八\or 十九\or 二十\or
+ 二十一\or 二十二\or 二十三\or 二十四\else\@ctrerr\fi}
+
+\endinput
diff --git a/language/korean/cjk-ko/konames-utf.sty b/language/korean/cjk-ko/konames-utf.sty
new file mode 100644
index 0000000000..01a486e8ae
--- /dev/null
+++ b/language/korean/cjk-ko/konames-utf.sty
@@ -0,0 +1,140 @@
+% konames-utf.sty
+%
+% Copyright (C) 2007-2015 Koaunghi Un <koaunghi at kornet net>
+% Kangsoo Kim <karnes at ktug or kr>
+% 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.
+%
+
+\ProvidesPackage{konames-utf}[2015/07/06 v1.7 UTF-8 Hangul captions]
+
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname if@hanja\endcsname\relax
+ \expandafter\newif\csname if@hanja\endcsname
+\fi
+
+\if@hanja
+ \def\today{\number\year 年 \number\month 月 \number\day 日}
+ \def\enclname{同封物}
+ \def\ccname{寫本}% 사전에서
+ \def\headtoname{受信人:}%
+ \def\seename{\을~參考}%
+ \def\alsoname{\을~參考}%
+ \def\contentsname{目~次}%
+ \def\listfigurename{그림~目次}%
+ \def\listtablename{表~目次}%
+ \def\refname{參考~文獻}% {參照~書籍}
+ \def\indexname{索~引}
+ \def\tablename{表}
+ \def\abstractname{要~約}
+ \def\bibname{著書~目錄}% 사전에서
+ \def\appendixname{附錄}% 사전에서
+ \def\KSTHE{第}
+ \def\partname{篇}
+ \def\chaptername{章}
+ \def\sectionname{節}
+ \def\colorlayer{幻燈版~色相}% 사전에서
+ \def\glossaryname{語~彙}% 사전에서
+ \def\proofname{證明}%
+\else
+ \def\today{\number\year 년 \number\month 월 \number\day 일}
+ \def\enclname{동봉물}
+ \def\ccname{사본}%
+ \def\headtoname{받는이:}%
+ \def\seename{\을~참고}%
+ \def\alsoname{\을~함께~참고}%
+ \def\contentsname{차~례}%
+ \def\listfigurename{그림~차례}%
+ \def\listtablename{표~차례}%
+ \def\refname{참고~문헌}%
+ \def\indexname{찾아보기}% 한자는 색~인
+ \def\tablename{표}
+ \def\abstractname{요~약}
+ \def\bibname{참고~문헌}% 사전에서
+ \def\appendixname{부록}% 사전에서
+ \def\KSTHE{제}%
+ \def\partname{편}% 부
+ \def\chaptername{장}%
+ \def\sectionname{절}% 단락 - subsection 소단락
+ \def\colorlayer{환등판~색깔}% 사전에서
+ \def\glossaryname{용어집}% 사전에서
+ \def\proofname{증명}%
+\fi
+\def\pagename{페이지}% 쪽
+\def\figurename{그림}
+
+\@ifclassloaded{book}{%
+ \def\@chapapp#1#2{\KSTHE#1#2#1\chaptername}
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >-2\relax
+ \huge\bfseries \KSTHE\nobreakspace\thepart\ \partname
+ \par
+ \vskip 20\p@
+ \fi
+ \Huge \bfseries #2\par}%
+ \@endpart}
+}{}
+
+\@ifclassloaded{report}{%
+ \def\@chapapp#1#2{\KSTHE#1#2#1\chaptername}
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >-2\relax
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ \markboth{}{}%
+ {\centering
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >-2\relax
+ \huge\bfseries \KSTHE\nobreakspace\thepart\ \partname
+ \par
+ \vskip 20\p@
+ \fi
+ \Huge \bfseries #2\par}%
+ \@endpart}
+
+}{}
+
+\@ifclassloaded{article}{%
+ \def\@part[#1]#2{%
+ \ifnum \c@secnumdepth >\m@ne
+ \refstepcounter{part}%
+ \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
+ \else
+ \addcontentsline{toc}{part}{#1}%
+ \fi
+ {\parindent \z@ \raggedright
+ \interlinepenalty \@M
+ \normalfont
+ \ifnum \c@secnumdepth >\m@ne
+ \Large\bfseries \KSTHE\nobreakspace\thepart\ \partname
+ \par\nobreak
+ \fi
+ \huge \bfseries #2%
+ \markboth{}{}\par}%
+ \nobreak
+ \vskip 3ex
+ \@afterheading}
+}{}
+
+\endinput
diff --git a/language/korean/cjk-ko/kotex.sty b/language/korean/cjk-ko/kotex.sty
new file mode 100644
index 0000000000..d2d4a0f903
--- /dev/null
+++ b/language/korean/cjk-ko/kotex.sty
@@ -0,0 +1,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