LinuxSir.Org  
| 网站首页 | 注册账号 | 论坛帮助 |

欢迎来到LinuxSir.Org!
您还未登录,请登录后查看论坛,或者点击论坛上方的注册链接注册新账号。


发表新主题 回复
精华主题  
主题工具
旧 03-12-18, 18:23 第 1 帖
terminator
 
 
 
注册会员  
  注册日期: Dec 2003
  帖子: 515
  精华: 6
 

标题: Slackware teTeX + Chinese mini-HOWTO


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/homepag.../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

此帖于 04-02-23 11:29 被 windrose 编辑.
  terminator 当前离线   回复时引用此帖
旧 03-12-19, 21:38 第 2 帖
gnwd
 
gnwd 的头像
 
 
注册会员  
  注册日期: Sep 2003
  帖子: 264
  精华: 1
 

###################################################
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.

此帖于 03-12-19 21:46 被 gnwd 编辑.
  gnwd 当前离线   回复时引用此帖
旧 03-12-19, 23:25 第 3 帖
lang2
 
 
 
注册会员  
  注册日期: May 2003
  帖子: 95
  精华: 0
 

TeXLive CD has CJK support built-in since release 7.
Simply enable it when doing setup.







__________________
Vim 中文文档
http://vimcdoc.sf.net
http://vcd.gro.clinux.org.cn
  lang2 当前离线   回复时引用此帖
旧 03-12-20, 04:48 第 4 帖
terminator
 
 
 
注册会员  
  注册日期: Dec 2003
  帖子: 515
  精华: 6
 

> 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. This mini-HOWTO is just one of my test of TeX.







__________________
Proud Slacker since Slackware 3.4
  terminator 当前离线   回复时引用此帖
旧 03-12-20, 04:51 第 5 帖
terminator
 
 
 
注册会员  
  注册日期: Dec 2003
  帖子: 515
  精华: 6
 

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.
  terminator 当前离线   回复时引用此帖
旧 03-12-22, 16:49 第 6 帖
gnwd
 
gnwd 的头像
 
 
注册会员  
  注册日期: Sep 2003
  帖子: 264
  精华: 1
 

引用:
最初由 terminator 发表
[/b]
> 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.

[/b]
no, gbkfonts will yield c19song.fd for you. but you still need change it to support CJKbold.
  gnwd 当前离线   回复时引用此帖
旧 04-01-29, 23:14 第 7 帖
windrose
 
windrose 的头像
 
 
★☆★督导☆★☆  
  注册日期: Oct 2002
  帖子: 6,296
  精华: 38
 

按上述办法试了一下,但是在/usr/share/texmf-local/中没有发现bin目录,需要自己建立吗?要cp哪些东西进去呢?







__________________
Free as in freedom, slack as in Slackware.
欢迎访问 http://slack.linuxsir.org
个人blog:http://blog.tuxfans.com/
RSS:http://feeds.feedburner.com/windroseblog
  windrose 当前离线   回复时引用此帖
旧 04-01-30, 06:47 第 8 帖
terminator
 
 
 
注册会员  
  注册日期: Dec 2003
  帖子: 515
  精华: 6
 

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.
  terminator 当前离线   回复时引用此帖
旧 04-01-30, 15:13 第 9 帖
windrose
 
windrose 的头像
 
 
★☆★督导☆★☆  
  注册日期: Oct 2002
  帖子: 6,296
  精华: 38
 

我的体会:gbkfonts似乎不需要ttf2pk,我下载源码之后make clean && make就能生成可执行的gbkfonts了。但是gbkfonts只能在它的源码目录中运行,在别的目录下指明gbkfonts的路径或者直接cp到其他目录下,运行会出错。运行gbkfonts之后,只要按gnwd的方法做就可以了。

此帖于 04-01-31 08:42 被 windrose 编辑.
  windrose 当前离线   回复时引用此帖
旧 04-01-31, 05:13 第 10 帖
terminator
 
 
 
注册会员  
  注册日期: Dec 2003
  帖子: 515
  精华: 6
 

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.
  terminator 当前离线   回复时引用此帖
旧 04-01-31, 05:14 第 11 帖
terminator
 
 
 
注册会员  
  注册日期: Dec 2003
  帖子: 515
  精华: 6
 

for the execution error of gbkfonts, I guess you build it with dynamic linking against freefont1. if you build it statically, there's no problem that you execute it anywhere.
  terminator 当前离线   回复时引用此帖
旧 04-01-31, 18:28 第 12 帖
Zodlaic
 
 
 
