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


\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

-
Make a complete (but small) example which can be used for tests. Keep it as simple as possible: At best try to use only one font / symbol. –  Ulrike Fischer Aug 25 '12 at 9:42
I noticed that my example in my original posting was typeset poorly and the eols are not shown (I've tried copying it here again but same-same). –  Brian Aug 26 '12 at 6:36
Welcome to tex.sx! It's not necessary to sign your questions (as there is already a box with your username below it) or to begin them with a greeting. –  Leo Liu Aug 27 '12 at 11:49
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces or enclose words in backticks , they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). –  Leo Liu Aug 27 '12 at 11:49

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.

-
Thank you to all :) your comments have been extremely helpful. I have been a longtime user of latex and adhere to the 'if it ain't broke don't fix it" adage, to wit: I'm a latex, dvips, ps2pdf guy. Recently, I need to write more documentation in Korean; hence motivating my interest. I now realize that latex has moved forward considerably and your discussions and pointers to other links on this forum have helped me understand more about the recent capabilities. For the moment, the xeCJK package addresses my immediate needs (it seems that my windows does not have the necessary fonts loaded/con –  Brian Aug 28 '12 at 0:31
@Brian: Yes, XeTeX is quite easy to use and I myself hope that CJK users will all use solutions based on modern XeTeX or LuaTeX. BTW, if you find the answers useful, you may upvote and accept them. –  Leo Liu Aug 29 '12 at 14:25
Just a little head-up, I've struggle my mind for few hours trying to figure out why nothing were happening as I followed every steps installing xetex and trying to compile the minimum requirement file as shown above (using xelatex command). In my following thread you will find more information about xeCJK: tex.stackexchange.com/questions/98762/… (see the answer) –  Oddant Feb 19 '13 at 12:28

To mark code select it and then click on the icon with the two braces. Or simply add four spaces before each line. But if - like in your case - the encoding matters it is better to put the test file in a zip-folder and somewhere for download as copy & paste can easily change the encoding.

I don't know much about cjk-fonts (you should read answers of Leo Liu for more insights http://tex.stackexchange.com/users/2674/leo-liu) but this here works for me when I compile with pdflatex (the file is utf8 encoded):

\documentclass{article}
\pdfmapline{+cyberb@Unicode@  <cyberbit.ttf}

\usepackage{CJK}
\begin{document} The following should be in Korean
\begin{CJK}{UTF8}{} 안녕하세요 \end{CJK}
\end{document}


You must have cyberbit.ttf (in my case it is installed in my standard windows fonts folder).

-
Well, it is not a good idea to leave the font family argument empty (braces after {UTF8}) and define the fallback font family. And strictly, cyberbit font is not very well designed (at least for Chinese characters). Anyway, it works. –  Leo Liu Aug 27 '12 at 11:56
@LeoLiu You are certainly right that it is better not to leave the font family argument empty. But as it is allowed it should imho work (if the intended fallback font exists on the system). So why is the map-line not added to pdftex.map when cjk is installed? –  Ulrike Fischer Aug 27 '12 at 12:19
I've no idea. One possible reason is that the Bitstream Cyberbit Unicode font is not pre-installed in most OS or TeX systems. Most users cannot use the example using cyberbit fallback font either. And pdfTeX didn't support TTF fonts directly until quite racent versions, before that only DVIPDFMx (using cid-x.map) support this font. IMHO the mapping files and font packages about CJK fonts are rather old and confusing. I hope XeLaTeX and LuaLaTeX can replace old CJK` package. –  Leo Liu Aug 27 '12 at 12:48