Adding support for ideographic languages is quite tricky. However, once you are done with it, it will work quite well. Other than installing packages, there is some extra configuration work to do.
Your Linux® distribution might already have a CJK (Chinese, Japanese, Korean) package ready for you, so you might be saved the hassle of manually installing everything. Do check before going forward!
There is the possibility of using the ucs package in order to write short snippets of CJK text, but that option is seriously limited as it does not handle, among other things, newlines. Instead, we will install the complete CJK-LATEX package and make it work for both LATEX and PDFLATEX. A lot of this material has been inspired by Pai H. Chou's page about how to setup PDFLATEX.
Download the CJK package. Copy its unpacked files to an appropriate subfolder of $
TEXMF, just like you did with the ucs package before (see The ucs Package). The files will be unpacked in a
CJK/X_Y.Zfolder; it is not important that you take them out, though it will probably be tidier and easier for you to maintain.
Now you have to download a font that supports all the CJK characters you need. You can choose any
*.ttffile that covers them, but in this walkthrough we will use Cyberbit. Unzip the file and rename
cyberbit.ttf, since uppercase might confuse your system.
cyberbit.ttfin a folder together with
Unicode.sfd, and generate the
*.encfiles with the command
$ ttf2tfm cyberbit.ttf -w cyberbit@Unicode@. For some reasons, sometimes this does not produce the hundreds of files it should. Should that be your case, you can download both
*.tfmfiles in an appropriate folder, say
*.encfiles may be installed in
Now we need a map file to connect the
*.encfiles to the font. Download
cyberbit.mapand install it in
Download another file,
c70cyberbit.fd, and place it in an appropriate folder. You may choose, for example,
The last file we have to generate is a PostScript® Type 1 font, necessary to read DVI files generated with LATEX. Run the command
$ ttf2pfb cyberbit.ttf -o cyberbit.pfb, and copy the resulting
cyberbit.pfbin a folder like
Let's now place
cyberbit.ttfamong the fonts where LATEX can find it. You could place it in a folder named
Check the configuration file you find at
$, and make sure that the line mentioning
TTFONTSis uncommented and points to the folder where you saved
To make it possible for PDFLATEX to use your CJK fonts, it is necessary that you add a line in configuration file
map +cyberbit.mapin the file to complete the configuration for PDFLATEX.
To configure LATEX so that you can produce DVI files with CJK characters, you have to add a line in file
ttfonts.map. The file might be in a folder named
$, but you will probably have to look for it. Append the line
cyberbit@Unicode@ cyberbit.ttfto it.
Now, you only have to run
texhashand the system should be ready.
To test whether your configuration is correct, you can try to compile this test file.
There are many things that can go wrong when setting CJK support manually. If something seems not to work, the following checklist might help you.
Obviously, since you run LATEX as a user and not as root, you must allow ordinary users to access the new files. Make sure all folders and files are accessible using the chmod command.
If LATEX writes a DVI without problems, but you cannot view it, it is almost certainly because of some problems in the automatic generation of
*.pkfonts. They are supposed to be generated on the fly when viewing a DVI file, but this might fail for a number of reasons: double-check
ttfonts.mapfor your custom line first. However, it might happen that your ttf2pk command, which is usually invoked by the DVI viewer, has been compiled without support for the kpathsea libraries. If this is the case,
ttf2pkwill make no mention of kpathsea. As support for these libraries is necessary, you might have to find a new package, or recompile FreeType 1 by yourself.
There are a number of different input engines, and the choice can
depend also on personal preference. The author uses Skim,
a port to KDE of the Scim
engine. Refer to your distribution's documentation to learn how to
install these programs. Configuration of such programs can be tricky
too, in the case of Skim you will have to
define an environment variable
before starting X.