summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pmhanguljamo/pmhanguljamo-doc.tex
blob: a727b33fe75c707ff6854fc0bfc90f36205b4889 (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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
\documentclass[a4paper]{article}
\usepackage{fontspec}
%\setmainfont{Noto Serif}
%\setsansfont{Noto Sans}
%\setmonofont{Noto Sans Mono}
\setmainfont{XITS}

\usepackage{hologo}
\newcommand*\XeTeX{\hologo{XeTeX}}
\newcommand*\XeLaTeX{\hologo{XeLaTeX}}
\newcommand*\LuaTeX{\hologo{LuaTeX}}
\newcommand*\LuaLaTeX{\hologo{LuaLaTeX}}

\usepackage{pmhanguljamo}
\usepackage[colorlinks]{hyperref}

\usepackage{polyglossia}
\setotherlanguage{korean}
\newfontfamily\hangulfont{UnBatang.ttf}[Script=Hangul]
%\newcommand*\jamo[1]{\begingroup\hangulfont\jamoword{#1}}
\newcommand*\jamo[1]{\textkorean{\jamoword{#1}}}



\newcommand*\pkg[1]{\textsf{#1}\index{#1}\index{Package!#1}}
\newcommand*\thispkg{\pkg{pmhanguljamo}}
%\maxsecnumdepth{section}

\begin{document}

\title{Poorman's Hangul Jamo Input Method \\ \Large \texttt{pmhanguljamo.sty} }
\author{Kangsoo Kim}
\date{09 Mar 2020\quad version 0.3.3}

\maketitle

\tableofcontents

\section{Introduction}
This \LaTeX\ package provides Hangul\footnote{%
    \emph{Hangul} is the Korean alphabet 
    to write the Korean language. In both South and North Korea,
    the standard writing system uses Hangul.}
\emph{transliteration} input method, which 
allows to typeset Korean Letters (Hangul) with the help of proper fonts.
The name comes from ``Poorman's Hangul Jamo Input Method.'' It is mainly for
the people who have a system without Korean keyboard IM, but want to typeset
Hangul in their document.
Not only modern Hangul, but so-colled ``Old Hangul'' characters
that uses the lost letters such as `Arae-A'(\textkorean{\jmcc{@}}), `Yet Ieung'(\textkorean{\jmcc{Q}}) or `Pan-Sios'(\textkorean{\jmcc{Z}}) etc.\ can also be typeset.

\XeLaTeX\ or \LuaLaTeX\ is required. The legacy pdf\TeX\ is not supported.
The Korean Language supporting packages such as \pkg{xetexko} or \pkg{luatexko} (in the ko.\TeX\ bundle)
or \pkg{polyglossia} under \XeLaTeX\  
are recommended, but without them typesetting Hangul is of no problem
with this package \thispkg.

\section{Usage}

\subsection{Loading the package}

Put the following line in your preamble:
\begin{verbatim}
\usepackage{pmhanguljamo}
\end{verbatim}

The option \texttt{[RRK]} or \texttt{[rrk]}
can be fed, in which case the \emph{Standard Korean Romanization Transliteration}
input method is activated. In section~\ref{sec:rrk},
we will explain about it.
Without option, the default input method of this package is used, that
is explained in sections~\ref{sec:rule}--\ref{sec:exam}.
They are incompatible with each other.

\subsection{Commands and Environment Provided}

The main command to typeset Hangul is \verb|\jamoword|.

\begin{quote}
Input:
\verb|\jamoword{myec dan/e/ga or su iss/svb/ni/da/.}|\\
Result: \textkorean{\jamoword{myec dan/e/ga or su iss/svb/ni/da/.}}
\end{quote}

The argument of the command consists of roman alphabets 
and a few marks that represent the transliteration of Hangul Jamo.
The transliteration rule will be explained in the section~\ref{sec:rule} (page~\pageref{sec:rule}).

And an environment named \emph{jamotext} is provided.
In the environment, multiple paragraphs can be located. So, it is
suitable to typeset longer text stuffs. For example,
\begin{verbatim}
\begin{jamotext}
jug/nvn nar/gga/ji ha/nvr/vr u/re/re \\
han jem bu/ggv/rem ebs/gi/rvr 

ip/sai/ei i/nvn ba/ram/ei/do \\
na/nvn goi/ro/ue/haiss/da/.
\end{jamotext}
\end{verbatim}
The result will be like:
\begin{quote}
\begin{korean}
\begin{jamotext}
jug/nvn nar/gga/ji ha/nvr/vr u/re/re \\
han jem bu/ggv/rem ebs/gi/rvr 

ip/sai/ei i/nvn ba/ram/ei/do \\
na/nvn goi/ro/ue/haiss/da/.
\end{jamotext}
\end{korean}
\end{quote}


\subsection{Preamble of Document}

Without any other packages, you can type Hangul. Be sure that
proper fonts should be declared for Hangul, utilizing \pkg{fontspec}.

\begin{verbatim}
\documentclass{article}
\usepackage{fontspec}
\usepackage{pmhanguljamo}

\begin{document}
\fontspec[Script=Hangul]{UnBatang.ttf}
\jamoword{an/nyex/ha/sei/yo}
\end{document}
\end{verbatim}

\texttt{UnBatang.ttf} is a font shipped in \pkg{unfonts-core} package of \TeX\,Live.
Not all Korean fonts can be available to typeset so-called `Old Hangul',
because they happen to lack
the feature of composing Korean Syllables from conjoining Jamo codes. Fortunately,
we have a few more fonts besides \texttt{UnBatang} that are \emph{proper}
and freely available, which are listed in the section~\ref{sec:font}.
In \TeX\,Live distribution, \texttt{UnBatang} is the only \emph{proper} one.

The \pkg{polyglossia} package provides Korean language support. This package \thispkg\
can be used with it. The following is an example.

\begin{verbatim}
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{korean}
\newfontfamily\hangulfont{UnBatang.ttf}[Script=Hangul]
\usepackage{pmhanguljamo}

\begin{document}
\begin{korean}
\jamoword{han/gvr/vr si/hem/hab/ni/da/.}
\end{korean}
\end{document}
\end{verbatim}

Or the ko.\TeX\ package bundle can be used together.

\begin{verbatim}
\documentclass{article}
\usepackage{kotex}
\usepackage{pmhanguljamo}
\setmainhangulfont{UnBatang.ttf}[Script=Hangul]

\begin{document}
\jamoword{na/ras/mar/ss@/mi}
\end{document}
\end{verbatim}

In any case, the option \verb|[Script=Hangul]| should be given
to the font settings for Hangul. For more information, see section~\ref{sec:font}.

The Korean writing system does not have hyphenation rules.
The line breaking can occur just after almost every syllable. Therefore,
without Korean language supporting packages the line breaking and
justification of paragraphs will not be satisfactory.
However when just single or a few Hangul characters are needed, for example in the case of typesetting
the author's name in Hangul, this package provides a casual way to print them out.


\section{Transliteration Rule}\label{sec:rule}

\subsection{Tone Marks and Syllable Serapator}

This package assumes that every Hangul syllable has Tone Mark which
must be explicitly put at the end of it. Table~\ref{tab:tonemark} 
shows the input scheme of them.

\begin{table}[h]
\centering
\caption{Tone Marks} \label{tab:tonemark}
\begin{tabular}{c|l}
\hline
input & description \\ \hline
\texttt{/} & for \emph{PyeongSeong}, no dot \\ \hline
\texttt{;} & for \emph{GeoSeong}, single dot on the left of a character, [U+302E] \\ \hline
\texttt{:} & for \emph{SangSeong}, double dots on the left of a character, [U+302F] \\ \hline
\end{tabular}
\end{table}

The tone marks were used in the 15th century, but in the modern Korean they are
out of use. Nevertheless the \verb|/| mark in this package is also used in order to depict
the completion of composing a syllable --- i.e., syllable separator. So DO NOT miss it.

However, it is possible to omit `\verb|/|' mark at the end of a word, i.e., just before \texttt{<space>}, or at the end of the argument of \verb|\jamoword|.
Note that before the puctuation mark --- period , comma, etc., omitting \verb|/| is not permitted.

\subsection{Consonants}

Table~\ref{tab:cons} shows the transliteration rule for the consonants which are
used in the leading and trailing position of a syllable.

\begin{table}[h]
\centering
\caption{Consonants} \label{tab:cons}
\fontspec{UnDotum.ttf}
\begin{tabular}{ll|ll|ll|ll}
\hline
ㄱ & g & ㄴ & n & ㄷ & d & ㄹ & r \\
ㅁ & m & ㅂ & b & ㅅ & s & ㅇ & \textbf{x} \\
ㅈ & j & ㅊ & c & ㅋ & k & ㅌ & t \\
ㅍ & p & ㅎ & h & \char"3181 & \textbf{q} & \char"317F & \textbf{z} \\
\char"3186 & \textbf{f} & & w & & & & \\
\hline 
\end{tabular}
\end{table}

\begin{enumerate}
\item The corresponding letters ``g, n, d, m, b, s, j, k, t, p, h'' are 
the same as Korean Romanization Method (RRK).\footnote{The \emph{Revised Romanization of Korean} 1995:2000 is the official Korean language romanization system in South Korea.}
\item The letter for `\textkorean{\jmcc{R}}' is allocated to \texttt{r} not \texttt{l}. The latter is reserved for another purpose, cf. item \ref{itm:llr}.
\item The letter `c' is for `\textkorean{\jmcc{C}}'. In the RRK, it is `\texttt{ch}' there.
\item Note that the letter for `\textkorean{\jmcc{X}}' is \texttt{x}, which is a bit strange, but commonly accepted `\texttt{ng}' was not to be chosen. It should be reserved for `\textkorean{\jamoword{@ng/}}'
\item And the letters `q, z, f' are more freely selected. These letters are the lost ones in Modern Korean.
\item The letter `w' is chosen to present \emph{Choseong Filler}. 
\item\label{itm:llr} The letters `l' and `lr' are 
prepared for very rare case. In the 15th century Korean, `\textkorean{\jamoword{sla}}' and
`\textkorean{\jamoword{slra}}' were distinguishable. `sl' is chosen for the SIOS with left branch being longer, and `slr' means right branch longer. The same is the case `ssl', `sslr', `jl', `jlr' etc.
\item The `light labial consonants', \textkorean{\jmcc{BX}, \jmcc{PX}} in the Old Hangul can be input as `bx, px, bbx, mx'. 
\item In the Modern Korean, only `gg, dd, bb, ss, jj' are additionally permitted in the leading consonant position,
But in the Old Hangul this limitation was not applied. So \emph{Choseong} can have multiple consonants, e.g., `bsg', `bsd', `ss', `sd' etc.
\item The leading `zero consonant' can be omitted. So if a syllable begins with vowel, then the leading `\textkorean{\jmcc{X}}' will appear. You can write the leading `x' of a syllable or not.
For example, `\verb|\jamoword{xax}|' and `\verb|\jamoword{ax}|' will generate the same result `\jamo{xax}'.
\end{enumerate}

\subsection{Vowels}

Table~\ref{tab:vow} shows the transliteration rule for vowels. 

\begin{table}[h]
\centering
\caption{Vowels}\label{tab:vow}
\ttfamily\fontspec{UnDotum.ttf}
\begin{tabular}{ll|ll|ll|ll|ll}
\hline
ㅏ & a & ㅓ & e & ㅗ & o & ㅜ & u & ㅡ & \textbf{v} \\
ㅣ & i & \jmcc{@} & \textbf{@}  & & & & & & \\ \hline
ㅑ & ya & ㅕ & ye & ㅛ & yo & ㅠ & yu & \kern-.3em\jmcc{@}\kern-.6em\jmcc{@} & @@ \\ \hline
ㅐ & ay, ai & ㅔ & ey, ei & ㅚ & oy, oi & ㅟ & uy, ui & ㅢ & vy, vi \\ 
ㅒ & yay, yai & ㅖ & yey, yei & \jmcc{YOI} & yoi & \jmcc{YUI} & yui & \jmcc{@I} & @i \\ \hline
ㅘ & oa & ㅙ & oay, oai & ㅝ & ue & ㅞ & uey, uei & & \\ \hline
\end{tabular}
\end{table}

\begin{enumerate}
\item The rule for vowels may look unfamiliar. But it is simple and easily rememberable.

\item The letter `v' is never considered to be a vowel. But this package 
determined it to stand for the vowel `\textkorean{\jmcc{V}}'. In fact,
the roman alphabets fall short of the vowels. This allocation is arbitrary.

\item The lost `Arae-A' is allocated to `@', and the rare `Double Arae-A' to `@@', which are forgotten vowels in Modern Korean.
\end{enumerate}

\subsection{Compatibility Jamos}

The compatibility Jamo block in Unicode contains several Hangul Jamo characters,
which cannot be used to compose Hangul syllables, and are considered
independent Jamo characters respectively.

To input the compatibility Jamos in the arguments of \verb|\jamoword| or \verb|jamotext|, 
you are to type them in their capital letters (upper cases). And every compatibility Jamo has to be
separated with syllable separator --- \verb|/|. 
Because the \verb|@| character has no upper case, write \verb|W| instead of \verb|@| to display compatibility `Arae-A'.

Here is an example:
\begin{quote}
\begin{verbatim}
\jamoword{W/nvn a/rai/a/ra/go bu/rv/go A/oa bi/svs/ha/gei irg/nvn/da}
\end{verbatim}
\textkorean{\jamoword{W/nvn a/rai/a/ra/go bu/rv/go A/oa bi/svs/ha/gei irg/nvn/da}}
\end{quote}


\section{Proper Fonts}\label{sec:font}

In order to typeset Hangul characters successfully with the input method
of this package, the help of the \emph{proper} font is crucial.
What we call \emph{proper} font is the font that has the Opentype feature of `Script Hangul', that is, the feature of conjoining jamo characters.
A Truetype font may have this Opentype feature.
Otherwise, it is regarded as an \emph{improper} font.

Not so many fonts are \emph{proper}. 
The fonts or font families listed in the following lines are 
what we know \emph{proper}.
They can be downloaded from the url and used freely. And note that
\texttt{UnBatang} is already installed in your \TeX\,Live installation.

\begin{description}
\item[Hamchorom LVT] Hamchorom fonts by Hancom Inc., and their variants with GSUB tables by KTS (the Korean \TeX\ Society).  \url{https://github.com/dohyunkim/hcr-lvt}
\item[KoPub World] free fonts by Korea Publisher Society. \url{http://www.kopus.org/biz/electronic/font.aspx}
\item[Malgun Gothic] One of Windows 10 system font. 
\item[Nanum Yet Hangul] Two font families from Naver. Nanum Myeongjo Yet Hangeul and Nanum Barun Gothic Yet Hangeul. \url{https://hangeul.naver.com/2014/archaicword}
\item[Noto CJK] Google's Noto CJK fonts. Or Adobe's Source Han fonts. \url{https://www.google.com/get/noto/help/cjk/}
\item[Un Batang] \verb|UnBatang.ttf|. on CTAN. \url{https://ctan.org/pkg/unfonts-core}
\end{description}

To use one of these fonts, do not forget to provide
the \texttt{[Script=Hangul]} option.\footnote{%
	If the document is processed with \LuaLaTeX, \texttt{[Script=Hangul,Renderer=Harfbuzz]}
	or \texttt{[Script=Hangul,Renderer=OpenType]} is recommended.
	The \LuaLaTeX\ version should be over 1.11, that is,
	the \LaTeX\ format of LuaHB\TeX\ is needed.}
For example, you can specify
Hamchorom Batang LVT font as:
\begin{verbatim}
\newfontfamily\pmjamofont{HCR Batang LVT}[Script=Hangul]
\end{verbatim}
and then issue \verb|\pmjamofont| command in the scope of Hangul to be typeset.
It is recommended that the \emph{proper} font should be used consistently.

\medskip

In case the font you take is not \emph{proper}, you are to meet the warning
message at the console and log file,
\begin{verbatim}
 Package fontspec Warning: (fontspec)
 Font "batang" does not contain requested Script "Hangul".
\end{verbatim}
However, when \XeLaTeX\ is concerned, it is known that the \emph{Modern} Korean Characters (\emph{Hangul Precomposed Syllables} in the Unicode block [U+AC00] -- [U+D7A3]) can be rendered with this kind of font, in spite of the warning message. 


\section{Examples}\label{sec:exam}

Now, we will show a few practical examples, where
the \emph{korean} environment of \pkg{polyglossia} package is used.
The preamble is like this:

\begin{verbatim}
\usepackage{pmhanguljamo}
\usepackage{polyglossia}
\setotherlanguage{korean}
\newfontfamily\hangulfont{UnBatang.ttf}[Script=Hangul]
\end{verbatim}

\subsection{Modern Hangul}\label{sec:exammodern}

%\begin{verbatim}
%\begin{korean}
%\begin{jamotext}
%e/rin/i/nvn na/ra/oa gye/rey/vi ap/nar/vr i/e/na/gar 
%sai/sa/ram/i/mv/ro gv/dvr/vi mom/goa ma/vm/vr gui/hi 
%ye/gye orh/go a/rvm/dab/go ssig/ssig/ha/gey ja/ra/do/rog 
%him/sse/ya han/da/.
%\end{jamotext}
%\end{korean}
%
%\begin{enumerate}
%\item \textkorean{\jamoword{e/rin/i/nvn in/gan/v/ro/se 
%jon/jux/ha/ye/ya ha/mye sa/hoi/vi han sa/ram/v/ro/se 
%or/ba/rv/gey ki/ue/ya han/da/.}}
%\end{enumerate}
%\end{verbatim}
%
%\begin{quotation}
%\begin{korean}
%\begin{jamotext}
%e/rin/i/nvn na/ra/oa gye/rey/vi ap/nar/vr i/e/na/gar 
%sai/sa/ram/i/mv/ro gv/dvr/vi mom/goa ma/vm/vr gui/hi 
%ye/gye orh/go a/rvm/dab/go ssig/ssig/ha/gey ja/ra/do/rog 
%him/sse/ya han/da/.
%\end{jamotext}
%\end{korean}
%
%\begin{enumerate}
%\item \textkorean{\jamoword{e/rin/i/nvn in/gan/v/ro/se 
%jon/jux/ha/ye/ya ha/mye sa/hoi/vi han sa/ram/v/ro/se 
%or/ba/rv/gey ki/ue/ya han/da/.}}
%\end{enumerate}
%\end{quotation}

\begin{verbatim}
\begin{verse}
\begin{korean}
\begin{jamotext}
na bo/gi/ga yeg/gye/ue \\
ga/sir ddai/ei/nvn \\
mar ebs/i go/i bo/nai dv/ri/u/ri/da/.

yex/byen/ei yag/san \\
jin/dar/rai ggoc \\
a/rvm dda/da ga/sir gir/ei bbu/ri/u/ri/da/.

ga/si/nvn ger/vm ger/vm \\
noh/in gv ggoc/vr \\
sa/bbun/hi jv/rye/barb/go ga/si/ob/so/se

na bo/gi/ga yeg/gye/ue \\
ga/sir ddai/ei/nvn \\
jug/e/do a/ni nun/mur hvr/ri/u/ri/da/.
\end{jamotext}
\end{korean}
\end{verse}
\end{verbatim}

\begin{verse}
\begin{korean}
\begin{jamotext}
na bo/gi/ga yeg/gye/ue \\
ga/sir ddai/ei/nvn \\
mar ebs/i go/i bo/nai dv/ri/u/ri/da/.

yex/byen/ei yag/san \\
jin/dar/rai ggoc \\
a/rvm dda/da ga/sir gir/ei bbu/ri/u/ri/da/.

ga/si/nvn ger/vm ger/vm \\
noh/in gv ggoc/vr \\
sa/bbun/hi jv/rye/barb/go ga/si/ob/so/se

na bo/gi/ga yeg/gye/ue \\
ga/sir ddai/ei/nvn \\
jug/e/do a/ni nun/mur hvr/ri/u/ri/da/.
\end{jamotext}
\end{korean}
\end{verse}

\subsection{pre-1933 Hangul}

A 15th century text with tone marks (\emph{BangJeom}).

\begin{verbatim}
\begin{korean}
\begin{jamotext}
na/ras;mar:ss@/mi; dyuq/guig;ei; dar/a;
mun/jj@x;oa;ro; se/rv s@/m@s/di; a/ni;h@r/ss@i;
i;ren jyen/c@;ro; e/rin; b@ig;syeq;i; 
ni/rv/go;jye; horf; bai; 
i/sye;do; m@/c@m;nai: jey bdv;dvr; si/re; pye/di; 
mod:h@rf no;mi; ha/ni;ra;.
\end{jamotext}
\end{korean}
\end{verbatim}

\begin{quote}
\begin{korean}
\begin{jamotext}
na/ras;mar:ss@/mi; dyuq/guig;ei; dar/a;
mun/jj@x;oa;ro; se/rv s@/m@s/di; a/ni;h@r/ss@i;
i;ren jyen/c@;ro; e/rin; b@ig;syeq;i; ni/rv/go;jye; horf; bai; 
i/sye;do; m@/c@m;nai: jey bdv;dvr; si/re; pye/di; 
mod:h@rf no;mi; ha/ni;ra;.
\end{jamotext}
\end{korean}
\end{quote}

And another example of 17th century, from \jamo{du/si/en/hai}, \emph{Selected Translations of 
Du Fu's Poems}, without tone marks.

\begin{verbatim}
\begin{verse}
\begin{korean}
\begin{jamotext}
g@/r@/mi p@/r@/ni sai de/ug h@i/o/,\\
moy/hi pe/re/h@/ni gos/ bi/ci bvr bvd/n@n d@s/do/da/.\\
ors bo/mi bon/d@in sdo di/na/ga/n@/ni \\
e/nv na/ri i do/ra/gar h@i/o/.
\end{jamotext}
\end{korean}
\end{verse}
\end{verbatim}

\begin{verse}
\begin{korean}
\begin{jamotext}
g@/r@/mi p@/r@/ni sai de/ug h@i/o/,\\
moy/hi pe/re/h@/ni gos/ bi/ci bvr bvd/n@n d@s/do/da/.\\
ors bo/mi bon/d@in sdo di/na/ga/n@/ni \\
e/nv na/ri i do/ra/gar h@i/o/.
\end{jamotext}
\end{korean}
\end{verse}

\let\jamoword\relax
\let\jamotext\relax
\let\endjamotext\relax
\ExplSyntaxOn
\input pmhanguljamo-rrk.sty
\ExplSyntaxOff


\section{The RRK input method} \label{sec:rrk}

In chapter 3 section 8 of \emph{Revised Romanization of Korean} (2000),
the `transliteration method' of Hangul romanization is declared. 
It is exceptionally permitted when it is required to restore
the original Hangul writings, while the phonetic transcription method
is standard.
So we can make use of it as an input method.

If the package option \texttt{[RRK]} or \texttt{[rrk]} is given, 
the RRK method is activated. In this case, only `Modern Hangul' can
be available. 

\subsection{Transliteration Rule of RRK}

Table~\ref{tab:rrkcons} and \ref{tab:rrkvow} show the
RRK transliteration rule.

\begin{table}[h]
\centering
\caption{RRK Consonants} \label{tab:rrkcons}
\fontspec{UnDotum.ttf}
\begin{tabular}{ll|ll|ll|ll|ll|ll}
\hline
ㄱ & g & ㄲ & kk & ㅋ & k & ㄷ & d & ㄸ & tt & ㅌ & t \\
ㅂ & b & ㅃ & pp & ㅍ & p & ㅈ & j & ㅉ & jj & ㅊ & ch \\
ㅅ & s & ㅆ & ss & ㅎ & h & & & & & & \\ \hline
ㄴ & n & ㅁ & m & ㅇ & ng & ㄹ & l & & & & \\ \hline
\end{tabular}
\end{table}

\begin{table}[h]
\centering
\caption{RRK Vowels} \label{tab:rrkvow}
\fontspec{UnDotum.ttf}
\begin{tabular}{ll|ll|ll|ll|ll||ll}
\hline
ㅏ & a & ㅓ & eo & ㅗ & o &  ㅜ & u & ㅡ & eu & ㅣ & i\\ 
ㅐ & ae & ㅔ & e & ㅚ & oe & ㅟ & wi &  & & & \\ \hline
ㅑ & ya & ㅕ & yeo  & ㅛ & yo & ㅠ & yu & ㅒ & yae & ㅖ & ye \\
ㅘ & wa & ㅙ & wae & ㅝ & wo & ㅞ & we & ㅢ & ui & &  \\ \hline
 \end{tabular}
 \end{table}

\begin{enumerate}
\item When the leading consonant `{\fontspec{UnBatang}\jmcc{X}}' is placed
at the head of a word, it can be ommitted. Otherwise the hyphen character (\verb|-|) should be put. For example, \\
\verb|\jamoword{annyeonghase-yo}| \textkorean{\jamoword{annyeonghase-yo}} \\
\verb|\jamoword{jung-ang jungang}| \textkorean{\jamoword{jung-ang jungang}} \\
\verb|\jamoword{ha-yeossseubnida}| \textkorean{\jamoword{ha-yeossseubnida}}

\item The hyphen character \verb|-| can be used to forcibly separate syllables.
And the special character \verb|/| is taken as another syllable separator.
They are exchangeable.\\
\verb|\jamoword{haeb/ssal haeb-ssal}| \textkorean{\jamoword{haeb/ssal haeb-ssal}}

\item The six pucntuation marks, \texttt{.} \texttt{,} \texttt{!} \texttt{?} \texttt{;} \texttt{:} can be located in the Hangul scope.
The others are not allowed.\\
\verb|\jamoword{a! malg-eun haneul, si-wonhan baram.}| \\
\textkorean{\jamoword{a! malg-eun haneul, si-wonhan baram.}}\\
The \LaTeX\ quotes, \verb|``|, \verb|''|, \verb|`| and \verb|'| cannot be used
within Hangul input scope. They should be located outside.
However you can use unicode quotes, \verb|“| and \verb|”|, which can be input
with syllable separator. For example, \\
\verb|\jamoword{“/hangeul/”/ilan hangug-eoleul jeogneun geul-ida.}|\\
\textkorean{\jamoword{“/hangeul/”/ilan hangug-eoleul jeogneun geul-ida.}}\\
In this case, the syllable separator \verb|/| cannot be replaced by hyphen character.

\item The leading consonant `\textkorean{\jmcc{R}}' is written with 
either \texttt{l} or \texttt{r}, while the trailing one should be \texttt{l}.\\
\verb|\jamoword{noraereul nolaeleul}| \textkorean{\jamoword{noraereul nolaeleul}}

\item We made it possible to use `Arae-A' with the RRK method.
Though it is not present in Modern Hangul writing system, typesetting
`Jeju language' or some pre-1933 Korean texts will be made easy with this.
The `Arae-A' is to be input as `\texttt{@}' character, and the `Double Arae-A' `\texttt{@@}'. There is one exception. The one word with one letter that
has only leading `@', i.e., \textkorean{\jamoword{x@}} should be input by `\verb|x@|'. 
If the syllable has trailing consonants or is part of a word, just \verb|@| is
good. \\
\verb|\jamoword{h@ngeul @@nam-eun}| \textkorean{\jamoword{h@ngeul @@d@b}}. 

\end{enumerate}

\subsection{Examples of RRK method}

The text is one of the most famous poem in Korean, \textkorean{\jamoword{jindallaekkoch}} \emph{Azalea} by Kim So-wol.\footnote{%
	An English translation of this poem can be read in Wikipedia, 
	\url{https://en.wikipedia.org/wiki/Kim_Sowol}.}
In section~\ref{sec:exammodern}, we showed default way of inputting 
the poem. The \textit{korean} environment and font settings are 
the same as in section~\ref{sec:exam}.

\begin{verbatim}
\begin{verse}
\begin{korean}
\begin{jamotext}
na bogiga yeoggyeo-wo \\
gasil ttae-eneun \\
mal eobs-i go-i bonae deuli-ulida.

yeongbyeon-e yagsan \\
jindallae kkoch \\
aleum ttada gasil gil-e ppuli-ulida.

gasineun geol-eum geol-eum \\
noh-in geu kkoch-eul \\
sappunhi jeulyeobalbgo gasi-obsoseo

na bogiga yeoggyeo-wo \\
gasil ttae-eneun \\
jug-eodo ani nunmul heulli-ulida.
\end{jamotext}
\end{korean}
\end{verse}
\end{verbatim}

\begin{verse}
\begin{korean}
\begin{jamotext}
na bogiga yeoggyeo-wo \\
gasil ttae-eneun \\
mal eobs-i go-i bonae deuli-ulida.

yeongbyeon-e yagsan \\
jindallae kkoch \\
aleum ttada gasil gil-e ppuli-ulida.

gasineun geol-eum geol-eum \\
noh-in geu kkoch-eul \\
sappunhi jeulyeobalbgo gasi-obsoseo

na bogiga yeoggyeo-wo \\
gasil ttae-eneun \\
jug-eodo ani nunmul heulli-ulida.
\end{jamotext}
\end{korean}
\end{verse}

\section{Further Information}


For more examples and information about this package, 
please read the documentation 
\href{http://mirrors.ctan.org/language/korean/pmhanguljamo/doc/pmhanguljamo-kdoc.pdf}{\texttt{pmhanguljamo-kdoc.pdf}}
(in Korean).


\section{Acknowledgement}

Thanks go to yihoze at the KTUG board, there he commented, 
``The IMs I've tried such as Korean Windows Old Hangul IM or Saenaru IM 
were all somewhat inconvenient. \ldots\ 
In my opinion, for the foreign scholar who
studies Korean language, especially Middle Age Korean language, 
this kind of transliteration method may be much more convenient and
confident way of typesetting Korean than the IM solutions.''\footnote{\url{http://www.ktug.org/xe/index.php?mid=KTUG_open_board&document_srl=240134}}

\end{document}