Centos 6.4 中如何配置Texlive2013中文字体的问题:
第一步是下载你需要的字体,我从windows/fonts中拷贝的比较多,你只要复制你需要的字体即可。
注意只要文件扩展名为ttf的文件,ttc的文件不要复制。
windows/fonts中没有simkai.ttf,只有simkai.ttc,这个好办,在网上下一个simkai.ttf即可:
arialuni.ttf FZSTK.TTF FZYTK.TTF msjh.ttf MSYHBD.TTF msyh.ttf simfang.ttf simhei.ttf SIMKAI.TTF SIMLI.TTF simsun.ttf SIMYOU.TTF spaider simbol.TTF STCAIYUN.TTF STENCIL.TTF STFANGSO.TTF STHUPO.TTF STKAITI.TTF STLITI.TTF STSONG.TTF STXIHEI.TTF STXINGKA.TTF STXINWEI.TTF stzhongs.ttf 华文行楷.ttf 华文琥珀.ttf 华文楷体.ttf 华文细黑.ttf 华文新魏.ttf以root的身份创建目录/usr/share/fonts/chinese/TrueType,然后将所有的字体文件复制到centos的该字体目录中
cp -rf /d3/SoftWare/cn_font/*.* /usr/share/fonts/chinese/TrueType cd /usr/share/fonts/chinese/TrueType mkfontscale mkfontdir fc-cache -fv
chmod -R 755 /usr/share/fonts/
mkdir iso mount -o loop ./texlive20130530.iso ./iso
# PATH=/usr/local/texlive/2013/bin/x86_64-linux:$PATH; export PATH MANPATH=/usr/local/texlive/2013/texmf-dist/doc/man:$MANPATH; export MANPATH INFOPATH=/usr/local/texlive/2013/texmf-dist/doc/info:$INFOPATH; export INFOPATH #
修改文件/usr/local/texlive/2013/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def,
使用fc-list :lang=zh命令查找已安装的中文字体,替换文件中不存在的【字体】,下面我按照我的系统中已安装的中文字体修改的范例:
% ctex-xecjk-winfonts.def: Windows 的 xeCJK 字体设置,默认为六种中易字体 % vim:ft=tex \setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun} \setCJKsansfont{SimHei} \setCJKmonofont{FangSong} \setCJKfamilyfont{zhsong}{SimSun} \setCJKfamilyfont{zhhei}{SimHei} \setCJKfamilyfont{zhkai}{KaiTi} \setCJKfamilyfont{zhfs}{FangSong} \setCJKfamilyfont{zhli}{LiSu} \setCJKfamilyfont{zhyou}{YouYuan} \newcommand*{\songti}{\CJKfamily{zhsong}} % 宋体 \newcommand*{\heiti}{\CJKfamily{zhhei}} % 黑体 \newcommand*{\kaishu}{\CJKfamily{zhkai}} % 楷书 \newcommand*{\fangsong}{\CJKfamily{zhfs}} % 仿宋 \newcommand*{\lishu}{\CJKfamily{zhli}} % 隶书 \newcommand*{\youyuan}{\CJKfamily{zhyou}} % 幼圆 \endinput
下面可以测试一下中文了test.tex:
\documentclass[mathserif]{beamer} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage{ctex} %\setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]{SimSun} %\setCJKsansfont{SimHei} %\setCJKmonofont{FangSong} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 这是中文! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \end{document}
xelatex test xelatex test