已经有人整理了:参见http://wenziyan.anyp.cn/ipqm.aspx
下面这个是显示国旗的:
Hello, I am LI Daobing(first name is family name). You can talk with me in English or Chinese.
% -*- TeX-PDF-mode:t -*-
\documentclass[english,a4paper]{article}
\usepackage{a4wide}
\usepackage[T1]{fontenc}
\usepackage{ucs}
\usepackage[utf8]{inputenc}
\usepackage{autofe}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{indentfirst}
\usepackage{times}
\usepackage{mathptm}
\usepackage{color}
\definecolor{webred}{rgb}{0.3,0,0}
\definecolor{webblue}{rgb}{0,0,0.7}
\definecolor{webgreen}{rgb}{0,0.4,0}
\usepackage[bookmarksnumbered=true,
colorlinks=true,
linkcolor=webred,
citecolor=webblue,
anchorcolor=webgreen,
urlcolor=webblue
]{hyperref}
\usepackage{thumbpdf}
\usepackage{amsmath}
\begin{document}
\title{Title}
\author{Li Daobing}
\maketitle
\begin{verbatim}
Source version: $Id$
\end{verbatim}
\tableofcontents
\end{document}
我准备把我的Linux平台的编码从zh_CN.GB2312改为zh_CN.UTF-8,希望能够一切 顺利。
我的系统是Debian/Linux, sid, 2.6。
# .xinitrc
source $HOME/.bash_profile
LANG=zh_CN.UTF-8
LC_MESSAGES=en_US
LC_TIME=en_US
export LANG LC_MESSAGES LC_TIME
export GDK_USE_XFT=1
export GTK_IM_MODULE='scim'
export XMODIFIERS="@im=SCIM"
scim -d
xscreensaver -no-splash &
esd &
icewmbg &
icewmtray &
exec icewm
convmv -f gb2312 -t utf8 -r --notest *
-r表示包含所有子目录 不加--notest就表示只看看有什么需要转换的,不做实际转换
C-x <return> f utf-8 <return> C-x C-s搞定。
:set fenc=utf8
:w
只需加如下两句
(setq current-language-environment "Chinese-GB")
(prefer-coding-system 'utf-8)
这时你用
C-h v coding-category-list
可以看到coding-category-list等于
(coding-category-utf-8
coding-category-iso-8-2 coding-category-big5 coding-category-iso-7-else
coding-category-iso-8-1 coding-category-utf-16-be
coding-category-utf-16-le coding-category-iso-7-tight
coding-category-iso-7 coding-category-iso-8-else
coding-category-emacs-mule coding-category-raw-text
coding-category-sjis coding-category-ccl coding-category-binary)
其中coding-category-iso-8-2就是chinese-iso-8bit,也就是gb2312
首先安装tetex-bin, cjk-latex, ttf-arphic-gbsn00lp,然后运行脚本unisong
unisong含两个文件,Makefile和c70song.fd
Makefile:
all: build
build:
ln -s /usr/share/fonts/truetype/arphic/gbsn00lp.ttf unisong.ttf
ttf2tfm unisong.ttf -w unisong@Unicode@ > unisong.log
rm -f unisong.map
for i in *.tfm; do base=`basename $$i .tfm`; echo "$${base} <$${base}.enc > unisong.map; done
install:
install -d /usr/share/texmf/fonts/tfm/arphic/unisong/
cp *.tfm /usr/share/texmf/fonts/tfm/arphic/unisong/
install -d /usr/share/texmf/dvips/arphic/
cp *.enc /usr/share/texmf/dvips/arphic/
cp unisong.map /etc/texmf/dvips/
cp unisong.map /usr/share/texmf/dvips/omega/
cp unisong.ttf /usr/share/texmf/fonts/truetype/arphic/
grep '^unisong@Unicode@ unisong.ttf' /etc/ttf2pk/ttfonts.map || echo "unisong@Unicode@ unisong.tff" >> /etc/ttf2pk/ttfonts.map
cp -f c70song.fd /usr/share/texmf/tex/latex/CJK/UTF8/
grep "^map +unisong.map" /etc/texmf/pdftex/pdftex.cfg || echo "map +unisong.map" >> /etc/texmf/pdftex/pdftex.cfg
mktexlsr
clean:
rm -f unisong*.tfm
rm -f unisong*.enc
rm -f unisong.map
rm -f unisong.ttf
rm -f unisong.log
.PHONY: build
c70song.fd(cjk-latex自带的c70song.fd,再将cyberb改成unisong就可以了):
% This is the file c70song.fd of the CJK package
% for using Asian logographs (Chinese/Japanese/Korean) with LaTeX2e
%
% created by Werner Lemberg
%
% Version 4.5.1 (17-Jun-2002)
\def\fileversion{4.5.1}
\def\filedate{2002/06/17}
\ProvidesFile{c70song.fd}[\filedate\space\fileversion]
% character set: Unicode U+0080 - U+FFFD
% font encoding: Unicode
\DeclareFontFamily{C70}{song}{\hyphenchar \font\m@ne}
\DeclareFontShape{C70}{song}{m}{n}{<-> CJK * unisong}{}
\DeclareFontShape{C70}{song}{bx}{n}{<-> CJKb * unisong}{\CJKbold}
\endinput
OK, make; su; make install就可以了
然后把你的latex文章转成UTF8编码,把\begin{CJK*}{GB}{song}改成 \begin{CJK*}{UTF8}{song}就可以了。
安装完latex-ucs后,在tex文件的头部加入
\usepackage{ucs}
\usepackage[utf8]{inputenc}
就可以在正文中输入任何unicode字符了。 如果在文件头加入
\usepackage[C10,T1]{fontenc}
\usepackage[cjkgb]{ucs}
\usepackage[utf8]{inputenc}
那么输入中文也没有问题,不过就不能享受CJK带来的其他好处了。 很多FTP的文件名是GB2312编码的。解决方法有:
set ftp:charset "gbk"
set file:charset "UTF-8"
#!/usr/bin/python
# mp3iconv.py
import os
import pyid3lib
def texticonv(text, fcode, tcode):
try:
text.decode(tcode)
except UnicodeDecodeError:
try:
newtext = text.decode(fcode)
except UnicodeDecodeError:
return False, None
newtext = newtext.encode(tcode)
return True, newtext
os.rename(fname, newfname)
return False, None
def mp3iconv(fname, fcode='gb2312', tcode='utf8'):
tag = pyid3lib.tag(fname)
needupdate = False
for key in ['artist', 'title', 'album']:
try:
text = getattr(tag, key)
except AttributeError:
continue
r, newtext = texticonv(text, fcode, tcode)
if r:
setattr(tag, key, newtext)
needupdate = True
if needupdate:
tag.update()
def main():
import sys
assert len(sys.argv) > 1
for x in sys.argv[1:]:
mp3iconv(x)
if __name__ == '__main__':
main()
以下步骤均假定你在root用户下运行
apt-get install pptpd kernel-tree-2.6.10 kernel-package
apt-get install kernel-patch-mppe libc6-dev
cd /usr/src
tar xjf kernel-source-2.6.10.tar.bz2
cd /usr/src/kernel-source-2.6.10
cp /boot/config-2.6.10-1-686-smp .config
make-kpkg --added-patches debian,mppe --append-to-version -686-smp-mppe --initrd kernel_image然后去喝茶
cd /usr/src/
dpkg -i kernel-image-2.6.10-686-smp-mppe_10.00.Custom_i386.deb
update-grub
reboot
vi /etc/pptpd.conf修改localip和remoteip, localip改成服务器的IP, remoteip是供登录上来的机器使用的IP,如
localip 1.2.3.4
remoteip 1.2.3.50-70
vi /etc/ppp/chap-secrets如果不限制ip,可以改成如下的样子
username pptpd password *如果限制IP,可以改成
username pptpd password 162.105.0.0/16 166.111.0.0/16
/etc/network/options修改ip_forward选项
ip_forward=yes
/etc/init.d/networking restart
/etc/init.d/pptpd restart