babel:使用 Google NotoFonts 混合英文和中文

babel:使用 Google NotoFonts 混合英文和中文

目标

  • 我的目标是拥有一份包含两种语言的文档,英语(简体中文
  • 两种语言的出现量相同(一段英文进而一段中文)。
  • 我编译LuaLaTeX使用TeXLive
  • 我想使用能登提供的字体谷歌
  • 稍后我想使用KOMA文档类(而不是中文特定的文档类)。

平均能量损失

\documentclass{article}

\usepackage[english]{babel}
% babelprovide for *english* (default language of the document)
\babelprovide[
    main,
    import,
    language = Default]
    {english}

% babelprovide for *chinese-simplified*
\babelprovide[
    import,
    language = Chinese Simplified]
    {chinese-simplified}

%% Choose actual fonts for different font variants.
% Font for font variant "rm" (Serif)
\babelfont{rm}{Noto Serif}
% Font for font variant "sf" (Sans Serif --> Without Serif)
\babelfont{sf}{Noto Sans}
% Font for font variant "chinese-simplified"
\babelfont[chinese-simplified]{rm}{Noto Serif CJK SC}

\begin{document}

\tableofcontents

%% English -------------------------
\selectlanguage{english}

\section{Test}

\textbf{Test}
\begin{itemize}
\item Test
\item Test
\item Test
\end{itemize}
Test

%% Chinese -------------------------
\selectlanguage{chinese-simplified}

\section{杂杂杂}

\textbf{文文文文文文文文}
\begin{itemize}
\item 图图图图图图
\item 中中中中中中
\item 杂杂杂杂杂杂
\end{itemize}
文文文文文文文文

%% English -------------------------
\selectlanguage{english}

\section{Test}

\textbf{Test}
\begin{itemize}
\item Test
\item Test
\item Test
\end{itemize}
Test

\end{document}

在此处输入图片描述

TeXLive 字体状态

我的 TeXLive 安装中有几个 Noto 字体文件夹。我假设这些opentype文件夹在我使用 LuaLaTeX 时会用到。

  • C:\texlive\2019\texmf-dist\fonts\type1\google\noto
  • C:\texlive\2019\texmf-dist\fonts\tfm\google\noto
  • C:\texlive\2019\texmf-dist\fonts\truetype\google\noto
  • C:\texlive\2019\texmf-dist\fonts\opentype\google\noto
  • C:\texlive\2019\texmf-dist\fonts\opentype\google\notocjksc(中文字体)

在此处输入图片描述

在此处输入图片描述

日志档案

(c:/texlive/2019/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2018/08/11 v2.0j Standard LaTeX package

(c:/texlive/2019/texmf-dist/tex/latex/base/tuenc.def
File: tuenc.def 2018/08/11 v2.0j Standard LaTeX file
LaTeX Font Info:    Redeclaring font encoding TU on input line 82.
))
(c:/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec.cfg)
LaTeX Info: Redefining \itshape on input line 3785.
LaTeX Info: Redefining \slshape on input line 3790.
LaTeX Info: Redefining \scshape on input line 3795.
LaTeX Info: Redefining \upshape on input line 3800.
LaTeX Info: Redefining \em on input line 3830.
LaTeX Info: Redefining \emph on input line 3855.
))
luaotfload | cache : Lookup cache loaded from C:/Users/Biest/.texlive2019/texmf-
var/luatex-cache/generic/names/luaotfload-lookup-cache.luc.

Package fontspec Info: Font family 'NotoSerif(0)' created for font 'Noto
(fontspec)             Serif' with options
(fontspec)             [Ligatures=TeX,Script=Latin,Language=Default].
(fontspec)              
(fontspec)              This font family consists of the following NFSS
(fontspec)             series/shapes:
(fontspec)              
(fontspec)             - 'normal' (m/n) with NFSS spec.:
(fontspec)             <->"NotoSerif:mode=node;script=latn;language=DFLT;+tlig;"

