How to install CJK packages with UTF8 encoding on Fedora 8

It is assumed that Tex system had been installed on your computer.

1. Files needed
cjk-4.7.0.tar.gz, downloaded from http://cjk.ffii.org/
Unicode.sfd, unzipped from Unicode.zip which is downloaded from http://delloye.free.fr/Unicode.sfd
Cyberbit.zip, a kind of TrueType font, downloading Cyberbit.ZIP directly.
2. fontforge should be installed, if not, please run this command

$su -c "yum install fontforge"

3.unzip the cjk-4.7.0.tar.gz to the local latex folder, generally which locates in /usr/share/texmf/tex/latex, change the folder's name from cjk-4.7.0 to cjk. (please switch to super user)

4. unzip Cyberbit.zip, and change its name as cyberbit.ttf, copy it into the tex font folder of Truetype fonts, locating in /usr/share/texmf/fonts/truetype, Unicode.sfd also should be copied here.

5.copy cjk/utils/subfonts/subfonts.pe to the cyberbit.ttf directory, and use fontforge to get the tfm, afm and pfb fonts.

fontforge -script subfonts.pe cyberbit.ttf cyberb Unicode.sfd

It spent me more than an hour, so you can make a cup of coffee.

6. make a file, named makemap, to generate the font configuration file:

for i in *.tfm
do
cat >> cyberbps.map << EOF
${i%.tfm} ${i%.tfm} < ${i%.tfm}.pfb
EOF
done

then change its executability using chmod +x makemap
and execute ./makemap to generate the map file.

7.copy the tfm, afm, pfb fonts to suitable folders.


#mv *.pfb /usr/share/texmf/fonts/type1/truetype/cyberb
#mv *.afm /usr/share/texmf/fonts/afm/truetype/cyberb
#mv *.tfm /usr/share/texmf/fonts/tfm/truetype/cyberb
#mv *.enc /usr/share/texmf/fonts/enc/truetype/cyberb
#mv cyberbps.map /usr/share/texmf/fonts/map/dvips/truetype
#mv cyberb.map /usr/share/texmf/fonts/map/truetype

8. make a file, named cid-x.map, put it in /usr/share/texmf/fonts/map/dvipdfm, which content is

cyberb@Unicode@ Identity-H :0:cyberbit.ttf

9. edit the file, c70song.fd, change the word of cyberbit to cyberb.

10. edit the file, updmap.cfg, located in /usr/share/texmf/web2c, adding the lines to the end of the file


# Add by myself
Map cyberb.map

11. add the line
f cyberb.map
to the end of the file named config, located in /usr/share/texmf/dvipdfm/config.

12, add the line to the file named config.ps, located in /usr/share/texmf/dvips/config
p +cyberbps.map
13. update the tex system, using

#mktexlsr
#updmap

14. try this file,whatever you name it, you could see the Chinese characters.


\documentclass{article}
\usepackage{CJK}
\begin{document}
\begin{CJK}{UTF8}{song}
你好!久违的中文,终于见到你了!
\end{CJK}
\end{document}

using this commands:


pdflatex test.tex

Appendix

teTeX3 requires elegant fold structure, in /usr/local/share/texmf/


fonts/cmap/UTF8-UCS2
fonts/enc/truetype/cyberb/cyberb??.enc
fonts/map/dvips/truetype/cyberbps.map
fonts/map/truetype/cyberb.map
fonts/sfd/Unicode.sfd
fonts/tfm/truetype/cyberb/cyberb??.tfm
fonts/truetype/Cyberbit.ttf
fonts/type1/truetype/cyberb/cyberb??.pfb
tex/latex/CJK/UTF8/c70cyberb.fd

References
1. CJK-LaTeX-UTF8. http://ymei.freeshell.org/WebWiki/Computer/CJK-LaTeX-UTF8.html
2. Fedora上配置Tex UTF-8 中文系统. http://unix-cd.com/vc/www/15/2007-10/8909.html
3. How to make LaTeX (teTeX) handle unicode and CJK in MacOSX. http://www.ece.uci.edu/~chou/unicode-tex.html

(If you cannot see these words, please let me know. Feel free to contact me.)

   Send article as PDF   

2 Replies to “How to install CJK packages with UTF8 encoding on Fedora 8”

  1. Could you explain how to generate cyberb.map? Below is my guess. Thanks for your time

    for i in *.enc
    do
    cat >> cyberb.map <<EOF
    $(i%.enc) < $(i%.enc) <Cyberbit.ttf
    EOF
    done

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.