我在嘗試使用 ClearSans 字體和 XeLaTeX 編譯文件時遇到了一些麻煩。我正在運行 MikTex 的最新副本,所有軟體包均已於昨天更新。以下是我將參考的最小非工作範例:
\documentclass[a4paper]{article}
\RequirePackage{fontspec}
\usepackage[sfdefault]{ClearSans}
\begin{document}
Hello, World!
\end{document}
用 XeLaTeX 編譯它會出現以下錯誤:
D:\test\> xelatex test.tex
This is XeTeX, Version 3.14159265-2.6-0.999991 (MiKTeX 2.9.6960 64-bit)
entering extended mode
(test.tex
LaTeX2e <2018-12-01>
("C:\Program Files\MiKTeX 2.9\tex/latex/base\article.cls"
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex/latex/base\size10.clo"))
(C:\Users\User\AppData\Roaming\MiKTeX\2.9\tex/latex/fontspec\fontspec.sty
(C:\Users\User\AppData\Roaming\MiKTeX\2.9\tex/latex/l3packages/xparse\xparse.
sty (C:\Users\User\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\expl3.sty
(C:\Users\User\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\expl3-code.tex)
(C:\Users\User\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\l3xdvipdfmx.def)
))
(C:\Users\User\AppData\Roaming\MiKTeX\2.9\tex/latex/fontspec\fontspec-xetex.s
ty ("C:\Program Files\MiKTeX 2.9\tex/latex/base\fontenc.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/base\tuenc.def"))
(C:\Users\User\AppData\Roaming\MiKTeX\2.9\tex/latex/fontspec\fontspec.cfg)))
(C:\Users\User\AppData\Roaming\MiKTeX\2.9\tex/latex/clearsans\ClearSans.sty
("C:\Program Files\MiKTeX 2.9\tex/generic/ifxetex\ifxetex.sty")
("C:\Program Files\MiKTeX 2.9\tex/generic/oberdiek\ifluatex.sty")
("C:\Program Files\MiKTeX 2.9\tex/latex/xkeyval\xkeyval.sty"
("C:\Program Files\MiKTeX 2.9\tex/generic/xkeyval\xkeyval.tex"
("C:\Program Files\MiKTeX 2.9\tex/generic/xkeyval\xkvutils.tex"
("C:\Program Files\MiKTeX 2.9\tex/generic/xkeyval\keyval.tex"))))
("C:\Program Files\MiKTeX 2.9\tex/latex/base\textcomp.sty"
("C:\Program Files\MiKTeX 2.9\tex/latex/base\ts1enc.def"))
! Undefined control sequence.
\__fontspec_init_ttc:n #1->\str_if_eq:eeT
{\str_lower_case:f {\l__fontspec_e...
l.58 {ClearSans}
?
我根本不知道是什麼原因造成的,希望這裡有人能引導我走向正確的方向。所以,問題是:
為什麼這不起作用/我做錯了什麼?
順便說一句,pdflatex
當fontspec
註解掉依賴項時,它可以很好地編譯,但請記住上面只是一個最小的範例,我確實需要讓它為xelatex
.