(fontspec)             - 'small caps'  (m/sc) with NFSS spec.:
(fontspec)             <->"NotoSerif:mode=node;script=latn;language=DFLT;+tlig;+
smcp;"
(fontspec)             - 'bold' (bx/n) with NFSS spec.:
(fontspec)             <->"NotoSerif/B:mode=node;script=latn;language=DFLT;+tlig
;"
(fontspec)             - 'bold small caps'  (bx/sc) with NFSS spec.:
(fontspec)             <->"NotoSerif/B:mode=node;script=latn;language=DFLT;+tlig
;+smcp;"
(fontspec)             - 'italic' (m/it) with NFSS spec.:
(fontspec)             <->"NotoSerif/I:mode=node;script=latn;language=DFLT;+tlig
;"
(fontspec)             - 'italic small caps'  (m/itsc) with NFSS spec.:
(fontspec)             <->"NotoSerif/I:mode=node;script=latn;language=DFLT;+tlig
;+smcp;"
(fontspec)             - 'bold italic' (bx/it) with NFSS spec.:
(fontspec)             <->"NotoSerif/BI:mode=node;script=latn;language=DFLT;+tli
g;"
(fontspec)             - 'bold italic small caps'  (bx/itsc) with NFSS spec.:
(fontspec)             <->"NotoSerif/BI:mode=node;script=latn;language=DFLT;+tli
g;+smcp;"


Package fontspec Info: Font family 'NotoSans(0)' created for font 'Noto Sans'
(fontspec)             with options
(fontspec)             [Ligatures=TeX,Script=Latin,Language=Default].
(fontspec)              
(fontspec)              This font family consists of the following NFSS
(fontspec)             series/shapes:
(fontspec)              
(fontspec)             - 'normal' (m/n) with NFSS spec.:
(fontspec)             <->"NotoSans:mode=node;script=latn;language=DFLT;+tlig;"
(fontspec)             - 'small caps'  (m/sc) with NFSS spec.:
(fontspec)             <->"NotoSans:mode=node;script=latn;language=DFLT;+tlig;+s
mcp;"
(fontspec)             - 'bold' (bx/n) with NFSS spec.:
(fontspec)             <->"NotoSans/B:mode=node;script=latn;language=DFLT;+tlig;
"
(fontspec)             - 'bold small caps'  (bx/sc) with NFSS spec.:
(fontspec)             <->"NotoSans/B:mode=node;script=latn;language=DFLT;+tlig;
+smcp;"
(fontspec)             - 'italic' (m/it) with NFSS spec.:
(fontspec)             <->"NotoSans/I:mode=node;script=latn;language=DFLT;+tlig;
"
(fontspec)             - 'italic small caps'  (m/itsc) with NFSS spec.:
(fontspec)             <->"NotoSans/I:mode=node;script=latn;language=DFLT;+tlig;
+smcp;"
(fontspec)             - 'bold italic' (bx/it) with NFSS spec.:
(fontspec)             <->"NotoSans/BI:mode=node;script=latn;language=DFLT;+tlig
;"
(fontspec)             - 'bold italic small caps'  (bx/itsc) with NFSS spec.:
(fontspec)             <->"NotoSans/BI:mode=node;script=latn;language=DFLT;+tlig
;+smcp;"


