다음 Latex 코드를 컴파일할 때 오류가 발생합니다.
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Code2000}
\begin{document}
abc
\end{document}
오류:
\Undefined control sequence \setmainfont{Code2000}
KDE 개발 플랫폼 4.8.5(4.8.5)를 사용하여 Ubuntu 12.04 및 Kile 버전 2.1.0을 사용하고 있습니다.
texlive-full
패키지 용으로 설치했습니다 fontspec
.
명령을 인식하지 못하기 때문에 내가 무엇을 놓치고 있습니까 \setmainfont
?
로그 파일은 다음과 같습니다.
This is XeTeX, Version 3.1415926-2.2-0.9995.2 (TeX Live 2009/Debian) (format=xelatex 2014.3.20) 20 MAR 2014 20:00
entering extended mode
%&-line parsing enabled.
**demo_unicode4.tex
(./demo_unicode4.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, farsi, arabic, croatian, bulgarian, ukrainian, russian, czech, slov
ak, danish, dutch, finnish, french, basque, ngerman, german, german-x-2009-06-1
9, ngerman-x-2009-06-19, ibycus, monogreek, greek, ancientgreek, hungarian, san
skrit, italian, latin, latvian, lithuanian, mongolian2a, mongolian, bokmal, nyn
orsk, romanian, irish, coptic, serbian, turkish, welsh, esperanto, uppersorbian
, estonian, indonesian, interlingua, icelandic, kurmanji, slovenian, polish, po
rtuguese, spanish, galician, catalan, swedish, ukenglish, pinyin, loaded.
(/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.sty
Package: fontspec 2008/08/09 v1.18 Advanced font selection for XeLaTeX
(/usr/share/texmf-texlive/tex/generic/ifxetex/ifxetex.sty
Package: ifxetex 2009/01/23 v0.5 Provides ifxetex conditional
)
\c@zf@newff=\count88
\c@zf@index=\count89
\c@zf@script=\count90
\c@zf@language=\count91
(/usr/share/texmf-texlive/tex/latex/longtableswas/calc.sty
Package: calc 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count92
\calc@Bcount=\count93
\calc@Adimen=\dimen103
\calc@Bdimen=\dimen104
\calc@Askip=\skip43
\calc@Bskip=\skip44
LaTeX Info: Redefining \setlength on input line 76.
LaTeX Info: Redefining \addtolength on input line 77.
\calc@Ccount=\count94
\calc@Cskip=\skip45
)
(/usr/share/texmf-texlive/tex/latex/xkeyval/xkeyval.sty
Package: xkeyval 2008/08/13 v2.6a package option processing (HA)
(/usr/share/texmf-texlive/tex/generic/xkeyval/xkeyval.tex
\XKV@toks=\toks14
\XKV@tempa@toks=\toks15
\XKV@depth=\count95
File: xkeyval.tex 2008/08/13 v2.6a key=value parser (HA)
(/usr/share/texmf-texlive/tex/generic/xkeyval/keyval.tex)))
(/usr/share/texmf-texlive/tex/latex/base/fontenc.sty
Package: fontenc 2005/09/27 v1.99g Standard LaTeX package
(/usr/share/texmf-texlive/tex/xelatex/euenc/eu1enc.def
File: eu1enc.def 2008/03/08 v0.1d Experimental unicode font encoding
)
LaTeX Font Info: Try loading font information for EU1+lmr on input line 100.
(/usr/share/texmf-texlive/tex/xelatex/euenc/eu1lmr.fd
File: eu1lmr.fd 2007/01/14 v1.3 Font defs for Latin Modern
))
LaTeX Info: Redefining \itshape on input line 1163.
LaTeX Info: Redefining \slshape on input line 1166.
LaTeX Info: Redefining \scshape on input line 1169.
LaTeX Info: Redefining \upshape on input line 1172.
fontspec.cfg loaded.
(/usr/share/texmf-texlive/tex/xelatex/fontspec/fontspec.cfg))
(./demo_unicode4.aux)
\openout1 = `demo_unicode4.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
LaTeX Font Info: Checking defaults for EU1/lmr/m/n on input line 4.
LaTeX Font Info: ... okay on input line 4.
Package fontspec Info: Adjusting the maths setup (use [no-math] to avoid this).
on input line 4.
\symlegacymaths=\mathgroup4
LaTeX Font Info: Overwriting symbol font `legacymaths' in version `bold'
(Font) OT1/cmr/m/n --> OT1/cmr/bx/n on input line 4.
LaTeX Font Info: Redeclaring math accent \acute on input line 4.
LaTeX Font Info: Redeclaring math accent \grave on input line 4.
LaTeX Font Info: Redeclaring math accent \ddot on input line 4.
LaTeX Font Info: Redeclaring math accent \tilde on input line 4.
LaTeX Font Info: Redeclaring math accent \bar on input line 4.
LaTeX Font Info: Redeclaring math accent \breve on input line 4.
LaTeX Font Info: Redeclaring math accent \check on input line 4.
LaTeX Font Info: Redeclaring math accent \hat on input line 4.
LaTeX Font Info: Redeclaring math accent \dot on input line 4.
LaTeX Font Info: Redeclaring math accent \mathring on input line 4.
LaTeX Font Info: Redeclaring math symbol \colon on input line 4.
LaTeX Font Info: Redeclaring math symbol \Gamma on input line 4.
LaTeX Font Info: Redeclaring math symbol \Delta on input line 4.
LaTeX Font Info: Redeclaring math symbol \Theta on input line 4.
LaTeX Font Info: Redeclaring math symbol \Lambda on input line 4.
LaTeX Font Info: Redeclaring math symbol \Xi on input line 4.
LaTeX Font Info: Redeclaring math symbol \Pi on input line 4.
LaTeX Font Info: Redeclaring math symbol \Sigma on input line 4.
LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 4.
LaTeX Font Info: Redeclaring math symbol \Phi on input line 4.
LaTeX Font Info: Redeclaring math symbol \Psi on input line 4.
LaTeX Font Info: Redeclaring math symbol \Omega on input line 4.
LaTeX Font Info: Redeclaring math symbol \mathdollar on input line 4.
LaTeX Font Info: Redeclaring symbol font `operators' on input line 4.
LaTeX Font Info: Encoding `OT1' has changed to `EU1' for symbol font
(Font) `operators' in the math version `normal' on input line 4.
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) OT1/cmr/m/n --> EU1/lmr/m/n on input line 4.
LaTeX Font Info: Encoding `OT1' has changed to `EU1' for symbol font
(Font) `operators' in the math version `bold' on input line 4.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) OT1/cmr/bx/n --> EU1/lmr/m/n on input line 4.
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) EU1/lmr/m/n --> EU1/lmr/m/n on input line 4.
LaTeX Font Info: Overwriting math alphabet `\mathrm' in version `normal'
(Font) EU1/lmr/m/n --> EU1/lmr/m/n on input line 4.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
(Font) OT1/cmr/m/it --> EU1/lmr/m/it on input line 4.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
(Font) OT1/cmr/bx/n --> EU1/lmr/bx/n on input line 4.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
(Font) OT1/cmss/m/n --> EU1/lmss/m/n on input line 4.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
(Font) OT1/cmtt/m/n --> EU1/lmtt/m/n on input line 4.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) EU1/lmr/m/n --> EU1/lmr/bx/n on input line 4.
LaTeX Font Info: Overwriting math alphabet `\mathrm' in version `bold'
(Font) EU1/lmr/m/n --> EU1/lmr/bx/n on input line 4.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) OT1/cmr/bx/it --> EU1/lmr/bx/it on input line 4.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
(Font) OT1/cmss/bx/n --> EU1/lmss/bx/n on input line 4.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
(Font) OT1/cmtt/m/n --> EU1/lmtt/bx/n on input line 4.
! Font \zf@basefont=Code2000 at 10.0pt not loadable: Metric (TFM) file or insta
lled font not found.
\zf@fontspec ...ntname \zf@suffix " at \f@size pt
\unless \ifzf@icu \zf@set@...
l.5 \setmainfont{Code2000}
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.
! Undefined control sequence.
\zf@set@font@type ...onttype \zf@basefont \zf@tfm
\or \zf@atsuitrue \ifnum \...
l.5 \setmainfont{Code2000}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Font \zf@basefont=Code2000 at 10.0pt not loadable: Metric (TFM) file or insta
lled font not found.
\zf@fontspec ...ntname \zf@suffix " at \f@size pt
\fi \zf@firsttimetrue \zf@...
l.5 \setmainfont{Code2000}
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.
\c@zf@famc@Code2000=\count96
Package fontspec Info: Defining font family for 'Code2000' with options [] on i
nput line 5.
! Font \@tempfontb=Code2000 at 10.0pt not loadable: Metric (TFM) file or instal
led font not found.
\\zf@make@font@shapes ...f@suffix " at \f@size pt
\edef \@tempb {\fontname \...
l.5 \setmainfont{Code2000}
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.
! Font \@tempfonta=Code2000 at 10.0pt not loadable: Metric (TFM) file or instal
led font not found.
\\zf@make@font@shapes ...f@suffix " at \f@size pt
\edef \@tempa {\fontname \...
l.5 \setmainfont{Code2000}
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.
! Font \@tempfontb=Code2000/B at 10.0pt not loadable: Metric (TFM) file or inst
alled font not found.
\\zf@make@font@shapes ...f@suffix " at \f@size pt
\edef \@tempb {\fontname \...
l.5 \setmainfont{Code2000}
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.
Package fontspec Info: Could not resolve font Code2000/B (it might not exist) o
n input line 5.
! Font \@tempfonta=Code2000 at 10.0pt not loadable: Metric (TFM) file or instal
led font not found.
\\zf@make@font@shapes ...f@suffix " at \f@size pt
\edef \@tempa {\fontname \...
l.5 \setmainfont{Code2000}
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.
! Font \@tempfontb=Code2000/I at 10.0pt not loadable: Metric (TFM) file or inst
alled font not found.
\\zf@make@font@shapes ...f@suffix " at \f@size pt
\edef \@tempb {\fontname \...
l.5 \setmainfont{Code2000}
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.
Package fontspec Info: Could not resolve font Code2000/I (it might not exist) o
n input line 5.
! Font \@tempfonta=Code2000 at 10.0pt not loadable: Metric (TFM) file or instal
led font not found.
\\zf@make@font@shapes ...f@suffix " at \f@size pt
\edef \@tempa {\fontname \...
l.5 \setmainfont{Code2000}
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.
! Font \@tempfontb=Code2000/BI at 10.0pt not loadable: Metric (TFM) file or ins
talled font not found.
\\zf@make@font@shapes ...f@suffix " at \f@size pt
\edef \@tempb {\fontname \...
l.5 \setmainfont{Code2000}
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.
Package fontspec Info: Could not resolve font Code2000/BI (it might not exist)
on input line 5.
! Font EU1/Code2000(0)/m/n/10=Code2000: at 10.0pt not loadable: Metric (TFM) fi
le or installed font not found.
<to be read again>
relax
l.5 \setmainfont{Code2000}
I wasn't able to read the size data for this font,
so I will ignore the font specification.
[Wizards can fix TFM files using TFtoPL/PLtoTF.]
You might try inserting a different font spec;
e.g., type `I\font<same font id>=<substitute font name>'.
Missing character: There is no a in font nullfont!
Missing character: There is no b in font nullfont!
Missing character: There is no c in font nullfont!
Missing character: There is no 1 in font nullfont!
[1
] (./demo_unicode4.aux)
*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
fontspec.sty 2008/08/09 v1.18 Advanced font selection for XeLaTeX
ifxetex.sty 2009/01/23 v0.5 Provides ifxetex conditional
calc.sty 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
xkeyval.sty 2008/08/13 v2.6a package option processing (HA)
xkeyval.tex 2008/08/13 v2.6a key=value parser (HA)
fontenc.sty
eu1enc.def 2008/03/08 v0.1d Experimental unicode font encoding
eu1lmr.fd 2007/01/14 v1.3 Font defs for Latin Modern
fontspec.cfg
***********
)
Here is how much of TeX's memory you used:
2186 strings out of 494665
44134 string characters out of 1166477
121792 words of memory out of 3000000
5460 multiletter control sequences out of 15000+50000
3648 words of font info for 15 fonts, out of 3000000 for 9000
669 hyphenation exceptions out of 8191
27i,4n,27p,449b,142s stack positions out of 5000i,500n,10000p,200000b,50000s
Output written on demo_unicode4.pdf (1 page).
답변1
질문의 초기 버전은 정의되지 않은 명령 오류가 있음을 식별했지만 정의되지 않은 명령을 표시하지 않았기 때문에 오해의 소지가 있었습니다. 오류는 다음과 같습니다
! Undefined control sequence.
\zf@set@font@type ...onttype \zf@basefont \zf@tfm
\or \zf@atsuitrue \ifnum \...
l.5 \setmainfont{Code2000}
따라서 정의되지 않은 명령은 입니다 \zf@tfm
.
그러나 이 오류는 본질적으로 첫 번째 오류에서 중지되지 않아 발생한 가짜 내부 오류입니다. (오류를 스크롤할 때 TeX의 복구 작업은 종종 특별히 유용하지 않으며 단지 많은 허위 오류로 이어질 뿐입니다.)
보고된 첫 번째 오류는 다음과 같습니다.
! Font \zf@basefont=Code2000 at 10.0pt not loadable: Metric (TFM) file or insta
lled font not found.
\zf@fontspec ...ntname \zf@suffix " at \f@size pt
\unless \ifzf@icu \zf@set@...
l.5 \setmainfont{Code2000}
Code2000
이는 Tex가 예상하는 곳에 설치되지 않았거나 전혀 설치되지 않았기 때문에 글꼴을 찾을 수 없음을 의미합니다 .
답변2
문제는 실제로 두 가지였습니다.
- 내 시스템에는
fontspec
(패키지로 제공되는 ) 이전 버전이 있습니다 .texlive-xetex
- 내 시스템에 code2000 패키지가 없습니다.
1. 시스템에 최신 버전의 글꼴 사양이 있는지 확인하십시오.
\listfiles
코드에 명령을 포함하면 올바른 버전의fontspec.sty
. 로그 파일에는 다음 정보가 제공되었습니다.fontspec.sty 2008/08/09 v1.18 Advanced font selection for XeLaTeX –
다음 단계는 최신 버전의 글꼴 사양을 다운로드하는 것입니다. 최신 패키지를 설치하십시오.
texlive-xetex
저장소에서 . 나는 대답을 따랐다.XeTeX 설치 및 사용패키지를 설치합니다.
2. code2000 패키지를 설치합니다.
- 해당 링크에서 패키지를 다운로드하세요.http://www.fonts2u.com/code2000.font
- 에게 복사
/usr/share/fonts/
fc-cache -fv
글꼴 목록을 새로 고치려면
이제 코드가 컴파일됩니다!
답변3
글꼴 사양 패키지로 어려움을 겪고 있는 사람들과 "정의되지 않은 제어 시퀀스" 오류에 대한 지속적인 오류가 발생하는 경우 이를 해결하기 위해 제가 찾은 방법이 있습니다!
내 경우에는 문제가 Lyx나 서문의 정의가 아니라는 것을 몇 시간 후에 발견했습니다. 문제의 근원은 MiKTeX입니다. 때로는 사용하려는 패키지를 업데이트해야 할 때도 있습니다.
MiKTeX 업데이트 업데이트 소스로 이동 -> 패키지를 가져오고 싶습니다... 가장 가까운 패키지 저장소 사용 -> 다음 오류를 일으키는 글꼴 사양 패키지 또는 패키지 선택 -: 다음 패키지가 업데이트됩니다 -> lyx를 열고 인생을 즐기세요 이 빌어먹을 오류 이후에 또 다시 ;)