While each of your issues can be addressed in detail, I think the easiest solution for you now is to use XeLaTeX. You can then access any Japanese fonts installed on your operating system.
A minimal example:
\documentclass{memoir}
\usepackage{xeCJK}
\setCJKmainfont{Hiragino Mincho Pro}
\setmainfont{Baskerville}
\usepackage[japanese]{babel}
\renewcommand\chaptername{第}
\addtodef{\afterchapternum}{章}{} % Rather an ugly hack
\begin{document}
\tableofcontents
\chapter{手引}
おはようございます!
\begin{figure}[hbt!]
\centering\Large よろしくお願いします。
\caption{はーい}
\end{figure}
\begin{table}[hbt!]
\centering
\begin{tabular}{c c}
\hline
one & 一\\
two & 二\\
\hline
\end{tabular}
\caption{あれ。}
\end{table}
\section{文章}
何これ?
\end{document}
Remember to process the above code with xelatex
, not pdflatex
.
I was pleasantly surprised to find that there's a japanese
localisation file for babel
, and it works with XeLaTeX! So you'll get "目次" instead of "Contents" for the ToC heading, etc. You will have to install the japanese
package. (Available on TeXLive and hence MacTeX, but not bundled with MikTeX.) However the chapter labels ("Chapter 1") aren't localised, so we'll have to change that ourselves. It takes two commands to do it, since we need the ordinal prefix before the chapter number, and the chapter name after it.
If you prefer to set the localisation strings manually (or if you have problems with \usepackage[japanese]{babel}
:
\renewcommand\contentsname{目次}
\renewcommand\figurename{図}
\renewcommand\tablename{表}
...
See section 18.20 (Words and Phrases) in the memoir
manual, where there is a list of strings that you can localise by \renewcommanding them.
Alternatively, there is the ptex
platform, which is optimised for Japanese typesetting, but I've never tried it out.
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.
Best Answer
CJKutf8
package is a part ofCJK
bundle, it is designed for documents in UTF-8 encoding only, and it actually loadsCJK
package internally.The main aim of
CJKutf8
package is, to useutf8
option ininputenc
package together withCJK
package. That is to say,CJKutf8
patches originalCJK
package to make it work well withinputenc
. And it loadsinputenc
package withutf8
option internally.Most users do not need to know the technical details. But you can use
CJKutf8
to typeset French, German and Chinese in one document easily. That's it.