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.
Update: Obsolete since Dec 5 2012.
Problem solved.
As yhmath.ins
didn't generate any .map
file, I previously created yhmath.map
with Wordpad, which proved to be a mistake: I only obtained a .txt
file named yhmath.map
.
So I pasted a file .map
whatever into \localtexmf\fonts\map\dvips\yhmath
,
changed it with Wordpad, saved it being careful not to change its format, and renamed as yhmath.map
. Then I ran initexmf --mkmaps
, and kpsewhich
could find yhmath.map
.
Still MikTex couldn't find yrcmex10.tfm
.
I eventually discovered that running initexmf --edit-config-file updmap
edited updmap.cfg
located in \AppData\Roaming\MikTex\2.9\miktx\config\
directory, while I actually wanted to edit the homonym file in \Program Files\MikTex 2.9\miktex\config\
. So I copied the file in \AppData\[...]
and pasted to \Program Files\[...]
.
Ran initexmf --mkmaps
again. Ran testfont.tex
and found the font yrcmex10.tfm
was avaliable to MikTex.
There is still a minor issue. Creating a .ps
or a .dvi
with Texniccenter works fine. A .pdf
will contain some wrong characters, due to the fact that the embodied font yhcmex10.tfm
is not avaliable to extract.
Here is a Minimal Working Example
\documentclass{report}
\usepackage{yhmath}
\begin{document}
$\wideparen{ab} \widetriangle{ab} \widering{ab}$
\end{document}
Image added by Speravir
Best Answer
Update: The following is obsolete. The missing file
OMXyhex.fd
was added on MiKTeX update from Dec 5 2012.Actually I must confess, that “yhmath” works with some issues (see MikTeX 2.9 can not find font yrcmex10 of yhmath package). I also noticed, that on CTAN there are two
yhmath.zip
! The OP downloaded the other compared to me (link see below), and this is the one used in MiKTeX. So the problem seems to be a bug inyhmath
!I let stand the following for reference reasons.
I would consider the missing font file
OMXyhex.fd
and the missing whole bunch of MetaFont files as a bug. It should be filed in theMiKTeX bug tracker.All other files are installed in a full MiKTeX installation. You can get them with the Package Manager. Compared with my TeX Live installation in MiKTeX the type1 file is called
yhcmex.pfa
, in TeX Live it isyhcmex.pfb
, but these are only variants, cf. https://en.wikipedia.org/wiki/PostScript_fonts.If you downloaded the source files in the ZIP file (link: http://mirror.ctan.org/macros/latex/contrib/yhmath.zip), you must extract first into a temporary folder and then execute
tex yhmath.ins
on the command line:which creates amongst some auxiliary files the font files, optionally followed by
latex yhmath.dtx
, which creates the documentation.You could temporarily Create a local texmf tree in MiKTeX and put the virtual font file
OMXyhex.fd
into the folder<localtexmf>\tex\latex\yhmath
. The MetaFont files with extension.mf
belong into<localtexmf>\source\latex\yhmath\
.For further action see MikTeX 2.9 can not find font yrcmex10 of yhmath package.