jump to navigation

考试了…… December 30, 2005

Posted by Chen Yufei in personal.
4 comments

元旦放三天,放完就开始期末考试,10号就可以考完了。呵呵,又可以回家了!这一段时间会比较紧张,不会有时间写blog了。以前用Linux中遇到的好 多问题想写下来,准备放了寒假开始把有价值的都写下来:有关Emacs的几个有用的扩展(不知道是不是应该这么叫),Linux和Windows的比较 (一直都想好好考虑一下),LaTeX的中文相关问题(24号那天考西方美术史,用LaTeX准备材料,遇到的LaTeX的中文相关问题终于都搞定了: -))。

寒假准备试试看LAMP(Linux+Apache+MySQL+PHP),家里台机和笔记本正好可以建局域网作实验。已经借了一本入门的书,准备先把他 们安装起来,学着用用,Linux和Apache已经装好了(用rpm装还是没有什么难度的),也算是为下学期的网络和数据库课程作准备吧。寒假重点在看 “Linux Programming in Example—the fundamentals”,学一下Linux编程里面最基本的东西。本来想看一下操作系统,但是假期里面看那种理论化、实践性不强的东西会很无聊(今年 暑假为了应付免修考试看Tanenbaum那本《计 算机网络》(操作系统不知道会不会用他的书),不知道怎么看完的。开始和最后还比较有意思,但从数据链路层开始到传输层真是……),所以还是打算放弃了, 希望通过看那本书了解系统调用会对下学期的操作系统有所帮助。同时还想看一下Qt的编程,不过这是次要的,还是想先把底层的东西学好。C++只能暂时放一 下了,模板暂时不会用到,以后再说吧。

今天就还是先放松一下吧,从明天开始的三天要努力复习了,为明年的奖学金努力!呵呵……

Advertisements

LaTeX and CJK, how to use the TrueType fonts December 26, 2005

Posted by Chen Yufei in LaTeX.
3 comments

First I should tell you that I am using SUSE Linux 10 and teTeX 3.0 which comes from the SUSE Linux CD set, and I am not sure whether the steps I discribed below works for other TeX distribution. You may change something to get things work correct.

  1. Get the TrueType fonts.(May be you have done this.) This shouldn’t be difficult. You can find some free TT fonts on CTAN. One thing should be noticed is that if you want to get Unicode support, you should get the Cyberbit.ttf(it’s free, more details about Unicode and CJK, click here, I didn’t use it since it’s a little troublesome, when needed I use iconv to convert).
  2. Download gbkfonts.(Other versions, see here, thanks to the authors) I think it should also be able to work on other TT fonts other than Chinese TT fonts. I didn’t test it. If it doesn’t work on other TT fonts like Korean, Japanese TT fonts, you may have to use ttf2afm and some other programs. Read the pdfTeX manual for details.
  3. Uncompress gbkfonts you just downloaded. Copy the file “go“, “gbkfonts-glibc” to /usr/local/bin, change the file name “gbkfonts-glibc” to “gbkfonts“. Edit the script go, find these lines like “gbkfonts ${opts[*]} $dir/FZSongTi.ttf song“, change it to the fonts name you want use. Then “cd /usr/local/share/texmf”(if you run the program in your locale texmf directory, you need to move less files later), type “go yourfonts directory“(need to have the write right in this directory), wait… and the program will create the afm, tfm, type1, enc files and some other configuration files for divpdfm, pdftex and dvips.
  4. Some articles talking about using CJK and TrueType fonts stops here. Of course you need “mktexlsr”, but things just don’t work on my system. You can now make some test, if things don’t work, read on. Below are additional steps I did on my system to get things work. I had a look at my texmf.cfg(in TEXMF/web2c, you may need to change the variable TEXMF to let TeX search local TEXMF first) and check out some path on my TeX system. Then first create the map files directory: “mkdir /usr/local/texmf/fonts/map/{dvips,dvipdfm,pdftex}”(using bash), mv all the map files gbkfonts created to the corresponding direcrory. Then create the enc files directory “mkdir /usr/local/texmf/fonts/enc/dvips“, mv the directory which contains enc files in the directory “dvips” just created here. You should keep the directory structure and TeX will search these directories recursively.
  5. If you use “updmap” to mantain the font map information, I suggest you just add one line in updmap.cfg(also in TEXMF/web2c) “Map cjk.map“. Run “mktexlsr”(If you don’t run this, updmap will not find the map file you just created) and then “updmap” to update the font map information. You can have a look at cjk.map, it contains a lot of lines ending with *.pfb, so this is in fact using Type1 fonts gbkfonts just created.(In Type1 directory. I am not quite sure about which font is actually used since the *.pfb files is created from TT fonts.) dvipdfm, dvips and pdftex all supports Type1 fonts, this works well. You should be able to get things works correctly now. Make some test?
  6. But there is still some problem. I use dvipdfmx to create pdf files which can be searched even it contains CJK fonts, but it should be configured to use TT fonts directly. The problem with updmap is that it updates font map information for the three program at the same time using the same map files 😦 That’s not what I wanted, but I am not able to modify the script now so I use the stupid method—add font map manully. “cd /var/lib/texmf/fonts/map”, keep dvipdfm untouched. “cd to dvips/updmap“, append cjk.map to psfonts_t1.map.(the file which symbolic link psfonts.map points to) Then “cd pdftex/updmap”, append all the map files in the directory pdftex which was created by gbkfonts to pdftex.map.(this is also a symbolic link, you can directly edit the file it points to) For dvipdfm(x), you just need to mv cid.map and some other map files created by gbkfonts to /usr/local/share/texmf/fonts/map/dvipdfm. Then dvipdfm(x) and pdftex will both use TT fonts directly, while dvips uses Type1 fonts. That’s all.

So many words… I do think these artiles stops at step 3 are right, and I don’t need to write so many words. I don’t know why 😦 After running gbkfonts we get the map files and the configuration files, if pdftex and dvips read these configuration files, then we can just stop at step 3. But I didn’t find pdftex.cfg in /usr/share/texmf/pdftex/config, in fact there is no such directory at all! So I wonder whether pdftex read the configuration file.(This seems not likely to happen, but the brutal fact makes me think so) There is the file config.ps in /usr/share/texmf/dvips/config, but it also seems that dvips also didn’t read it because unless I manully add cjk.map to psfonts_t1.map it won’t wok, though I have added “p +cjk.map” in config.ps. But it’s strange thar dvipdfm(x) read the configuration files since I keep it’s font map files in /var/lib… untouched. I will ask for help about this problem later. It is very likely that it is because I made some mistakes. If you know, please tell me, I do appreciate!

无聊的平安夜 December 24, 2005

Posted by Chen Yufei in personal.
2 comments

又到圣诞节了,还是一个人过……

今天下午CET-6考试 ,本来高中语文老师今天来南京,我们可以去看她,结果就这样冲掉了;而且明天可以本来可以去市里看“无极”,但是考完太晚,不高兴去阿姨家了,只好放弃,唉……但愿考的不错,要不太亏了……

晚上上网,难得上了一次QQ,跟好几个同学聊过。11点以后delmmx上线了,跟他聊了很久,他说了不少让我感动的话,呵呵,圣诞夜终于有了点感觉了,谢谢他了!

Hello world! December 24, 2005

Posted by Chen Yufei in Uncategorized.
8 comments

Wow, This seems really good!

And “Hello world!”– almost always the first program I wrote in any programing language, really nice because it makes me feels very familiar. Below is some chinese. I want see if I can write post in Chinese. Since this site uses UTF-8 coding, there should no problem:)

哈哈,老外就看不懂这些了,虽然用的是人家的东西。后悔当时给blog起名字是为什么没有用自己的名字,不过用中文以后可能会有麻烦吧。我从 2005年10月开始使用SUSE Linux10,对Linux很感兴趣,大概会抛弃WinXX了,除非以后工作之类的非用不可。很喜欢这个这个Blog网站,老外做东西就是不一样。唉, 什么时候我们中国人能作出这样的东西来就好了。