LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 5621|回复: 18

Slackware teTeX + Chinese mini-HOWTO

[复制链接]
发表于 2003-12-18 18:23:30 | 显示全部楼层 |阅读模式
This is a quick solution to setup CJK for Slackware Linux 9/-current.

(1) Install tetex package

(2) Prepare localized directory tree
    # mkdir -p /usr/share/texmf-local/tex/latex/

(3) Download latest CJK, e.g., 4.5.2 from the following link:
    ftp://ftp.ffii.org/pub/cjk/

    Uncompress the CJK package, then:
    # mv cjk-4.5.2/texinput/ /usr/share/texmf-local/tex/latex/CJK

(4) Build tools:
    gbkfonts, it requires header file from freetype 1.x
        http://learn.tsinghua.edu.cn/homepage/2001315450/programs.html
    ttf2pk, it is included in contrib/ of freetype 1.x, build it
statically since your system may have freetype2 installed!

(5) Build fonts from TTF fonts:
    # cd /usr/share/texmf-local/
    # gbkfonts /usr/X11R6/lib/X11/fonts/TTF/simsun.ttc song
    # gbkfonts /usr/X11R6/lib/X11/fonts/TTF/simhei.ttc hei
    # gbkfonts /usr/X11R6/lib/X11/fonts/TTF/simkai.ttc kai
    # gbkfonts /usr/X11R6/lib/X11/fonts/TTF/simfang.ttc fs
    # gbkfonts /usr/X11R6/lib/X11/fonts/TTF/fzwbjw.ttc fzweibeis
    # gbkfonts /usr/X11R6/lib/X11/fonts/TTF/fzwbfw.ttc fzweibeit

    Move generated file in the current directory
(/usr/share/texmf-local) to correct location:
    # mv cid-x.map dvipdfm/config/
    # mv cjk.map dvips/config/
    # cp ../texmf/dvips/config/config.ps dvips/config/
    # echo "p +cjk.map" >> dvips/config/config.ps
    # mv pdftex.cfg pdftex/config/

(6) Clean up:
    # cd tex/latex/CJK/
    # rm -rf JIS/ KS/ SJIS/ thai/ CEF/

    # /usr/share/texmf/bin/mktexlsr

(7) Change permissions:
    # chown -R root:root /usr/share/texmf-local/

(8) Add /usr/local/texmf-local/bin in $PATH:
    # vi /etc/profile.d/tetex.csh /etc/profile.d/tetex.sh
发表于 2003-12-19 21:38:05 | 显示全部楼层
###################################################
Move generated file in the current directory
(/usr/share/texmf-local) to correct location:
# mv cid-x.map dvipdfm/config/
# mv cjk.map dvips/config/
# cp ../texmf/dvips/config/config.ps dvips/config/
# echo "p +cjk.map" >> dvips/config/config.ps
# mv pdftex.cfg pdftex/config/
#############################################
1.only "cp cjk.map and updmap --enable Map `pwd`/cjk.map " needed.
all tools will use the type1 fonts by default. other files would be used if you want to support truetype font.
2. cp -r tex /usr/share/texmf-local/   (don't forgot)
3. if needed, you should modify the *.fd files in /usr/share/texmf-local/tex/latex/...(sorry, i forgot it), you can take the pre-existed files in cjk package for example to support Bold in chinese.


may we exchange some ideas about TeX with each other.
发表于 2003-12-19 23:25:33 | 显示全部楼层
TeXLive CD has CJK support built-in since release 7.
Simply enable it when doing setup.
 楼主| 发表于 2003-12-20 04:48:10 | 显示全部楼层
> 1.only "cp cjk.map and updmap --enable Map `pwd`/cjk.map " needed.
> all tools will use the type1 fonts by default. other files would be used if you > want to support truetype font.

haven't tried this. gbkfonts generated lots of fonts of afm, tfm, and type1. Frankly speaking, I do not know too much of the fonts.

> 2. cp -r tex /usr/share/texmf-local/ (don't forgot)

not necessary. See my original post, in fact I run the gbkfonts in /usr/share/texmf-local.

> 3. if needed, you should modify the *.fd files in /usr/share/texmf-local/tex/latex/...(sorry, i forgot it), you can take the pre-existed files in cjk package for example to support Bold in chinese.

Not necessary, these are automatically generated by gbkfonts.

> may we exchange some ideas about TeX with each other.

welcome, but do not expect too much from me 'coz I know little about TeX. :p  This mini-HOWTO is just one of my test of TeX.
 楼主| 发表于 2003-12-20 04:51:19 | 显示全部楼层
BTW, this solutions does not change anything in the main texmf directory. All the new files and changes are in /usr/local/texmf-local. So it's safe to tar the texmf-loca directory and copy to other machines directly.
发表于 2003-12-22 16:49:27 | 显示全部楼层
最初由 terminator 发表

> 3. if needed, you should modify the *.fd files in /usr/share/texmf-local/tex/latex/...(sorry, i forgot it), you can take the pre-existed files in cjk package for example to support Bold in chinese.

Not necessary, these are automatically generated by gbkfonts.


no, gbkfonts will yield  c19song.fd for you. but you still need change it to support CJKbold.
发表于 2004-1-29 23:14:31 | 显示全部楼层
按上述办法试了一下,但是在/usr/share/texmf-local/中没有发现bin目录,需要自己建立吗?要cp哪些东西进去呢?
 楼主| 发表于 2004-1-30 06:47:19 | 显示全部楼层
yes, you need to create the bin directory by yourself, just copy the gbkfonts and ttf2pk binaries into bin. you can copy them to /usr/local/bin as well. they are only required for building gbkfonts from truetype fonts.
发表于 2004-1-30 15:13:41 | 显示全部楼层
我的体会:gbkfonts似乎不需要ttf2pk,我下载源码之后make clean && make就能生成可执行的gbkfonts了。但是gbkfonts只能在它的源码目录中运行,在别的目录下指明gbkfonts的路径或者直接cp到其他目录下,运行会出错。运行gbkfonts之后,只要按gnwd的方法做就可以了。
 楼主| 发表于 2004-1-31 05:13:32 | 显示全部楼层
you are right, ttf2pk is not required for gbkfonts. I built it because somebody mentioned it can be used for latex to use truetype font directly, but I have not tried it.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表