Skip to content

Using hangulmath

Load the package

\usepackage{hangulmath}
...
$\giyeok + \nieun = \digeut$      % official names
$\giug + \niun = \diud$           % the same, with aliases

Every symbol works in math mode and in running text. The symbols are ordinary math symbols: they take sub- and superscripts, scale correctly in script styles, and are always set upright.

$\giug_{\ah}(x)$, $\niun^{\ih j}$, $X\giug x\niun$

The 40 symbols

Consonants show the official name first and the four-letter alias below it.

Consonants (14)

ㄱ\giyeok\giug
ㄴ\nieun\niun
ㄷ\digeut\diud
ㄹ\rieul\liul
ㅁ\mieum\mium
ㅂ\bieup\biub
ㅅ\siot\sius
ㅇ\ieung\iung
ㅈ\jieut\jiuj
ㅊ\chieut\ciuc
ㅋ\kieuk\kiuk
ㅌ\tieut\tiut
ㅍ\pieup\piup
ㅎ\hieut\hiuh

Double consonants (5)

ㄲ\ssanggiyeok\ggiug
ㄸ\ssangdigeut\ddiud
ㅃ\ssangbieup\bbiub
ㅆ\ssangsiot\ssius
ㅉ\ssangjieut\jjiuj

Vowels (10)

ㅏ\ah
ㅑ\yah
ㅓ\eoh
ㅕ\yeoh
ㅗ\oh
ㅛ\yoh
ㅜ\uh
ㅠ\yuh
ㅡ\euh
ㅣ\ih

Compound vowels (11)

ㅐ\aeh
ㅒ\yaeh
ㅔ\eh
ㅖ\yeh
ㅘ\uah
ㅙ\uaeh
ㅚ\oeh
ㅝ\ueoh
ㅞ\ueh
ㅟ\uih
ㅢ\euih

How the names work

  • Official names follow the Revised Romanization of Korean: \giyeok, \nieun, …, \ssanggiyeok.
  • Consonant aliases have four letters: the consonant, iu, and the consonant again, echoing the Korean letter names (기역 → \giug, 니은 → \niun). Their first letters are all different, so the first letter alone identifies the consonant. ㅇ has no initial sound and is \iung; ㅊ is \ciuc; ㄹ uses l, its sound at the end of a syllable.
  • Double consonants double the first letter of the alias: \ggiug, \ddiud, \bbiub, \ssius, \jjiuj.
  • Vowels are written as pronounced, followed by h: \ah, \eoh, \ih. The h avoids clashes with existing commands such as \a, \o, \u and \i. In compound vowels the glide w is written u (\uah for ㅘ), and ㅢ is \euih to tell it apart from ㅟ, \uih.
  • \hangulsym{<name>} reaches any symbol by its official name or alias, even if another package has taken the command.

Operators

The symbol commands give ordinary symbols. To use a symbol as an operator, wrap it in one of these commands. They accept any math symbol, not only Hangul.

Command Behaviour
\hangulsum{<sym>} Large; in display style, limits below and above, like \sum
\hangulint{<sym>} Large; limits at the side, like \int
\hangullim{<sym>} Normal size; in display style, limits below, like \lim
\hangulopscale{<display>}{<text>} Magnification of the large forms (default 2.0 and 1.3)
\[ \hangulsum\tiut_{k=1}^{n} k^2 = \frac{n(n+1)(2n+1)}{6} \]
\[ \hangulint\diud_{x=0}^{x=1} f(x) = a \qquad \hangullim\liul_{x\to\infty} f(x) = b \]

The large forms use a lighter font, so magnification does not make their strokes heavier than those of \sum and \int.

Package options

\usepackage[sidebearing=0.04]{hangulmath}
Option Meaning
font=<font> Font for the symbols, by name or file. Default: the bundled hangulmath-sans.otf
opfont=<font> Font for the large operator forms. Default: the bundled, lighter hangulmath-sans-light.otf
metrics=<file> Metrics file (without .def) describing the glyphs of font. Default: hangulmath-metrics
scale=<number> Scale factor for the symbol font. Default: from the metrics file (about 1.24)
sidebearing=<em> Space added to the left and right of each glyph. Default: 0.06

If a requested font is not installed, hangulmath warns and falls back to the bundled font, so documents always compile.

With kotex

hangulmath works with kotex (xetexko or luatexko) in either package order, and the symbols keep the bundled symbol font. kotex already uses \rieul, so hangulmath leaves that name to kotex: write ㄹ as \liul or \hangulsym{rieul}.

Using another font

Korean fonts draw these letters small and high in the em square, so hangulmath scales, lowers and trims each glyph using a metrics file. To use another font, generate one with the bundled Python script (Python 3.10+, pip install fonttools):

python3 hangulmath-metrics.py "Nanum Gothic" -o nanum.def
\usepackage[font={Nanum Gothic}, metrics=nanum]{hangulmath}

\hangulmathfont{<font>} and \hangulmathopfont{<font>} change the fonts later in the preamble.

Things to watch

  • Look-alikes. ㅡ (\euh) resembles a minus sign and ㅣ (\ih) a vertical bar. Say in the text which letter you mean.
  • Engines. pdfLaTeX is not supported. Check that your publisher or preprint server compiles with XeLaTeX or LuaLaTeX before submitting.
  • Searchable PDFs. The symbols are real Unicode characters, so readers can copy and search them.

The full manual, with many more examples, is hangulmath-doc.pdf.