红联Linux门户
Linux帮助
当前位置: 红联Linux门户 > Ubuntu

ubuntu8.04下texlive2008安装及中文环境配置

发布时间:2008-10-11 16:28:38来源:红联作者:Mwany
安装texlive2008的步骤如下:
1.到http://www.tug.org/texlive/acquire.html 中查看texlive2008的相关说明以及注意事项,做到了然于胸。

2.从http://ctan.org/tex-archive/CTAN.sites选择一个连接速度最快的地址下载texlive2008,我选择的为香港的那个源ftp://ftp.comp.hkbu.edu.hk/pub/TeX/CTAN/systems/texlive/Images/,1M多的速度,够快的,连同校验文件一起下下来,最好选择这两个(texlive2008.iso.lzma,texlive2008.iso.lzma.md5),前面两个校验错误,都不知咋整的

校验命令:md5sum -c texlive2008.iso.lzma.md5
然后解压:lzma -dv < texlive2008.iso.lzma > texlive2008.iso

对硬盘空间可是个大的考验1.2G的东西解压后有2.5G,这也看出lzma的压缩效率之高,呵呵,以后就用它了,不过这是有代价的,那个速度之慢啊, 对一个人的耐心也是极大的考验。

挂载iso文件,现在建立/media/texlive目录,然后命令:sudo mount -t iso9660 -o loop /media/texlive ./texlive2008.iso,这样就会发现/media/texlive目录下有了一些东西,进入这个目录,./install-tl安装,我输入V选项从iso启动,然后输入I完成安装。

接下来是设置一些环境变量
export PATH=/media/textlive/bin/i386-linux:$PATH
export MANPATH=/media/textlive/texmf/doc/man:$MANPATH
export INFOPATH=/media/textlive/texmf/doc/info:$INFOPATH
export TEXMFCNF=/usr/local/texlive/2008/texmf-var/web2c

这些可以参考一下texlive-zh-cn.pdf的文档,也有英文版的,g一下就可以得到了。

使用下列命令试试玩吧:
tex --version
latex sample2e.tex
xdvi sample2e.dvi
dvips sample2e.dvi -o sample2e.ps
pdflatex sample2e.tex
evince sample2e.pdf

到这一步已经可以使用英文的texlive了,当然对我们中国人来说就是配置中文环境了。

网上有参考:[code]make a dir called font, copy the font here.
mkdir ~/font
cd ~/font
cp /media/sda/windows/Fonts/simhei.ttf .

copy all the file needed.
sudo apt-get install fontforge
cp /media/textlive/texmf-dist/source/latex/cjk/utils/subfonts/* ~/font/
cp /media/textlive/texmf/fonts/sfd/*.sfd ~/font/
注意上面路径适合我的电脑,你可以进入texlive目录find一下确定具体的合适路径。
---If you are sure your computer is fast enough, please read Stage 2 first!!

Then, make the font. It is a good way to test how fast your computer is:) it
takes me 3 minutes to generate the fonts[Core Duo 2].
time fontforge -script subfonts.pe simhei.ttf hei Unicode.sfd

create a file name makemap like this:
[
for i in *.tfm
do
cat >> hei.map << EOF
${i%.tfm} ${i%.tfm} < ${i%.tfm}.pfb
EOF
done
]

Make map file:
chmod +x makemap
./makemap

create a file name c70hei.fd for CJK package:
[
% This is c70hei.fd for CJK package.
% created by Edward G.J. Lee
% modify by Yue Wang
\ProvidesFile{c70hei.fd}
\DeclareFontFamily{C70}{hei}{\hyphenchar \font\m@ne}
\DeclareFontShape{C70}{hei}{m}{n}{<-> CJK * hei}{}
\DeclareFontShape{C70}{hei}{bx}{n}{<-> CJKb * hei}{\CJKbold}
\endinput
]


create the local directory to save the font
cd ~/.texlive2007
cd texmf-var
mkdir -p fonts/map/dvips/CJK
mkdir -p fonts/tfm/CJK/hei
mkdir -p fonts/type1/CJK/hei
mkdir -p tex/latex/CJK/UTF8
cp ~/font/hei.map fonts/map/dvips/CJK/
cp ~/font/*.tfm fonts/tfm/CJK/hei
cp ~/font/*.pfb fonts/type1/CJK/hei
cp ~/font/c70hei.fd tex/latex/CJK/UTF8

Update the system:
texhash
updmap --enable Map hei.map[/code]
文章评论

共有 0 条评论