Package fontspec Info: Could not resolve font "NotoSansMono/BI" (it probably
(fontspec)             doesn't exist).


Package fontspec Info: Could not resolve font "NotoSansMono/I" (it probably
(fontspec)             doesn't exist).


Package fontspec Info: Font family 'NotoSansMono(0)' created for font 'Noto
(fontspec)             Sans Mono' with options
(fontspec)             [WordSpace={1,0,0},HyphenChar=None,PunctuationSpace=WordS
pace,Script=Latin,Language=Default].
(fontspec)              
(fontspec)              This font family consists of the following NFSS
(fontspec)             series/shapes:
(fontspec)              
(fontspec)             - 'normal' (m/n) with NFSS spec.:
(fontspec)             <->"NotoSansMono:mode=node;script=latn;language=DFLT;"
(fontspec)             - 'small caps'  (m/sc) with NFSS spec.:
(fontspec)             <->"NotoSansMono:mode=node;script=latn;language=DFLT;+smc
p;"
(fontspec)             and font adjustment code:
(fontspec)             \fontdimen 2\font =1\fontdimen 2\font \fontdimen 3\font
(fontspec)             =0\fontdimen 3\font \fontdimen 4\font =0\fontdimen
(fontspec)             4\font \fontdimen 7\font =0\fontdimen 2\font
(fontspec)             \tex_hyphenchar:D \font =-1\scan_stop: 
(fontspec)             - 'bold' (bx/n) with NFSS spec.:
(fontspec)             <->"NotoSansMono/B:mode=node;script=latn;language=DFLT;"
(fontspec)             - 'bold small caps'  (bx/sc) with NFSS spec.:
(fontspec)             <->"NotoSansMono/B:mode=node;script=latn;language=DFLT;+s
mcp;"
(fontspec)             and font adjustment code:
(fontspec)             \fontdimen 2\font =1\fontdimen 2\font \fontdimen 3\font
(fontspec)             =0\fontdimen 3\font \fontdimen 4\font =0\fontdimen
(fontspec)             4\font \fontdimen 7\font =0\fontdimen 2\font
(fontspec)             \tex_hyphenchar:D \font =-1\scan_stop: 

 (./test.aux

Package fontspec Info: Could not resolve font "NotoSerifCJKSC/BI" (it probably
(fontspec)             doesn't exist).


Package fontspec Info: Could not resolve font "NotoSerifCJKSC/B" (it probably
(fontspec)             doesn't exist).


Package fontspec Info: Could not resolve font "NotoSerifCJKSC/I" (it probably
(fontspec)             doesn't exist).

luaotfload | aux : font no 55 (nil) does not define feature smcp for script hani
 with language zhs

Package fontspec Info: Font family 'NotoSerifCJKSC(0)' created for font 'Noto
(fontspec)             Serif CJK SC' with options
(fontspec)             [Ligatures=TeX,Script=Simplified,Language=Chinese
(fontspec)             Simplified].
(fontspec)              
(fontspec)              This font family consists of the following NFSS
(fontspec)             series/shapes:
(fontspec)              
(fontspec)             - 'normal' (m/n) with NFSS spec.:
(fontspec)             <->"NotoSerifCJKSC:mode=node;script=hani;language=ZHS;+tl
ig;"
(fontspec)             - 'small caps'  (m/sc) with NFSS spec.: 

luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: "Font NotoSan
sCJKSC not found.".
luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

! Package fontspec Error: The font "NotoSansCJKSC" cannot be found.

For immediate help type H <return>.
 ...                                              

l.6 \babel@aux{chinese-simplified}{}


A font might not be found for many reasons.
 Check the spelling, where the font is installed etc. etc.

 When in doubt, ask someone for help!


luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
luaotfload | aux : no font with id 0

Package fontspec Warning: Font "NotoSansCJKSC" does not contain requested
(fontspec)                Script "Simplified".

luaotfload | aux : no font with id 0
luaotfload | aux : no font with id 0

Package fontspec Warning: Language 'Chinese Simplified' not available for font
(fontspec)                'NotoSansCJKSC' with script ''.

luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

Package fontspec Info: Could not resolve font "NotoSansCJKSC/BI" (it probably
(fontspec)             doesn't exist).

luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

Package fontspec Info: Could not resolve font "NotoSansCJKSC/B" (it probably
(fontspec)             doesn't exist).

luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

Package fontspec Info: Could not resolve font "NotoSansCJKSC/I" (it probably
(fontspec)             doesn't exist).

luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

! Package fontspec Error: The font "NotoSansCJKSC" cannot be found.

For immediate help type H <return>.
 ...                                              

l.6 \babel@aux{chinese-simplified}{}


A font might not be found for many reasons.
 Check the spelling, where the font is installed etc. etc.

 When in doubt, ask someone for help!


luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

! Package fontspec Error: The font "NotoSansCJKSC" cannot be found.

For immediate help type H <return>.
 ...                                              

l.6 \babel@aux{chinese-simplified}{}


A font might not be found for many reasons.
 Check the spelling, where the font is installed etc. etc.

 When in doubt, ask someone for help!



Package fontspec Info: Font family 'NotoSansCJKSC(0)' created for font 'Noto
(fontspec)             Sans CJK SC' with options
(fontspec)             [Ligatures=TeX,Script=Simplified,Language=Chinese
(fontspec)             Simplified].
(fontspec)              
(fontspec)              This font family consists of the following NFSS
(fontspec)             series/shapes:
(fontspec)              
(fontspec)             - 'normal' (m/n) with NFSS spec.:
(fontspec)             <->"NotoSansCJKSC:mode=node;+tlig;"
(fontspec)             - 'small caps'  (m/sc) with NFSS spec.: 

luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
! Font \TU/NotoSansCJKSC(0)/m/n/10=NotoSansCJKSC:mode=node;+tlig; at 10pt not lo
adable: metric data not found or bad.
<to be read again> 
relax 
l.6 \babel@aux{chinese-simplified}{}

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>'.

luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

! Package fontspec Error: The font "NotoSansMonoCJKSC" cannot be found.

For immediate help type H <return>.
 ...                                              

l.6 \babel@aux{chinese-simplified}{}


A font might not be found for many reasons.
 Check the spelling, where the font is installed etc. etc.

 When in doubt, ask someone for help!


luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
luaotfload | aux : no font with id 0

Package fontspec Warning: Font "NotoSansMonoCJKSC" does not contain requested
(fontspec)                Script "Simplified".

luaotfload | aux : no font with id 0
luaotfload | aux : no font with id 0

Package fontspec Warning: Language 'Chinese Simplified' not available for font
(fontspec)                'NotoSansMonoCJKSC' with script ''.

luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

Package fontspec Info: Could not resolve font "NotoSansMonoCJKSC/BI" (it
(fontspec)             probably doesn't exist).

luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

Package fontspec Info: Could not resolve font "NotoSansMonoCJKSC/B" (it
(fontspec)             probably doesn't exist).

luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

Package fontspec Info: Could not resolve font "NotoSansMonoCJKSC/I" (it
(fontspec)             probably doesn't exist).

luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

! Package fontspec Error: The font "NotoSansMonoCJKSC" cannot be found.

For immediate help type H <return>.
 ...                                              

l.6 \babel@aux{chinese-simplified}{}


A font might not be found for many reasons.
 Check the spelling, where the font is installed etc. etc.

 When in doubt, ask someone for help!


luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

! Package fontspec Error: The font "NotoSansMonoCJKSC" cannot be found.

For immediate help type H <return>.
 ...                                              

l.6 \babel@aux{chinese-simplified}{}


A font might not be found for many reasons.
 Check the spelling, where the font is installed etc. etc.

 When in doubt, ask someone for help!



Package fontspec Info: Font family 'NotoSansMonoCJKSC(0)' created for font
(fontspec)             'Noto Sans Mono CJK SC' with options
(fontspec)             [WordSpace={1,0,0},HyphenChar=None,PunctuationSpace=WordS
pace,Script=Simplified,Language=Chinese
(fontspec)             Simplified].
(fontspec)              
(fontspec)              This font family consists of the following NFSS
(fontspec)             series/shapes:
(fontspec)              
(fontspec)             - 'normal' (m/n) with NFSS spec.:
(fontspec)             <->"NotoSansMonoCJKSC:mode=node;"
(fontspec)             - 'small caps'  (m/sc) with NFSS spec.: 
(fontspec)             and font adjustment code:
(fontspec)             \fontdimen 2\font =1\fontdimen 2\font \fontdimen 3\font
(fontspec)             =0\fontdimen 3\font \fontdimen 4\font =0\fontdimen
(fontspec)             4\font \fontdimen 7\font =0\fontdimen 2\font
(fontspec)             \tex_hyphenchar:D \font =-1\scan_stop: 

luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.
! Font \TU/NotoSansMonoCJKSC(0)/m/n/10=NotoSansMonoCJKSC:mode=node; at 10pt not 
loadable: metric data not found or bad.
<to be read again> 
relax 
l.6 \babel@aux{chinese-simplified}{}

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>'.

)
\openout1 = test.aux

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 35.
LaTeX Font Info:    ... okay on input line 35.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 35.
LaTeX Font Info:    ... okay on input line 35.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 35.
LaTeX Font Info:    ... okay on input line 35.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 35.
LaTeX Font Info:    ... okay on input line 35.
LaTeX Font Info:    Checking defaults for TU/lmr/m/n on input line 35.
LaTeX Font Info:    ... okay on input line 35.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 35.
LaTeX Font Info:    ... okay on input line 35.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 35.
LaTeX Font Info:    ... okay on input line 35.

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 35.
LaTeX Font Info:    Redeclaring math accent \acute on input line 35.
LaTeX Font Info:    Redeclaring math accent \grave on input line 35.
LaTeX Font Info:    Redeclaring math accent \ddot on input line 35.
LaTeX Font Info:    Redeclaring math accent \tilde on input line 35.
LaTeX Font Info:    Redeclaring math accent \bar on input line 35.
LaTeX Font Info:    Redeclaring math accent \breve on input line 35.
LaTeX Font Info:    Redeclaring math accent \check on input line 35.
LaTeX Font Info:    Redeclaring math accent \hat on input line 35.
LaTeX Font Info:    Redeclaring math accent \dot on input line 35.
LaTeX Font Info:    Redeclaring math accent \mathring on input line 35.
LaTeX Font Info:    Redeclaring math symbol \colon on input line 35.
LaTeX Font Info:    Redeclaring math symbol \Gamma on input line 35.
LaTeX Font Info:    Redeclaring math symbol \Delta on input line 35.
LaTeX Font Info:    Redeclaring math symbol \Theta on input line 35.
LaTeX Font Info:    Redeclaring math symbol \Lambda on input line 35.
LaTeX Font Info:    Redeclaring math symbol \Xi on input line 35.
LaTeX Font Info:    Redeclaring math symbol \Pi on input line 35.
LaTeX Font Info:    Redeclaring math symbol \Sigma on input line 35.
LaTeX Font Info:    Redeclaring math symbol \Upsilon on input line 35.
LaTeX Font Info:    Redeclaring math symbol \Phi on input line 35.
LaTeX Font Info:    Redeclaring math symbol \Psi on input line 35.
LaTeX Font Info:    Redeclaring math symbol \Omega on input line 35.
LaTeX Font Info:    Redeclaring math symbol \mathdollar on input line 35.
LaTeX Font Info:    Redeclaring symbol font `operators' on input line 35.
LaTeX Font Info:    Encoding `OT1' has changed to `TU' for symbol font
(Font)              `operators' in the math version `normal' on input line 35.
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  OT1/cmr/m/n --> TU/NotoSerif(0)/m/n on input line 35.
LaTeX Font Info:    Encoding `OT1' has changed to `TU' for symbol font
(Font)              `operators' in the math version `bold' on input line 35.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  OT1/cmr/bx/n --> TU/NotoSerif(0)/m/n on input line 35.
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  TU/NotoSerif(0)/m/n --> TU/NotoSerif(0)/m/n on input lin
e 35.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `normal'
(Font)                  OT1/cmr/m/it --> TU/NotoSerif(0)/m/it on input line 35.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `normal'
(Font)                  OT1/cmr/bx/n --> TU/NotoSerif(0)/bx/n on input line 35.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `normal'
(Font)                  OT1/cmss/m/n --> TU/NotoSans(0)/m/n on input line 35.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `normal'
(Font)                  OT1/cmtt/m/n --> TU/NotoSansMono(0)/m/n on input line 35
.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  TU/NotoSerif(0)/m/n --> TU/NotoSerif(0)/bx/n on input li
ne 35.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `bold'
(Font)                  OT1/cmr/bx/it --> TU/NotoSerif(0)/bx/it on input line 35
.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `bold'
(Font)                  OT1/cmss/bx/n --> TU/NotoSans(0)/bx/n on input line 35.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `bold'
(Font)                  OT1/cmtt/m/n --> TU/NotoSansMono(0)/bx/n on input line 3
5.
 (./test.toc

LaTeX Font Warning: Font shape `TU/NotoSerifCJKSC(0)/bx/n' undefined
(Font)              using `TU/NotoSerifCJKSC(0)/m/n' instead on input line 5.

)
\tf@toc=\write3

\openout3 = test.toc
 [1

{c:/texlive/2019/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux)

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

)

疑问/问题

  1. 我的代码是否正确/是否符合预期目的的最佳实践?
  2. 我不明白大胆的汉字,尽管在我看来它们是可用的。
  3. itemize奇怪的是,连中文部分的要点都变了。
  4. 当我添加\babelfont[chinese-simplified]{sf}{Noto Sans CJK SC}(无衬线中文字体)时出现错误:! Package fontspec Error: The font "NotoSansCJKSC" cannot be found.。我不明白为什么(NotoSansCJKsc-Regular.otf与)位于同一字体文件夹中NotoSerifCJKsc-Regular.otf

更新

用户大卫·普顿建议以下字体设置:

\babelfont{rm}{Noto Serif} 
\babelfont{sf}{Noto Sans} 
\babelfont{tt}{Noto Sans Mono} 
\babelfont[chinese-simplified]{rm}{Noto Serif CJK SC} 
\babelfont[chinese-simplified]{sf}{Noto Sans CJK SC} 
\babelfont[chinese-simplified]{tt}{Noto Sans Mono CJK SC}

答案1

从评论中可以看出,你已将 CJK 字体复制到主 TeXLive 树中。但是,除非对它们进行索引,否则 TeX 无法找到它们。

您可以通过文件名加载字体(见下文),或者在本地 texmf 树中安装字体。

您可以通过运行以下命令找到它:

kpsewhich -var-value=TEXMFHOME

字体应该放在

$TEXMFHOME/fonts/opentype/google/notocjksc/

TeX 可以自动找到这些。您可以通过运行来确认这一点

`kpsewhich NotoSansCJKsc-Regular.otf`

并且应该返回字体的完整路径。

要通过文件名加载字体,您可以使用:

\babelfont[chinese-simplified]{rm}[
  Path = C:/texlive/2019/texmf-dist/fonts/opentype/google/notocjksc/ ,
  Extension = .otf ,
  UprightFont = *-Regular ,
  BoldFont = *-Bold ,
  ItalicFont = *-Regular ,
  BoldItalicFont = *-Bold]{NotoSerifCJKsc}

\babelfont[chinese-simplified]{sf}[
  Path = C:/texlive/2019/texmf-dist/fonts/opentype/google/notocjksc/ ,
  Extension = .otf ,
  UprightFont = *-Regular ,
  BoldFont = *-Bold ,
  ItalicFont = *-Regular ,
  BoldItalicFont = *-Bold]{NotoSansCJKsc}

\babelfont[chinese-simplified]{tt}[
  Path = C:/texlive/2019/texmf-dist/fonts/opentype/google/notocjksc/ ,
  Extension = .otf ,
  UprightFont = *-Regular ,
  BoldFont = *-Bold ,
  ItalicFont = *-Regular ,
  BoldItalicFont = *-Bold]{NotoSansMonoCJKsc}

相关内容