8

Does anybody know if it's possible to typeset old han'gŭ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'gŭ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'gŭl.

Minimal working example:

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

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

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

\newcommand{\mainfont}[0]{Times New Roman}\newcommand{\mainfontCJK}[0]{Gulim}
\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}

enter image description here

5
  • can you provide a MWE, please?
    – Micha
    Commented May 7, 2013 at 20:09
  • 1
    Sorry, it's added now.
    – Mårten
    Commented May 7, 2013 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
    Commented May 9, 2013 at 5:30
  • My question is whether there is a way to combine those two unicode characters into one han'gŭ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
    Commented May 9, 2013 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
    Commented May 10, 2013 at 2:21

2 Answers 2

3

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
    
  2. Download TECkit and run

    teckit_compile Jamo.map -o Jamo.tec
    
  3. Then you can use

    \setCJKmainfont[Mapping=Jamo]{Some Font}
    

This is only a draft. I am not familar with Korean, so I can't give you a proper final result. Sorry.

3
  • Yes! That is exactly what I need. I looked in the document under the advised section, and since the syllable blocks/conjoint jamo are not unicode characters in their own right, I don't understand how to enter that information into the font map, which only replaces two unicode characters with a third unicode character.
    – Mårten
    Commented May 10, 2013 at 15:48
  • Also, do you know where I can find more info on how to write these font maps? For example, I don't always want to say Unicode 1 + Unicode 2 = Unicode 3, but Unicode 1 + any given character 2 = Unicode 3 + any given character 2?
    – Mårten
    Commented May 10, 2013 at 16:10
  • @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
    Commented May 11, 2013 at 4:00
2

Writing Old Hangul on macOS

This part is not related to TeX or LaTeX itself, but I will provide this information for the completeness of this answer.

The default input method editor (IME) on macOS does not support old Korean letters. To input them, you have to download 'gureum IME (구름 입력기)', which is a third-party IME. You can download it on https://gureum.io/ (all guides are written in Korean).

After you installed it, then go to System Preferences → Keyboards and add 두벌식 옛글 for your input source. Pressing cmd + space will switch between old Hangul and other languages.

Typesetting Old Hangul on XeLaTeX

To typeset Korean language properly, you have to use the kotex package. Also, you have to use the special Korean fonts which can render old Hangul properly. Some examples are 'Noto Serif CJK KR' and 'Noto Sans CJK KR', which is open source and also readily available on Overleaf.

To set up the Hangul font, you should use \setmainhangulfont, \setsanshangulfont, and \setmonohangulfont. The syntax is the same as fontspec's \setmainfont, \setsansfont and \setmonofont, but only affects the Hangul letters. You also have to give Script=Hangul options to enable the Hangul fonts to render old Hangul properly.

The following is an example.

\documentclass{article}
\usepackage{kotex}
\setmainhangulfont[Script=Hangul]{Noto Serif CJK KR}
\begin{document}
\section{Old Hangul Test (옛한글 테스트)}
나랏말ᄊᆞ미 듀ᇰ귁에 달아 문ᄍᆞᆼ와로 서르 ᄉᆞᄆᆞᆺ디 아니ᄒᆞᆯᄊᆡ
\end{document}

old hangul test

Alternative Method: pmhanguljamo

If you have problem installing IME, you can use the pmhanguljamo package (available on CTAN) with fontspec package. This package defines \jamoword command and jamotext environment to parse latin characters and convert them into old Hangul letters. Using this package, you do not have to set up IME (but font setups are still required, but follow the guide on the package documentation).

You can obtain the same result above by using the following code:

\documentclass{article}
\usepackage{fontspec}
\usepackage[pmfont={Noto Serif CJK KR}]{pmhanguljamo}
\section{Old Hangul Test (\jamoword{yeis/han/gvr tei/sv/tv})}
\begin{jamotext}
na/ras/mar/ss@/mi dyuf/guig/ei dar/a mun/jj@q/oa/ro se/rv s@/m@s/di a/ni/h@r/ss@i
\end{jamotext}
\end{document}

Further Information

For more information, refer to Korean TeX Users Group (KTUG). You can find lots of information about typesetting modern/old Hangul and writing Korean documents.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .