[texhax] Typing Chinese with plain TeX
Rodolfo Medina
romeomedina at libero.it
Sun Sep 5 15:54:57 CEST 2004
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Tang wrote:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
"Rodolfo Medina" <romeomedina at libero.it> writes:
> Hi, Tang:
>
> great! Now I can correctly visualise chinese characters in files.
> I followed the first procedure you suggested.
> First I checked the presence of the font name 'fangsong ti' with the command
>
> $xfontsel
>
> . Then I said
>
> emacs .emacs
>
> and added the lines you suggested at number 1) of your message.
> Then I closed Emacs, reopened it with the file math1gb.tex and...
> voil\`a! The chinese characters finally appeared.
> Besides, I can easily switch from chinese to english input method and vice
> versa just tiping 'C-\'.
> Fantastic!
Congratulation!
>
> Now I'm asking you two more things:
> 1) how is it possible to display chinese characters in emails, like you do,
> and in the same format you use,
> which I find very nice
> (though I send and receive e-mail using Windows and not Linux,
> because I didn't manage to configure Internet connection with Linux);
I use Gnus as my mail client. Since your Emacs handle chinese well now,
then gnus also can display chinese. Please get the last release
from Gnus homepage
http://www.gnus.org
The Gnus FAQ is a step by step turorial. you should read it
carefully.
http://my.gnus.org/FAQ/
After you have finished Gnus installation, add this line in your
.gnus.el file:
(setq gnus-default-charset 'cn-gb-2312
gnus-newsgroup-ignored-charsets '(unknown-8bit x-unknown
iso-8859-1))
in order to handle chinese characters.
I use mule-gbk(http://mule-gbk.sourceforge.net) to deal with
chinese, which is a bigger charset than cn-gb-2312. But I think
gb2312 charset is enough for you.
You can also install the *simsun.ttf*, which is a vector type
font and have more pretty visual effect. Just change the font
name 'Fangsong ti' to 'simsun'. 'Fangsong ti' is a
bitmap font. so can't be zoomed in and out arbitrarily.
You even can specify different fonts for ascii characters and
chinese characters:
Edit the .emacs:
(create-fontset-from-fontset-spec
"-*-courier new-normal-r-*-*-14-*-*-*-c-*-fontset-chinese,
chinese-gb2312:-*-fangsong
ti-medium-r-*--16-*-*-*-*-*-gb2312.1980-0" t)
(setq default-frame-alist
(append
'((font . "fontset-chinese"))
default-frame-alist))
---------------------------------------------------------------------------
OR
Edit you ~/.Xdefaults
---------------------------------------------------------------------------
Emacs.Font: fontset-chinese
Emacs.Fontset-0:-*-courier new-normal-r-*-*-14-*-*-*-c-*-fontset-chinese,\
chinese-gb2312:-*-fangsong ti-medium-r-*--16-*-*-*-*-*-gb2312.1980-0
--------------------------------------------------------------------------
$xrdb ~/.Xdefaults
restart Emacs.
This setting let emacs handle ascii characters with 'courier
new' and handle chinese characters with 'fangsong ti'.
> 2) how can I do a surprise to my sister and type in Chinese the message
> 'Welcome back home, Carolina!'
> that I can show her next week?
>
'h' 'u' 'a' 'n' '1'
'y' 'i' 'n' 'g' '5'
'n' 'i' '1'
'h' 'u' 'i' '2'
'j' 'i' 'a' '1'
','
'Carolina!'
You will get "欢迎你回家, Carolian!"。:)
> Thanks again for your precious help,
> Rodolfo
>
>
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> TeX newsgroup: http://groups.google.com/groups?group=comp.text.tex
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
>
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
More information about the texhax
mailing list