[Tex/LaTex] MiKTeX 2.9 CJK Korean font not found error

cjkfontsmiktex

After a day of trying to use Korean fonts in my LaTeX file, I ask this forum for some helpful insight.

I'm using MiKTeX 2.9 (just upgraded a few days ago from 2.7). So far, I have been able to use English latex with no problems. I used the MiKTeX Package Manager (Admin) and installed cjk, cjk-fonts, cjkpunct and miktex-cjkutils-bin-2.9 I used the Options (Admin) to Refresh FNDB and to Update Formats. I have read the CJK documentation file at http://www.inf.ed.ac.uk/systems/tex/CJK/CJK.txt and have searched the web for helpful examples. As far as I can tell, I have the correct installation and use. However, I can not obtain output.

I have done two things.

1) The following error is obtained from the miminmal latex source file: the Korean was entered via keyboard via the vim editor (I also used notepad).

Running miktex-makemf.exe...
miktex-makemf: The kmj source file could not be found
Running hbf2gf.exe

Couldn't find 'kmg.cfg'
miktex-maketfm: No creation rule for font kmj15

! Font C61/mj/m/n/10/15=kmg15 at 10.0pt not loadable: Metric (TFM) file not found
\documentclass{article}
\usepackage{CJK}
\begin{document}
The following should be in Korean
\begin{CJK}{KS}{}
안녕하세요
\end{CJK}
The previous should be in Korean
\end{document}

2) I changed the following \begin{CJK}{UTF8}{}
and changed vim's encoding to utf-8 via the :set encoding=utf-8 command. I received a different error. I have a clean compile to dvi. However, dvips complains about missing fonts (also yap tries to build these missing fonts).

Trying to make PK font cyberbc5 at 600 DPI...
Running miktex-makemf.exe...
miktex-makemf: The cyberbc source file could not be found

Best Answer

The key to the problem is that, when you use CJK package, you must specify the input encoding and the CJK font family, either using CJK environment or using \CJKencoding, \CJKfamily commands; and you must make sure that you have installed the fonts. (CJK fonts are not always fully installed.)

The different TeX distributions have different CJK fonts installed.

In MiKTeX (as you use), cjk-fonts package myoungjo Type1 fonts but there seems no .tfm files and LaTeX font definition (.fd) files to support these files. I can't make any working example without modifying the files, sorry.

In TeX Live, with UTF-8 encoding and uhc font package installed, there is only mj font family available for Korean. (While gbsn, gbsn for Chinese and bsmi, bkai for Japanese.)

Here is an example using UTF8 input encoding (differernt from KS as you used):

% UTF-8 encoding, compile with pdflatex / latex+dvips / latex+dvipdfmx, TeX Live 2012
\documentclass{article}
\usepackage{CJK}
\begin{document}
The following should be in Korean
\begin{CJK}{UTF8}{mj}
안녕하세요
\end{CJK}
The previous should be in Korean
\end{document}

If you use KS input encoding (standard KS X 1001:1992, KS C 5601-1992, see document CJK.txt), there are more fonts available, but you may have to install the hlatex-fonts package manually. It is an advanced topic for most users, I won't explain too much here.

There are few English documents about CJK package and other package supporing CJK scripts, but you may access the TeX groups/forums/sites in China, Japan or Korea to get more information.

I am a Chinese, thus I know very little about native Korean font support in LaTeX. Maybe you can search about HLaTeX. And I know the Korean TeX User Group (KTUG) has their own modified TeX Live distribution with much more Korean fonts pre-installed, and there is HLaTeX. (We Chinese do this too.) You may think about installing these TeX distributions.


As an alternative, you may consider using XeLaTeX with our xeCJK package. An example:

% UTF-8 encoding, compile with xelatex, TeX Live 2012
\documentclass{article}
\usepackage[space]{xeCJK} % space option is useful for Korean
\setCJKmainfont{Batang}   % a Windows font
\begin{document}
The following should be in Korean
안녕하세요
The previous should be in Korean
\end{document}

Note: xeCJK is originally designed for Chinese, but also support Japanese and Korean (we hope it will be better). There is indeed a native Korean XeTeX package xetexko, available on KTUG, but I know nothing about it.