作者math99 (新世界)
看板LaTeX
标题[问题] 关於 XeLaTex
时间Wed Mar 30 10:08:37 2011
最近想试试看 Xelatex, 爬了版上的文和拜了估狗神,似乎大部分不用做什麽设定就
可以编译了 = =?
在下参考版上某位的范例:
% --- Xelatex code start ---
\documentclass{article}
\usepackage{fontspec} %加这个就可以设定字体
\setmainfont{微软正黑体} %直接设定Windows中的字型,名字要打的\
一模一样才行。
\XeTeXlinebreaklocale "zh" %这两行一定要加,中文才能自动换行
\XeTeXlinebreakskip = 0pt plus 1pt %这两行是texWorks范例中所缺少的。
%加了这四行後,就可以随意的打中文,
%接下来的跟一般的LeTeX都一样
\title{我是标题标题标题}
\author{我是作者}
\date{} %不要日期
\begin{document}
\maketitle
中文测试中文测试中文测试中文测试中文测试中文测试,中文测试中文测试,中文
测试中文测试中文测试中文测试中文测试中文测试,中文测试中文测试。
English Test. This is a simple template for a XeLaTeX document using the
article class, with the fontspec package to easily select fonts.
\end{document}
% --- xelatex code end ---
但我在 win 7 用 MikTex 2.9 内键的 TeXworks 里面的 XeLaTex 去编,却不能编,
以下是错误码:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! This is a LaTeX bug: check coding!
!
! Command name `\font_set:Nnn' already defined! Current meaning:
! \protected\long macro:#1#2#3->\tex_font:D #1=#2 at #3\scan_stop:
!
! See the LaTeX3 documentation for further information.
! For immediate help type H <return>.
!...............................................
l.602 \cs_new:Npn \font_set:Nnn
#1#2#3 {
?
---
不知道是怎麽情况 = =" 要怎麽解决?谢谢!
--
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.115.25.216
1F:→ lovinlover:看起来像是字体的问题 可以考虑打开Word直接复制看看 03/30 11:59
2F:推 ogre0403:之前2.8升2.9的时候有遇到,所以我又重灌2.8了 03/30 13:08
3F:推 springman:我的 Miktex2.9+win7 正常。 03/30 13:59
4F:推 alanguo:2.9版我学校电脑正常,家里遇到一样的问题...(皆win7) 03/30 21:14
5F:→ alanguo:後来安装fontspec套件後就ok了~ 03/30 21:45
6F:→ math99:解决了 感谢各位!更新 fontspec 就可以了 03/31 11:07
7F:→ math99:或改用 2.8 也可以 03/31 11:09