歡迎您光臨本站 註冊首頁

ubuntu8.04下texlive2008安裝及中文環境配置

←手機掃碼閱讀     火星人 @ 2014-03-26 , reply:0

安裝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


[火星人 ] ubuntu8.04下texlive2008安裝及中文環境配置已經有405次圍觀

http://coctec.com/docs/linux/show-post-176513.html