|
|
发表于 2010-7-6 22:32:08
|
显示全部楼层
Post by xushaohua2011;2101724
1.CJK已经非常老了
2,xetex可以简单有效地解决中文字体的问题
3,我的中文样式 zhfontcfg.sty- % 把文件放在/usr/share/texmf-texlive/tex/xelatex/zhfontconf/
- % 在终端执行:# mktexlsr ,把这个宏包加入系统
- % 使用时只要加载这一个宏包,中文环境就建好了。
- % xetex/xelatex 中文字体设定宏包
- \ProvidesPackage{zhfontcfg}
- \usepackage{fontspec,xunicode,xltxtra}
- \defaultfontfeatures{Mapping=tex-text} %如果没有它,会有一些 tex 特殊字符无法正常使用,比如连字符。
- % 中文断行
- \XeTeXlinebreaklocale "zh"
- \XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt
- % 将系统字体名映射为逻辑字体名,为了维护方便。
- \newcommand\fontnamehei{WenQuanYi Micro Hei}
- \newcommand\fontnamesong{AR PL UMing CN}
- \newcommand\fontnamekai{AR PL UKai CN}
- \newcommand\fontnamemono{WenQuanYi Zen Hei Mono}
- \newcommand\fontnameroman{Liberation Serif}
- % 设置文档正文为宋体
- \setmainfont[BoldFont=\fontnamehei]{\fontnamesong}
- \setsansfont[BoldFont=\fontnamehei]{\fontnamekai}
- \setmonofont{\fontnamemono}
- % 楷体
- % newfontinstance = newfontfamily
- % fontinstance 创建新的字体样式,而fontfamily创建新字体族。
- \newfontinstance\KAI{\fontnamekai}
- \newcommand{\kai}[1]{{\KAI #1}}
- % 黑体
- \newfontinstance\HEI{\fontnamehei}
- \newcommand{\hei}[1]{{\HEI #1}}
- % 英文
- \newfontinstance\ENF{\fontnameroman}
- \newcommand{\en}[1]{\,{\ENF #1}\,}
- \newcommand{\EN}{\,\ENF\,}
复制代码 这样用起来就相当简单啦。
我是学生物的,平时几乎不与公式打交道,所以常用Lyx来写文档,方便嘛,尤其是那么多的图片-_-
这个配置文件我以前也用过,已经“过时”了。最主要的问题是\setmainfont用的不对(不合理)。现在可以把\setmainfont写作\setCJKmainfont,而用\setmainfont来定义英文字体。 |
|