看板 LaTeX 關於我們 聯絡資訊
最近想試試看 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
lovinlover:看起來像是字體的問題 可以考慮打開Word直接複製看看 03/30 11:59
ogre0403:之前2.8升2.9的時候有遇到,所以我又重灌2.8了 03/30 13:08
springman:我的 Miktex2.9+win7 正常。 03/30 13:59
alanguo:2.9版我學校電腦正常,家裡遇到一樣的問題...(皆win7) 03/30 21:14
alanguo:後來安裝fontspec套件後就ok了~ 03/30 21:45
math99:解決了 感謝各位!更新 fontspec 就可以了 03/31 11:07
math99:或改用 2.8 也可以 03/31 11:09