在我的 TeX Live 2021 发行版最近更新后,我在旧文档中收到以下类型的警告消息:
Font shape `TU/lmss/m/sc' in size <10> not available
(Font) Font shape `TU/lmr/m/sc' tried instead.
这导致文档的标题(在sffamily
和 中scshape
)与之前的结果看起来不同。有什么方法可以解决这个问题吗?
以下是 MWE:
%! TEX program = xelatex
\documentclass{article}
\usepackage{newpxtext}
\begin{document}
\textsf{\textsc{Some Text}}
\end{document}
以下是日志:
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2021-11-22> (/usr/local/texlive/2021/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count179
\c@section=\count180
\c@subsection=\count181
\c@subsubsection=\count182
\c@paragraph=\count183
\c@subparagraph=\count184
\c@figure=\count185
\c@table=\count186
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
) (/usr/local/texlive/2021/texmf-dist/tex/latex/newpx/newpxtext.sty
Package: newpxtext 2021/12/07 v1.501(Michael Sharpe) latex and unicode latex support for TeXGyrePagellaX
`newpxtext' v1.501, 2021/12/07 Text macros taking advantage of TeXGyre Pagella and its extensions (msharpe) (/usr/local/texlive/2021/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2021/04/29 v2.0v Standard LaTeX package
LaTeX Font Info: Trying to load font information for T1+lmr on input line 112.
(/usr/local/texlive/2021/texmf-dist/tex/latex/lm/t1lmr.fd
File: t1lmr.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
)) (/usr/local/texlive/2021/texmf-dist/tex/generic/iftex/ifxetex.sty
Package: ifxetex 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead.
(/usr/local/texlive/2021/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2020/03/06 v1.0d TeX engine tests
)) (/usr/local/texlive/2021/texmf-dist/tex/generic/iftex/ifluatex.sty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
) (/usr/local/texlive/2021/texmf-dist/tex/latex/xkeyval/xkeyval.sty
Package: xkeyval 2020/11/20 v2.8 package option processing (HA)
(/usr/local/texlive/2021/texmf-dist/tex/generic/xkeyval/xkeyval.tex (/usr/local/texlive/2021/texmf-dist/tex/generic/xkeyval/xkvutils.tex
\XKV@toks=\toks16
\XKV@tempa@toks=\toks17
(/usr/local/texlive/2021/texmf-dist/tex/generic/xkeyval/keyval.tex))
\XKV@depth=\count187
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
)) (/usr/local/texlive/2021/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count188
) (/usr/local/texlive/2021/texmf-dist/tex/latex/base/textcomp.sty
Package: textcomp 2020/02/02 v2.0n Standard LaTeX package
) (/usr/local/texlive/2021/texmf-dist/tex/generic/xstring/xstring.sty (/usr/local/texlive/2021/texmf-dist/tex/generic/xstring/xstring.tex
\integerpart=\count189
\decimalpart=\count190
)
Package: xstring 2021/07/21 v1.84 String manipulations (CT)
) (/usr/local/texlive/2021/texmf-dist/tex/latex/base/ifthen.sty
Package: ifthen 2020/11/24 v1.1c Standard LaTeX ifthen package (DPC)
) (/usr/local/texlive/2021/texmf-dist/tex/latex/carlisle/scalefnt.sty)
LaTeX Font Info: Setting zplLF sub-encoding to TS1/0 on input line 24.
LaTeX Font Info: Setting zplTLF sub-encoding to TS1/0 on input line 24.
LaTeX Font Info: Setting zplOsF sub-encoding to TS1/0 on input line 24.
LaTeX Font Info: Setting zplTOsF sub-encoding to TS1/0 on input line 24.
\zpl@cnt=\count191
(/usr/local/texlive/2021/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/local/texlive/2021/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/local/texlive/2021/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2021-11-22 L3 programming layer (loader)
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
File: l3backend-xetex.def 2021-12-14 L3 backend support: XeTeX
(|extractbb --version)
\c__kernel_sys_dvipdfmx_version_int=\count192
\l__color_backend_stack_int=\count193
\g__color_backend_stack_int=\count194
\g__graphics_track_int=\count195
\l__pdf_internal_box=\box50
\g__pdf_backend_object_int=\count196
\g__pdf_backend_annotation_int=\count197
\g__pdf_backend_link_int=\count198
))
Package: xparse 2021-11-12 L3 Experimental document command parser
)
Package: fontspec 2020/02/21 v2.7i Font selection for XeLaTeX and LuaLaTeX
(/usr/local/texlive/2021/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=\count199
\l__fontspec_language_int=\count266
\l__fontspec_strnum_int=\count267
\l__fontspec_tmp_int=\count268
\l__fontspec_tmpa_int=\count269
\l__fontspec_tmpb_int=\count270
\l__fontspec_tmpc_int=\count271
\l__fontspec_em_int=\count272
\l__fontspec_emdef_int=\count273
\l__fontspec_strong_int=\count274
\l__fontspec_strongdef_int=\count275
\l__fontspec_tmpa_dim=\dimen139
\l__fontspec_tmpb_dim=\dimen140
\l__fontspec_tmpc_dim=\dimen141
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2021/04/29 v2.0v Standard LaTeX package
) (/usr/local/texlive/2021/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
LaTeX Info: Redefining \textsl on input line 423.
(/usr/local/texlive/2021/texmf-dist/tex/latex/realscripts/realscripts.sty
Package: realscripts 2016/02/13 v0.3d Access OpenType subscripts and superscripts
\subsupersep=\dimen142
)
LaTeX Info: Redefining \textsu on input line 490.
LaTeX Info: Redefining \oldstylenums on input line 568.
LaTeX Info: Redefining \liningnums on input line 570.
) (/usr/local/texlive/2021/texmf-dist/tex/latex/newpx/TeXGyrePagellaX.fontspec)
Requested font "[TeXGyrePagellaX-Regular.otf]/OT" at 9.99997pt
-> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/newpx/TeXGyrePagellaX-Regular.otf
Requested font "[TeXGyrePagellaX-Regular.otf]/OT" at 10.00003pt
-> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/newpx/TeXGyrePagellaX-Regular.otf
Requested font "[TeXGyrePagellaX-Regular.otf]/OT:script=latn;language=dflt;" at 10.00003pt
-> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/newpx/TeXGyrePagellaX-Regular.otf
Requested font "[TeXGyrePagellaX-Bold.otf]/OT:script=latn;language=dflt;" at 10.00003pt
-> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/newpx/TeXGyrePagellaX-Bold.otf
Requested font "[TeXGyrePagellaX-Italic.otf]/OT:script=latn;language=dflt;" at 10.00003pt
-> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/newpx/TeXGyrePagellaX-Italic.otf
Requested font "[TeXGyrePagellaX-Slanted.otf]/OT:script=latn;language=dflt;" at 10.00003pt
-> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/newpx/TeXGyrePagellaX-Slanted.otf
Requested font "[TeXGyrePagellaX-BoldItalic.otf]/OT:script=latn;language=dflt;" at 10.00003pt
-> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/newpx/TeXGyrePagellaX-BoldItalic.otf
Requested font "[TeXGyrePagellaX-BoldSlanted.otf]/OT:script=latn;language=dflt;" at 10.00003pt
-> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/newpx/TeXGyrePagellaX-BoldSlanted.otf
Package fontspec Info: Font family 'TeXGyrePagellaX(0)' created for font
(fontspec) 'TeXGyrePagellaX' with options [Ligatures = TeX,Scale =
(fontspec) 1,Extension = .otf,SmallCapsFeatures={RawFeature =
(fontspec) +pcap, },Ligatures=TeX,Extension = .otf,UprightFont =
(fontspec) TeXGyrePagellaX-Regular,BoldFont =
(fontspec) TeXGyrePagellaX-Bold,ItalicFont =
(fontspec) TeXGyrePagellaX-Italic,BoldItalicFont =
(fontspec) TeXGyrePagellaX-BoldItalic,SlantedFont =
(fontspec) TeXGyrePagellaX-Slanted,BoldSlantedFont =
(fontspec) TeXGyrePagellaX-BoldSlanted,Numbers =
(fontspec) {Monospaced,Lining},UprightFont = *-Regular,ItalicFont
(fontspec) = *-Italic,SlantedFont = *-Slanted,BoldFont =
(fontspec) *-Bold,BoldItalicFont = *-BoldItalic,BoldSlantedFont=
(fontspec) *-BoldSlanted].
(fontspec)
(fontspec) This font family consists of the following NFSS
(fontspec) series/shapes:
(fontspec)
(fontspec) - 'normal' (m/n) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-Regular.otf]/OT:script=latn;language=dflt;+tnum;+lnum;mapping=tex-text;"
(fontspec) - 'small caps' (m/sc) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-Regular.otf]/OT:script=latn;language=dflt;+tnum;+lnum;+smcp;+pcap;mapping=tex-text;"
(fontspec) - 'bold' (b/n) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-Bold.otf]/OT:script=latn;language=dflt;+tnum;+lnum;mapping=tex-text;"
(fontspec) - 'bold small caps' (b/sc) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-Bold.otf]/OT:script=latn;language=dflt;+tnum;+lnum;+smcp;+pcap;mapping=tex-text;"
(fontspec) - 'italic' (m/it) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-Italic.otf]/OT:script=latn;language=dflt;+tnum;+lnum;mapping=tex-text;"
(fontspec) - 'italic small caps' (m/scit) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-Italic.otf]/OT:script=latn;language=dflt;+tnum;+lnum;+smcp;+pcap;mapping=tex-text;"
(fontspec) - 'slanted' (m/sl) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-Slanted.otf]/OT:script=latn;language=dflt;+tnum;+lnum;mapping=tex-text;"
(fontspec) - 'slanted small caps' (m/scsl) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-Slanted.otf]/OT:script=latn;language=dflt;+tnum;+lnum;+smcp;+pcap;mapping=tex-text;"
(fontspec) - 'bold italic' (b/it) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-BoldItalic.otf]/OT:script=latn;language=dflt;+tnum;+lnum;mapping=tex-text;"
(fontspec) - 'bold italic small caps' (b/scit) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-BoldItalic.otf]/OT:script=latn;language=dflt;+tnum;+lnum;+smcp;+pcap;mapping=tex-text;"
(fontspec) - 'bold slanted' (b/sl) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-BoldSlanted.otf]/OT:script=latn;language=dflt;+tnum;+lnum;mapping=tex-text;"
(fontspec) - 'bold slanted small caps' (b/scsl) with NFSS spec.:
(fontspec) <->s*[1]"[TeXGyrePagellaX-BoldSlanted.otf]/OT:script=latn;language=dflt;+tnum;+lnum;+smcp;+pcap;mapping=tex-text;"
LaTeX Font Info: Font shape `TU/TeXGyrePagellaX(0)/m/n' will be
(Font) scaled to size 10.0pt on input line 6.
Requested font "[TeXGyrePagellaX-Regular.otf]/OT:script=latn;language=dflt;+tnum;+lnum;mapping=tex-text;" at 10.0pt
-> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/newpx/TeXGyrePagellaX-Regular.otf
(./sf-font-test.aux)
\openout1 = `sf-font-test.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 6.
LaTeX Font Info: Trying to load font information for TS1+cmr on input line 6.
(/usr/local/texlive/2021/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 6.
LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
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 6.
LaTeX Font Info: Redeclaring math accent \acute on input line 6.
LaTeX Font Info: Redeclaring math accent \grave on input line 6.
LaTeX Font Info: Redeclaring math accent \ddot on input line 6.
LaTeX Font Info: Redeclaring math accent \tilde on input line 6.
LaTeX Font Info: Redeclaring math accent \bar on input line 6.
LaTeX Font Info: Redeclaring math accent \breve on input line 6.
LaTeX Font Info: Redeclaring math accent \check on input line 6.
LaTeX Font Info: Redeclaring math accent \hat on input line 6.
LaTeX Font Info: Redeclaring math accent \dot on input line 6.
LaTeX Font Info: Redeclaring math accent \mathring on input line 6.
LaTeX Font Info: Redeclaring math symbol \colon on input line 6.
LaTeX Font Info: Redeclaring math symbol \Gamma on input line 6.
LaTeX Font Info: Redeclaring math symbol \Delta on input line 6.
LaTeX Font Info: Redeclaring math symbol \Theta on input line 6.
LaTeX Font Info: Redeclaring math symbol \Lambda on input line 6.
LaTeX Font Info: Redeclaring math symbol \Xi on input line 6.
LaTeX Font Info: Redeclaring math symbol \Pi on input line 6.
LaTeX Font Info: Redeclaring math symbol \Sigma on input line 6.
LaTeX Font Info: Redeclaring math symbol \Upsilon on input line 6.
LaTeX Font Info: Redeclaring math symbol \Phi on input line 6.
LaTeX Font Info: Redeclaring math symbol \Psi on input line 6.
LaTeX Font Info: Redeclaring math symbol \Omega on input line 6.
LaTeX Font Info: Redeclaring math symbol \mathdollar on input line 6.
LaTeX Font Info: Redeclaring symbol font `operators' on input line 6.
LaTeX Font Info: Encoding `OT1' has changed to `TU' for symbol font
(Font) `operators' in the math version `normal' on input line 6.
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) OT1/cmr/m/n --> TU/TeXGyrePagellaX(0)/m/n on input line 6.
LaTeX Font Info: Encoding `OT1' has changed to `TU' for symbol font
(Font) `operators' in the math version `bold' on input line 6.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) OT1/cmr/bx/n --> TU/TeXGyrePagellaX(0)/m/n on input line 6.
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) TU/TeXGyrePagellaX(0)/m/n --> TU/TeXGyrePagellaX(0)/m/n on input line 6.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
(Font) OT1/cmr/m/it --> TU/TeXGyrePagellaX(0)/m/it on input line 6.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
(Font) OT1/cmr/bx/n --> TU/TeXGyrePagellaX(0)/b/n on input line 6.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
(Font) OT1/cmss/m/n --> TU/lmss/m/n on input line 6.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
(Font) OT1/cmtt/m/n --> TU/lmtt/m/n on input line 6.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) TU/TeXGyrePagellaX(0)/m/n --> TU/TeXGyrePagellaX(0)/b/n on input line 6.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) OT1/cmr/bx/it --> TU/TeXGyrePagellaX(0)/b/it on input line 6.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
(Font) OT1/cmss/bx/n --> TU/lmss/b/n on input line 6.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
(Font) OT1/cmtt/m/n --> TU/lmtt/b/n on input line 6.
Requested font "[lmsans10-regular]:mapping=tex-text;" at 10.0pt
-> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/lm/lmsans10-regular.otf
LaTeX Font Warning: Font shape `TU/lmss/m/sc' in size <10> not available
(Font) Font shape `TU/lmr/m/sc' tried instead on input line 8.
Requested font "[lmromancaps10-regular]:mapping=tex-text;" at 10.0pt
-> /usr/local/texlive/2021/texmf-dist/fonts/opentype/public/lm/lmromancaps10-regular.otf
答案1
使用以前的版本时newpxtext
您没有获得 OpenType 字体:
<[email protected](TFM:ec-qhvr-sc)(Encoding:q-ec-sc.enc)
pdf_font>> Simple font "qhvr.pfb" enc_id=<q-ec-sc.enc,3> opened at font_id=<ec-qhvr-sc,0>.
><[email protected](TFM:zpl-Regular-tlf-t1)(Encoding:ntx-ec-tlf.enc)
pdf_font>> Simple font "zplr.pfb" enc_id=<ntx-ec-tlf.enc,4> opened at font_id=<zpl-Regular-tlf-t1,1>.
>](qhvr.pfb[Type1])(zplr.pfb[Type1])
在新版本中,fontspec
使用 TeX Gyre PagellaX 作为主要字体,但没有选择无衬线字体。因此,您得到的是 Latin Modern Sans,它没有小写无衬线字体。
您需要声明一种无衬线字体,例如 TeX Gyre Heros。
\documentclass{article}
\usepackage{newpxtext}
\setsansfont{texgyreheros}[
Scale=MatchLowercase,
UprightFont=*-regular,
BoldFont=*-bold,
ItalicFont=*-italic,
BoldItalicFont=*-bolditalic,
]
\begin{document}
Xyz \textsf{\textsc{Some Text}}
\end{document}