我使用Ubuntu 18.04
过WSL2
。
编辑器Vscode 1.44.0
带有插件LaTeX Workshop 8.8.0
TeX 发行版是Texlive 2020
我的 .tex 文件是这样的
\documentclass[a4paper, 12pt]{book}
\title{一个标题}
\author{syc}
\usepackage{xeCJK}
\begin{document}
\maketitle
\newpage
hello, world
你好,世界
\end{document}
我得到的日志文件
This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex 2020.4.13) 14 APR 2020 08:51
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**/mnt/c/Users/songy/Desktop/tample/HBUThesis/test
(/mnt/c/Users/songy/Desktop/tample/HBUThesis/test.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-04-06> (/home/syc/texlive/2020/texmf-dist/tex/latex/base/book.cls
Document Class: book 2019/12/20 v1.4l Standard LaTeX document class
(/home/syc/texlive/2020/texmf-dist/tex/latex/base/bk12.clo
File: bk12.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
)
\c@part=\count163
\c@chapter=\count164
\c@section=\count165
\c@subsection=\count166
\c@subsubsection=\count167
\c@paragraph=\count168
\c@subparagraph=\count169
\c@figure=\count170
\c@table=\count171
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen134
) (/home/syc/texlive/2020/texmf-dist/tex/xelatex/xecjk/xeCJK.sty (/home/syc/texlive/2020/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2020-04-06 L3 programming layer (loader)
(/home/syc/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-xdvipdfmx.def
File: l3backend-xdvipdfmx.def 2020-03-12 L3 backend support: xdvipdfmx
\g__graphics_track_int=\count172
\l__pdf_internal_box=\box45
\g__pdf_backend_object_int=\count173
\g__pdf_backend_annotation_int=\count174
))
Package: xeCJK 2020/02/18 v3.8.2 Typesetting CJK scripts with XeLaTeX
(/home/syc/texlive/2020/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
Package: l3keys2e 2020-03-06 LaTeX2e option processing using LaTeX3 keys
) (/home/syc/texlive/2020/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty
Package: xtemplate 2020-03-06 L3 Experimental prototype document functions
\l__xtemplate_tmp_dim=\dimen135
\l__xtemplate_tmp_int=\count175
\l__xtemplate_tmp_muskip=\muskip16
\l__xtemplate_tmp_skip=\skip49
) (/home/syc/texlive/2020/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
Package: xparse 2020-03-06 L3 Experimental document command parser
\l__xparse_current_arg_int=\count176
\g__xparse_grabber_int=\count177
\l__xparse_m_args_int=\count178
\l__xparse_v_nesting_int=\count179
)
\l__xeCJK_tmp_int=\count180
\l__xeCJK_tmp_box=\box46
\l__xeCJK_tmp_dim=\dimen136
\l__xeCJK_tmp_skip=\skip50
\g__xeCJK_space_factor_int=\count181
\l__xeCJK_begin_int=\count182
\l__xeCJK_end_int=\count183
\c__xeCJK_CJK_class_int=\XeTeXcharclass1
\c__xeCJK_FullLeft_class_int=\XeTeXcharclass2
\c__xeCJK_FullRight_class_int=\XeTeXcharclass3
\c__xeCJK_HalfLeft_class_int=\XeTeXcharclass4
\c__xeCJK_HalfRight_class_int=\XeTeXcharclass5
\c__xeCJK_NormalSpace_class_int=\XeTeXcharclass6
\c__xeCJK_CM_class_int=\XeTeXcharclass7
\c__xeCJK_HangulJamo_class_int=\XeTeXcharclass8
\l__xeCJK_last_skip=\skip51
\g__xeCJK_node_int=\count184
\c__xeCJK_CJK_node_dim=\dimen137
\c__xeCJK_CJK-space_node_dim=\dimen138
\c__xeCJK_default_node_dim=\dimen139
\c__xeCJK_default-space_node_dim=\dimen140
\c__xeCJK_CJK-widow_node_dim=\dimen141
\c__xeCJK_normalspace_node_dim=\dimen142
\l__xeCJK_ccglue_skip=\skip52
\l__xeCJK_ecglue_skip=\skip53
\l__xeCJK_punct_kern_skip=\skip54
\l__xeCJK_last_penalty_int=\count185
\l__xeCJK_last_bound_dim=\dimen143
\l__xeCJK_last_kern_dim=\dimen144
\l__xeCJK_widow_penalty_int=\count186
Package xtemplate Info: Declaring object type 'xeCJK/punctuation' taking 0
(xtemplate) argument(s) on line 2302.
\l__xeCJK_fixed_punct_width_dim=\dimen145
\l__xeCJK_mixed_punct_width_dim=\dimen146
\l__xeCJK_middle_punct_width_dim=\dimen147
\l__xeCJK_fixed_margin_width_dim=\dimen148
\l__xeCJK_mixed_margin_width_dim=\dimen149
\l__xeCJK_middle_margin_width_dim=\dimen150
\l__xeCJK_bound_punct_width_dim=\dimen151
\l__xeCJK_bound_margin_width_dim=\dimen152
\l__xeCJK_margin_minimum_dim=\dimen153
\l__xeCJK_kerning_total_width_dim=\dimen154
\l__xeCJK_same_align_margin_dim=\dimen155
\l__xeCJK_different_align_margin_dim=\dimen156
\l__xeCJK_kerning_margin_width_dim=\dimen157
\l__xeCJK_kerning_margin_minimum_dim=\dimen158
\l__xeCJK_bound_dim=\dimen159
\l__xeCJK_reverse_bound_dim=\dimen160
\l__xeCJK_margin_dim=\dimen161
\l__xeCJK_minimum_bound_dim=\dimen162
\l__xeCJK_kerning_margin_dim=\dimen163
\g__xeCJK_family_int=\count187
\l__xeCJK_fam_int=\count188
\g__xeCJK_fam_allocation_int=\count189
\l__xeCJK_verb_case_int=\count190
\l__xeCJK_verb_exspace_skip=\skip55
(/home/syc/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec.sty
Package: fontspec 2020/02/21 v2.7i Font selection for XeLaTeX and LuaLaTeX
(/home/syc/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
Package: fontspec-xetex 2020/02/21 v2.7i Font selection for XeLaTeX and LuaLaTeX
\l__fontspec_script_int=\count191
\l__fontspec_language_int=\count192
\l__fontspec_strnum_int=\count193
\l__fontspec_tmp_int=\count194
\l__fontspec_tmpa_int=\count195
\l__fontspec_tmpb_int=\count196
\l__fontspec_tmpc_int=\count197
\l__fontspec_em_int=\count198
\l__fontspec_emdef_int=\count199
\l__fontspec_strong_int=\count266
\l__fontspec_strongdef_int=\count267
\l__fontspec_tmpa_dim=\dimen164
\l__fontspec_tmpb_dim=\dimen165
\l__fontspec_tmpc_dim=\dimen166
(/home/syc/texlive/2020/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2020/02/11 v2.0o Standard LaTeX package
) (/home/syc/texlive/2020/texmf-dist/tex/latex/fontspec/fontspec.cfg))) (/home/syc/texlive/2020/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg
File: xeCJK.cfg 2020/02/18 v3.8.2 Configuration file for xeCJK package
))
Package xeCJK Warning: Fandol is being set as the default font for CJK text.
(xeCJK) Please make sure it has been properly installed.
Package fontspec Warning: Font "FandolSong-Regular" does not contain requested
(fontspec) Script "CJK".
Package fontspec Info: Font family 'FandolSong-Regular(0)' created for font
(fontspec) 'FandolSong-Regular' with options
(fontspec) [Script={CJK},Extension={.otf},BoldFont={FandolSong-Bold},ItalicFont={FandolKai-Regular}].
(fontspec)
(fontspec) This font family consists of the following NFSS
(fontspec) series/shapes:
(fontspec)
(fontspec) - 'normal' (m/n) with NFSS spec.:
(fontspec) <->"[FandolSong-Regular.otf]/OT:language=dflt;"
(fontspec) - 'small caps' (m/sc) with NFSS spec.:
(fontspec) - 'bold' (b/n) with NFSS spec.:
(fontspec) <->"[FandolSong-Bold.otf]/OT:language=dflt;"
(fontspec) - 'bold small caps' (b/sc) with NFSS spec.:
(fontspec) - 'italic' (m/it) with NFSS spec.:
(fontspec) <->"[FandolKai-Regular.otf]/OT:language=dflt;"
(fontspec) - 'italic small caps' (m/scit) with NFSS spec.:
(./test.aux)
\openout1 = `test.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 5.
LaTeX Font Info: Trying to load font information for TS1+cmr on input line 5.
(/home/syc/texlive/2020/texmf-dist/tex/latex/base/ts1cmr.fd
File: ts1cmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions
)
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
Package fontspec Info: Adjusting the maths setup (use [no-math] to avoid
(fontspec) this).
\symlegacymaths=\mathgroup4
LaTeX Font Info: Overwriting symbol font `legacymaths' in version `bold'
(Font) OT1/cmr/m/n --> OT1/cmr/bx/n on input line 5.
LaTeX Font Info: Redeclaring math accent \acute on input line 5.
LaTeX Font Info: Redeclaring math accent \grave on input line 5.
LaTeX Font Info: Redeclaring math accent \ddot on input line 5.
LaTeX Font Info: Redeclaring math accent \tilde on input line 5.
LaTeX Font Info: Redeclaring math accent \bar on input line 5.
LaTeX Font Info: Redeclaring math accent \breve on input line 5.
LaTeX Font Info: Redeclaring math accent \check on input line 5.
LaTeX Font Info: Redeclaring math accent \hat on input line 5.
LaTeX Font Info: Redeclaring math accent \dot on input line 5.
LaTeX Font Info: Redeclaring math accent \mathring on input line 5.
LaTeX Font Info: Redeclaring math symbol \colon on input line 5.
LaTeX Font Info: Redeclaring math symbol \Gamma on input line 5.
LaTeX Font Info: Redeclaring math symbol \Delta on input line 5.
LaTeX Font Info: Redeclaring math symbol \Theta on input line 5.
LaTeX Font Info: Redeclaring math symbol \Lambda on input line 5.
LaTeX Font Info: Redeclaring math symbol \Xi on input line 5.
LaTeX Font Info: Redeclaring math symbol \Pi on input line 5.
LaTeX Font Info: Redeclaring math symbol \Sigma on input line 5.
LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 5.
LaTeX Font Info: Redeclaring math symbol \Phi on input line 5.
LaTeX Font Info: Redeclaring math symbol \Psi on input line 5.
LaTeX Font Info: Redeclaring math symbol \Omega on input line 5.
LaTeX Font Info: Redeclaring math symbol \mathdollar on input line 5.
LaTeX Font Info: Redeclaring symbol font `operators' on input line 5.
LaTeX Font Info: Encoding `OT1' has changed to `TU' for symbol font
(Font) `operators' in the math version `normal' on input line 5.
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) OT1/cmr/m/n --> TU/lmr/m/n on input line 5.
LaTeX Font Info: Encoding `OT1' has changed to `TU' for symbol font
(Font) `operators' in the math version `bold' on input line 5.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) OT1/cmr/bx/n --> TU/lmr/m/n on input line 5.
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) TU/lmr/m/n --> TU/lmr/m/n on input line 5.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
(Font) OT1/cmr/m/it --> TU/lmr/m/it on input line 5.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
(Font) OT1/cmr/bx/n --> TU/lmr/b/n on input line 5.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
(Font) OT1/cmss/m/n --> TU/lmss/m/n on input line 5.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
(Font) OT1/cmtt/m/n --> TU/lmtt/m/n on input line 5.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) TU/lmr/m/n --> TU/lmr/b/n on input line 5.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) OT1/cmr/bx/it --> TU/lmr/b/it on input line 5.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
(Font) OT1/cmss/bx/n --> TU/lmss/b/n on input line 5.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
(Font) OT1/cmtt/m/n --> TU/lmtt/b/n on input line 5.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <14.4> on input line 6.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 6.
[1
] [2] (./test.aux) )
Here is how much of TeX's memory you used:
4571 strings out of 481357
143488 string characters out of 5927161
433007 words of memory out of 5000000
21989 multiletter control sequences out of 15000+600000
533363 words of font info for 41 fonts, out of 8000000 for 9000
36 hyphenation exceptions out of 8191
46i,6n,73p,326b,241s stack positions out of 5000i,500n,10000p,200000b,80000s
Output written on test.pdf (2 pages).
我已经安装了 fandol 字体
~/texlive/2020/texmf-dist/fonts/opentype/public/fandol
❯ la
total 34M
-rw-r--r-- 1 syc syc 26K Jul 19 2015 FandolBraille-Display.otf
-rw-r--r-- 1 syc syc 13K Jul 19 2015 FandolBraille-Regular.otf
-rw-r--r-- 1 syc syc 6.7M Jul 19 2015 FandolFang-Regular.otf
-rw-r--r-- 1 syc syc 3.5M Jul 19 2015 FandolHei-Bold.otf
-rw-r--r-- 1 syc syc 5.6M Jul 19 2015 FandolHei-Regular.otf
-rw-r--r-- 1 syc syc 7.5M Jul 19 2015 FandolKai-Regular.otf
-rw-r--r-- 1 syc syc 5.6M Jul 19 2015 FandolSong-Bold.otf
-rw-r--r-- 1 syc syc 4.8M Jul 19 2015 FandolSong-Regular.otf
我甚至把它们放在字体文件夹中
❯ fc-list | grep fandol
/usr/share/fonts/fandol/FandolFang-Regular.otf: FandolFang,FandolFang R:style=Regular
/usr/share/fonts/fandol/FandolBraille-Display.otf: Fandol Braille,Fandol Braille Display:style=Display,Regular
/usr/share/fonts/fandol/FandolBraille-Regular.otf: Fandol Braille,Fandol Braille Regular:style=Regular
/usr/share/fonts/fandol/FandolSong-Bold.otf: FandolSong:style=Bold
/usr/share/fonts/fandol/FandolKai-Regular.otf: FandolKai:style=Regular
/usr/share/fonts/fandol/FandolHei-Bold.otf: FandolHei:style=Bold
/usr/share/fonts/fandol/FandolSong-Regular.otf: FandolSong:style=Regular
/usr/share/fonts/fandol/FandolHei-Regular.otf: FandolHei:style=Regular
如何解决这些警告?
答案1
我找到了一个解决方法
改为 ,并\documentclass[a4paper, 12pt]{book}
删除 。\documentclass[a4paper, 12pt, fontset=windows]{ctexbook}
\usepackage{xeCJK}
然后将 Windows sim* 字体添加到 Linux 中。
虽然可以忽略它,但我还是不想看到它XD。