# Old Korean han'gŭl in XeLaTeX?

Does anybody know if it's possible to typeset old han'gŭl (Korean alphabet) in XeLaTeX?

I'm referring to these letters: http://en.wikipedia.org/wiki/Old_Hangul

It is not possible to type outright on a Mac, but these characters are included in Unicode:

http://en.wikipedia.org/wiki/Hangul_Jamo_(Unicode_block)

I cannot copy and paste the unicode straight into the document, since every syllabic han'gŭl block consists of 2-3 Unicode characters. Usually, the input editor does that assemblage for us, but the Mac input editor doesn't support syllabic blocks containing old han'gŭl.

Minimal working example:

\documentclass[utf8,12pt,letterpaper]{article}

\usepackage{setspace}
\usepackage[fallback]{xeCJK}

\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}

\setmainfont{\mainfont}
\setCJKmainfont{\mainfontCJK}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt

\title{}
\author{}
\date{}
\begin{document}
\maketitle

ᆰᆀ

ᆱᅥ %Consonant + vowel combinations copied from http://en.wikipedia.org/wiki/Hangul_Jamo_(Unicode_block)

\end{document}


• can you provide a MWE, please? – Micha May 7 '13 at 20:09
• Sorry, it's added now. – Mårten May 7 '13 at 20:21
• Sorry, I don't quite understand the question since I don't know any Korean at all. What's your expected result? Maybe it is a question about your "input method" on Mac, and let it be on TeX. – Leo Liu May 9 '13 at 5:30
• My question is whether there is a way to combine those two unicode characters into one han'gŭl character on Mac. I know that TeX can help me write other languages (such as Manchu using montex), for which there is no native support in Mac OS. I was wondering if there is a similar package for typesetting old Korean, that's all. – Mårten May 9 '13 at 14:23
• @Mårten: I don't know what is your expected result. When you type ᆰ and ᆀ, you don't want two individual chracters but a combined one? Right or not? Which character do you want to get? I cannot understand it well simply because I don't know Korean. But I'm pleased to help. – Leo Liu May 10 '13 at 2:21

If I didn't misunderstand it, what you need is the “Conjoining Jamo Behavior” described in the Unicode document, or especially the “Hangul Syllable Composition”.

One possible way to do this, is to create a TECkit map file and use it.

1. You may need to write a script program to produce a .map like this (tex-text.map):

; TECkit mapping for TeX input conventions <-> Unicode characters

LHSName "TeX-text"
RHSName "UNICODE"

pass(Unicode)

; ligatures from Knuth's original CMR fonts
U+002D U+002D           <>  U+2013  ; -- -> en dash
U+002D U+002D U+002D    <>  U+2014  ; --- -> em dash

U+0027          <>  U+2019  ; ' -> right single quote
U+0027 U+0027   <>  U+201D  ; '' -> right double quote
U+0022           >  U+201D  ; " -> right double quote

U+0060          <>  U+2018  ;  -> left single quote
U+0060 U+0060   <>  U+201C  ;  -> left double quote

U+0021 U+0060   <>  U+00A1  ; ! -> inverted exclam
U+003F U+0060   <>  U+00BF  ; ? -> inverted question

; additions supported in T1 encoding
U+002C U+002C   <>  U+201E  ; ,, -> DOUBLE LOW-9 QUOTATION MARK
U+003C U+003C   <>  U+00AB  ; << -> LEFT POINTING GUILLEMET
U+003E U+003E   <>  U+00BB  ; >> -> RIGHT POINTING GUILLEMET

teckit_compile Jamo.map -o Jamo.tec

\setCJKmainfont[Mapping=Jamo]{Some Font}

• @Mårten: You can certainly define mappings from Unicode sequence to Unicode sequence. For example U+0061 U+0061 > U+6C49 U+5B57 maps aa to 汉字`. The TECkit software have detailed manual for the mapping language and a few examples. – Leo Liu May 11 '13 at 4:00