Fedora 15 下配置Latex中文环境

1 安装texlive 2011


http://www.tug.org/texlive/doc.html

Texlive 2011下载地址:

 厦门大学开源软件镜像:http://mirrors.xmu.edu.cn/CTAN/systems/texlive/Images/


sudo mount -t iso9660 -o loop /pathto/texlive2011- 20110705.iso /opt/texlive

sudo ./install-tl -gui


2 安装字体


从windows里面拷贝需要的字体(Win7的字体文件在C:/Windows/Fonts下面)


# mkdir /usr/share/fonts/winfonts/
# cp /path/to/simhei.ttf /usr/share/fonts/winfonts/
# cp /path/to/simsunb.ttf /usr/share/fonts/winfonts/
# cp /path/to/simsun.ttc /usr/share/fonts/winfonts/
# cp /path/to/simkai.ttf /usr/share/fonts/winfonts/
# ......如有需要可以拷贝更多字体

注意拷贝后要注意写着字体文件的权限


执行下面命令

# cd /usr/share/fonts/winfonts/
# mkfontscale
# mkfontdir
# fc-cache
以上命令的作用分别是:为X创建可裁剪的索引,在一个目录中创建X字体文件的索引,建立字体信息缓存文件

[root@slap winfonts]# fc-list :lang=zh-cn

NSimSun,新宋体:style=Regular
KaiTi,楷体:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
SimSun,宋体:style=RegularUnibit:style=Regular
WenQuanYi Zen Hei,文泉驛正黑,文泉驿正黑:style=Regular
SimHei,黑体:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta
WenQuanYi Zen Hei Mono,文泉驛等寬正黑,文泉驿等宽正黑:style=Regular
WenQuanYi Zen Hei Sharp,文泉驛點陣正黑,文泉驿点阵正黑:style=Regular


修改文件/usr/local/texlive/2011/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def

# cat /usr/local/texlive/2011/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def

% ctex-xecjk-winfonts.def: Windows 的 xeCJK 字体设置,默认为六种中易字体
% vim:ft=tex

\setCJKmainfont[BoldFont={SimHei},ItalicFont={[SIMKAI.TTF]}]
  {SimSun}
\setCJKsansfont{SimHei}
\setCJKmonofont{[SIMFANG.TTF]}

\setCJKfamilyfont{zhsong}{SimSun}
\setCJKfamilyfont{zhhei}{SimHei}
\setCJKfamilyfont{zhkai}{[SIMKAI.TTF]}
\setCJKfamilyfont{zhfs}{[SIMFANG.TTF]}
% \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


修改后

# cat /usr/local/texlive/2011/texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def

% ctex-xecjk-winfonts.def: Windows 的 xeCJK 字体设置,默认为六种中易字体
% vim:ft=tex

\setCJKmainfont[BoldFont={SimHei},ItalicFont={KaiTi}]
  {SimSun}
\setCJKsansfont{SimHei}
\setCJKmonofont{[SIMFANG.TTF]}

\setCJKfamilyfont{zhsong}{SimSun}
\setCJKfamilyfont{zhhei}{SimHei}
\setCJKfamilyfont{zhkai}{KaiTi}
\setCJKfamilyfont{zhfs}{[SIMFANG.TTF]}
% \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

3 测试您的latex模板,如果发现缺失字体,重复步骤2


参考:

【1】 http://www.tug.org/texlive/doc/texlive-zh-cn/texlive-zh-cn.pdf

【2】 http://www.aboutlinux.info/2005/12/adding-windows-fonts-in-linux.html

【3】 http://hi.baidu.com/defeattroy/blog/item/5df1ffcac3348415be09e6de.html

【4】 http://learningloong.blog.163.com/blog/static/1623081242011731102219361/

【5】 http://forum.ubuntu.com.cn/viewtopic.php?f=35&t=350882


你可能感兴趣的:(c,windows,测试,vim)