Fedora 19安装xetex

之前一直是在mac下使用xetex,这货能直接使用系统自带的中文字体,相对比较方便,不过在Fedora 19下安装的时候遇到一点挫折,现在记录下来,给有需要的人用

测试用的文件 test.tex:

\documentclass[11pt,a4paper]{article}
\usepackage{fontspec,xunicode,xltxtra}
\usepackage{titlesec}
\usepackage[top=1in,bottom=1in,left=1.25in,right=1.25in]{geometry}

\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt

\setmainfont{WenQuanYi Zen Hei}

\renewcommand{\baselinestretch}{1.25}

\begin{document}

\title{\hei 中文测试}
\date{2013年7月23日}


\section{简介}
XeLaTeX 中文测试


\end{document}

首先安装基本的库:

# yum install texlive-xetex texlive-context-bin texlive-xetex-def texlive-xltxtra texlive-euenc texlive-texconfig-bin texlive-texconfig texlive-titlesec texlive-metafont texlive-collection-fontsrecommended texlive-times -y

这个时候使用xetex会报错:

[root@localhost ~]# xelatex test.tex 
This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013)
 restricted \write18 enabled.

kpathsea: Running mktexfmt xelatex.fmt
I can't find the format file `xelatex.fmt'!

之前这一步卡了许久,最后才知道怎么创建xelatex.fmt这个文件,执行:

[root@localhost ~]# fmtutil-sys --all
[root@localhost ~]# fmtutil-sys --enablefmt xetex
fmtutil: initial config file is `/usr/share/texlive/texmf-dist/web2c/fmtutil.cnf'
fmtutil: configuration file unchanged.

然后编译就不出问题了。
安装过程中麻烦的地方在于rpm的依赖没做好,得自己找到xelatex依赖哪些包,而且安装脚本并没有帮你做一些必须的初始化


Last modified on 2013-07-23