注册会员  
  注册日期: Jan 2004
  帖子: 13
  精华: 0
 

Where can I download dvipdfmx soure ?
  Zodlaic 当前离线   回复时引用此帖
旧 04-01-31, 18:28 第 13 帖
Zodlaic
 
 
 
注册会员  
  注册日期: Jan 2004
  帖子: 13
  精华: 0
 

Where can I download dvipdfmx soure ?
  Zodlaic 当前离线   回复时引用此帖
旧 04-01-31, 21:44 第 14 帖
windrose
 
windrose 的头像
 
 
★☆★督导☆★☆  
  注册日期: Oct 2002
  帖子: 6,296
  精华: 38
 

引用:
最初由 Zodlaic 发表
Where can I download dvipdfmx soure ?
http://project.ktug.or.kr/dvipdfmx/

next time, google before you ask
  windrose 当前离线   回复时引用此帖
旧 04-02-23, 13:34 第 15 帖
windrose
 
windrose 的头像
 
 
★☆★督导☆★☆  
  注册日期: Oct 2002
  帖子: 6,296
  精华: 38
 

标题: dvipdfmx的安装


前提:按前面terminator的方法安装并设置好CJK

一、下载及安装
下载地址:
http://project.ktug.or.kr/dvipdfmx/snapshot/release/
从中下载当前版本dvipdfmx-20031116.tar.gz。
不建议从 http://project.ktug.or.kr/dvipdfmx/snapshot/current/ 下载最新版(当前是dvipdfmx-20031207.tar.gz),因为其中可能有bug,导致产生pdf文件时有一堆Warnings提示。

下载到的是源代码,需要解开后自行编译。需要注意的是运行configure前要设置两个环境变量:
export CPPFLAGS=-I/usr/share/texmf/include LDFLAGS=-L/usr/share/texmf/lib

configure时也要指定参数:
./configure --bindir=/usr/share/texmf/bin --datadir=/usr/share
make
su -c 'make install' (或 su -c checkinstall,假如你安装了checkinstall)

二、安装后的设置
按上述方法安装之后,dvipdfmx中没有对中文的支持,需要进行适当的设置。

1. 完善CMap目录
dvipdfmx安装时,会在/usr/share/texmf/dvipdfm中建立CMap目录,但其中没有中文的CMap。由于CMap是Acrobat制定的标准,具有通用性,因此可以下载Acrobat的文件。一个简单的方法是借用xpdf中文包中的CMap文件:
ftp://ftp.foolabs.com/pub/xpdf/xpdf-...plified.tar.gz
解压缩后,将其CMap目录下的所有文件cp到 /usr/share/texmf/dvipdfm/CMap/ 即可。

2.设置ttf字体目录
在/usr/share/texmf/web2c/texmf.cnf中,指定了从$TEXMF/fonts/truetype目录中查找truetype字体,因此需要:
mkdir /usr/share/texmf/fonts/truetype
然后把几种中文字体cp或ln到这个目录中,也可以直接修改上述texmf.cnf文件,指定truetype字体的路径。

3.建立ttf2pk目录

mkdir /usr/share/texmf/ttf2pk

ttf2pk是freetype 1中提供的一个工具,使得TeX可以使用truetype字体。
下载: ftp://ftp.freetype.org/freetype/free...contrib.tar.gz
也可以从freetype的其他镜像下载这个文件,解开文件后,我们需要的是 ttf2pk/data/中的文件:
cp ttf2pk/data/* /usr/share/texmf/ttf2pk/

3.修改dvipdfmx.cfg文件
用文本编辑器打开 /usr/share/texmf/dvipdfm/dvipdfmx.cfg,找到一行:
f dvipdfm.map
在它前面加个%注释掉,使之不起作用。

4.运行texhash使系统能找到我们新增的所有文件。

至此,dvipdfmx设置完毕。
  windrose 当前离线   回复时引用此帖
发表新主题 回复


主题工具

发帖规则
您 [不可以] 发表新主题
您 [不可以] 回复主题
您 [不可以] 上传附件
您 [不可以] 编辑您的帖子

已 [启用] BB 代码
已 [启用] 表情符号
已 [启用] IMG 代码
已 [禁用] HTML 代码
[论坛跳转…]


所有时间均为[北京时间]。现在的时间是 12:37


Powered by vBulletin 版本 3.6.8
版权所有 ©2000 - 2010, Jelsoft Enterprises Ltd.
官方中文技术支持: vBulletin 中文
版权所有 ©2002 - 2009, LinuxSir.Org