妇女权利委员会:
\documentclass{article}
\usepackage[lighttt]{lmodern}
\usepackage[T1]{fontenc}
\ttfamily
\DeclareFontFamily{T1}{lmtt}{}
\DeclareFontShape{T1}{lmtt}{m}{it}{
<-> ssub * lmtt/m/sl
}{}
\begin{document}
\itshape \texttt{\textquotesingle}
\end{document}
这些线条\ttfamily ... lmtt/m/sl}{}
用于将光的斜体定义lmtt
为该系列的倾斜形状m
。
我尝试了键盘上的所有其他符号。都没有,.<>?/;:"\|[]{}~-_=+!@#$%^&*()
造成任何问题。只`'
产生了这个错误。
我想要产生的效果:浅色字体和 T1 编码的倾斜撇号lmtt
。
语境:
我正在使用包minted
来包含一些代码,其中注释中有撇号(由 转换为\PYGZsq{}
)minted
,并且我选择的样式将注释斜体化。错误在.pgytex
由 创建的文件中弹出minted
,说No declaration for shape TS1/lmtt/l/sl.
显然最快的解决方案是删除代码中的那个撇号。但是,我想进一步了解为什么会出现此错误,以及我是否可以达到我希望的效果。
我猜想包含此上下文的不太简单的工作示例将是:
\documentclass{article}
\usepackage[lighttt]{lmodern}
\usepackage[T1]{fontenc}
\usepackage{minted}
\ttfamily
\DeclareFontFamily{T1}{lmtt}{}
\DeclareFontShape{T1}{lmtt}{m}{it}{
<-> ssub * lmtt/m/sl
}{}
\begin{document}
\begin{minted}{python}
# '
\end{minted}
\end{document}
编辑以添加:
日志文件和.pygtex
文件 - 均来自第二个 MWE - 已附加。
日志
This is XeTeX, Version 3.141592653-2.6-0.999994 (MiKTeX 22.3) (preloaded format=xelatex 2022.4.28) 30 APR 2022 10:14
entering extended mode
\write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**"c:/Users/Yukai_Qian/Downloads/LaTeX Experiments/lmtt-l-sl-apostrophe/lmtt-l-sl-apostrophe.tex"
(c:/Users/Yukai_Qian/Downloads/LaTeX Experiments/lmtt-l-sl-apostrophe/lmtt-l-sl-apostrophe.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-04-10> (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count181
\c@section=\count182
\c@subsection=\count183
\c@subsubsection=\count184
\c@paragraph=\count185
\c@subparagraph=\count186
\c@figure=\count187
\c@table=\count188
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/lm\lmodern.sty
Package: lmodern 2009/10/30 v1.6 Latin Modern Fonts
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22.
LaTeX Font Info: Overwriting symbol font `letters' in version `normal'
(Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23.
LaTeX Font Info: Overwriting symbol font `symbols' in version `normal'
(Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal'
(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26.
LaTeX Font Info: Overwriting symbol font `letters' in version `bold'
(Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27.
LaTeX Font Info: Overwriting symbol font `symbols' in version `bold'
(Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold'
(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
(Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
(Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
(Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38.
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\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.
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/lm\t1lmr.fd
File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
)) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/minted\minted.sty
Package: minted 2021/12/24 v2.6 Yet another Pygments shim for LaTeX
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/graphics\keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks16
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/kvoptions\kvoptions.sty
Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/generic/ltxcmds\ltxcmds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/generic/kvsetkeys\kvsetkeys.sty
Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)
)) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/fvextra\fvextra.sty
Package: fvextra 2019/02/04 v1.4 fvextra - extensions and patches for fancyvrb
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/base\ifthen.sty
Package: ifthen 2020/11/24 v1.1c Standard LaTeX ifthen package (DPC)
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/etoolbox\etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count189
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/fancyvrb\fancyvrb.sty
Package: fancyvrb 2022/04/12 4.2 verbatim text (tvz,hv)
\FV@CodeLineNo=\count190
\FV@InFile=\read2
\FV@TabBox=\box50
\c@FancyVerbLine=\count191
\FV@StepNumber=\count192
\FV@OutFile=\write3
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/upquote\upquote.sty
Package: upquote 2012/04/19 v1.3 upright-quote and grave-accent glyphs in verbatim
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/base\textcomp.sty
Package: textcomp 2020/02/02 v2.0n Standard LaTeX package
)) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/lineno\lineno.sty
Package: lineno 2005/11/02 line numbers on paragraphs v4.41
Invalid UTF-8 byte or sequence at line 296 replaced by U+FFFD.
\linenopenalty=\count193
\output=\toks17
\linenoprevgraf=\count194
\linenumbersep=\dimen139
\linenumberwidth=\dimen140
\c@linenumber=\count195
\c@pagewiselinenumber=\count196
\c@LN@truepage=\count197
\c@internallinenumber=\count198
\c@internallinenumbers=\count199
\quotelinenumbersep=\dimen141
\bframerule=\dimen142
\bframesep=\dimen143
\bframebox=\box51
LaTeX Info: Redefining \\ on input line 3056.
)
\c@FV@TrueTabGroupLevel=\count266
\c@FV@TrueTabCounter=\count267
\FV@TabBox@Group=\box52
\FV@TmpLength=\skip49
\c@FV@HighlightLinesStart=\count268
\c@FV@HighlightLinesStop=\count269
\FV@LoopCount=\count270
\FV@NCharsBox=\box53
\FV@BreakIndent=\dimen144
\FV@BreakIndentNChars=\count271
\FV@BreakSymbolSepLeft=\dimen145
\FV@BreakSymbolSepLeftNChars=\count272
\FV@BreakSymbolSepRight=\dimen146
\FV@BreakSymbolSepRightNChars=\count273
\FV@BreakSymbolIndentLeft=\dimen147
\FV@BreakSymbolIndentLeftNChars=\count274
\FV@BreakSymbolIndentRight=\dimen148
\FV@BreakSymbolIndentRightNChars=\count275
\c@FancyVerbLineBreakLast=\count276
\FV@LineBox=\box54
\FV@LineIndentBox=\box55
\FV@LineWidth=\dimen149
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/tools\calc.sty
Package: calc 2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count277
\calc@Bcount=\count278
\calc@Adimen=\dimen150
\calc@Bdimen=\dimen151
\calc@Askip=\skip50
\calc@Bskip=\skip51
LaTeX Info: Redefining \setlength on input line 80.
LaTeX Info: Redefining \addtolength on input line 81.
\calc@Ccount=\count279
\calc@Cskip=\skip52
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/tools\shellesc.sty
Package: shellesc 2019/11/08 v1.0c unified shell escape interface for LaTeX
Package shellesc Info: Unrestricted shell escape enabled on input line 75.
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/ifplatform\ifplatform.sty
Package: ifplatform 2017/10/13 v0.4a Testing for the operating system
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/generic/pdftexcmds\pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO)
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/generic/infwarerr\infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/generic/iftex\iftex.sty
Package: iftex 2022/02/03 v1.0f TeX engine tests
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode not found.
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/generic/catchfile\catchfile.sty
Package: catchfile 2019/12/09 v1.8 Catch the contents of a file (HO)
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/generic/etexcmds\etexcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
)) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/generic/iftex\ifluatex.sty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
)) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/xstring\xstring.sty (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/generic/xstring\xstring.tex
\integerpart=\count280
\decimalpart=\count281
)
Package: xstring 2021/07/21 v1.84 String manipulations (CT)
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/framed\framed.sty
Package: framed 2011/10/22 v 0.96: framed or shaded text with page breaks
\OuterFrameSep=\skip53
\fb@frw=\dimen152
\fb@frh=\dimen153
\FrameRule=\dimen154
\FrameSep=\dimen155
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/float\float.sty
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\c@float@type=\count282
\float@exts=\toks18
\float@box=\box56
\@float@everytoks=\toks19
\@floatcapt=\box57
)
\minted@appexistsfile=\read3
\minted@bgbox=\box58
\minted@code=\write4
\c@minted@FancyVerbLineTemp=\count283
\c@minted@pygmentizecounter=\count284
\@float@every@listing=\toks20
\c@listing=\count285
)
runsystem(if not exist _minted-lmtt-l-sl-apostrophe mkdir _minted-lmtt-l-sl-apostrophe)...executed.
LaTeX Font Info: Trying to load font information for T1+lmtt on input line 7.
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/lm\t1lmtt.fd
File: t1lmtt.fd 2009/10/30 v1.6 Font defs for Latin Modern
) (C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/xcolor\xcolor.sty
Package: xcolor 2021/10/31 v2.13 LaTeX color extensions (UK)
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/graphics-cfg\color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: xetex.def on input line 227.
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/graphics-def\xetex.def
File: xetex.def 2022/04/12 v5.0l Graphics/color driver for xetex
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1352.
Package xcolor Info: Model `RGB' extended on input line 1368.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1370.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1371.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1372.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1373.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1374.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1375.
)
runsystem(for ^%i in (pygmentize.exe pygmentize.bat pygmentize.cmd) do set > lmtt-l-sl-apostrophe.aex <nul: /p x=^%~$PATH:i>> lmtt-l-sl-apostrophe.aex)...executed.
runsystem(del lmtt-l-sl-apostrophe.aex)...executed.
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-xetex.def
File: l3backend-xetex.def 2022-04-14 L3 backend support: XeTeX
\l__color_backend_stack_int=\count286
\g__color_backend_stack_int=\count287
\g__graphics_track_int=\count288
\l__pdf_internal_box=\box59
\g__pdf_backend_object_int=\count289
\g__pdf_backend_annotation_int=\count290
\g__pdf_backend_link_int=\count291
) (lmtt-l-sl-apostrophe.aux)
\openout1 = `lmtt-l-sl-apostrophe.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 13.
LaTeX Font Info: Trying to load font information for TS1+cmr on input line 13.
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/base\ts1cmr.fd
File: ts1cmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions
)
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 13.
LaTeX Font Info: ... okay on input line 13.
\openout3 = `lmtt-l-sl-apostrophe.pyg'.
(_minted-lmtt-l-sl-apostrophe/default.pygstyle)
runsystem(pygmentize -l python -f latex -P commandprefix=PYG -F tokenmerge -P stripnl=False -o _minted-lmtt-l-sl-apostrophe/B2EEEC5DD6EE452F2BE6C358921BAAD30B2D5ACA6D3BF97BF7C838A8122F5288.pygtex lmtt-l-sl-apostrophe.pyg)...executed.
(_minted-lmtt-l-sl-apostrophe/B2EEEC5DD6EE452F2BE6C358921BAAD30B2D5ACA6D3BF97BF7C838A8122F5288.pygtex
LaTeX Font Info: Font shape `T1/lmtt/m/it' in size <10> not available
(Font) Font shape `T1/lmtt/m/sl' tried instead on input line 2.
LaTeX Font Info: Trying to load font information for TS1+lmtt on input line 2.
(C:\Users\Yukai_Qian\AppData\Local\Programs\MiKTeX\tex/latex/lm\ts1lmtt.fd
File: ts1lmtt.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
_minted-lmtt-l-sl-apostrophe/B2EEEC5DD6EE452F2BE6C358921BAAD30B2D5ACA6D3BF97BF7C838A8122F5288.pygtex:2: No declaration for shape TS1/lmtt/l/sl.
sub@sfcnt ...e forspace shapespace mandatory@arg }
error@fontshape else #1{Fo...
l.2 \PYG{c+c1}{\PYGZsh{} \PYGZsq{}}
This error message was generated by an \errmessage
command, so I can't give any explicit help.
Pretend that you're Hercule Poirot: Examine all clues,
and deduce the truth by order and method.
LaTeX Font Info: Font shape `T1/lmtt/bx/n' in size <10> not available
(Font) Font shape `T1/lmtt/b/n' tried instead on input line 3.
)
runsystem(del _minted-lmtt-l-sl-apostrophe\7625015362D17C390F16CE14A86F65AD0B2D5ACA6D3BF97BF7C838A8122F5288.pygtex)...executed.
[1
] (lmtt-l-sl-apostrophe.aux)
runsystem(del lmtt-l-sl-apostrophe.pyg)...executed.
)
Here is how much of TeX's memory you used:
5382 strings out of 410944
102767 string characters out of 2822414
435471 words of memory out of 12000000
26099 multiletter control sequences out of 15000+600000
473215 words of font info for 33 fonts, out of 8000000 for 9000
1348 hyphenation exceptions out of 8191
75i,5n,81p,337b,572s stack positions out of 10000i,1000n,20000p,200000b,80000s
Output written on lmtt-l-sl-apostrophe.xdv (1 page, 1080 bytes).
.pygtex
\begin{Verbatim}[commandchars=\\\{\}]
\PYG{c+c1}{\PYGZsh{} \PYGZsq{}}
\PYG{k+kn}{import} \PYG{n+nn}{numpy} \PYG{k}{as} \PYG{n+nn}{np}
\end{Verbatim}