更新到最新版本的 MacTeX 和 TeXmaker 后,我只能在caption
一份 LaTeX 文档中使用软件包中的粗体字体。其他所有文档都允许这样做,没有任何问题。
具体来说,在我所有文件的序言中,我
\usepackage[labelfont=bf]{caption}
但在编译有问题的文档时,收到错误消息
Unknown option `labelfont=bf` for package `caption`
该错误将我引导至caption.sty
\newsavebox{\as@captionbox}
我已按照 CTAN 文档尝试过
\usepackage[labelfont=bf]{caption}[2020/09/12]
\usepackage{caption}
\captionsetup{labelfont=bf}
并且还包括\captionsetup{...}
图形环境本身。
我的第 78 行.tex
没有引用数字,只包含数学模式中的文本\tt
,并且\textit
当我尝试通过 MRE 重现该错误时,该错误消失了。
例如
\documentclass[12pt]{article}
\usepackage[labelfont=bf]{caption}
\UseRawInputEncoding
\begin{document}
\begin{figure}[H]
\caption{Lorem ipsum dolor}
\end{figure}
\end{document}
这个问题类似,但目的不同
编辑
审查我的日志文件后,我发现了以下情况\newsavebox{\as@captionbox}
Package: caption v1.4b <1995/04/05> (Harald Sommerfeldt)
\captionmargin=\skip56
! LaTeX Error: Unknown option `labelfont=bf' for package `caption'.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.78 \newsavebox
{\as@captionbox}
The option `labelfont=bf' was not declared in package `caption', perhaps you
misspelled its name. Try typing <return> to proceed.
这是我的文件列表
*File List*
article.cls 2020/04/10 v1.4m Standard LaTeX document class
size12.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
amssymb.sty 2013/01/14 v3.01 AMS font symbols
amsfonts.sty 2013/01/14 v3.01 Basic AMSFonts support
amsmath.sty 2020/09/23 v2.17i AMS math features
amstext.sty 2000/06/29 v2.01 AMS text
amsgen.sty 1999/11/30 v2.0 generic functions
amsbsy.sty 1999/11/29 v1.2d Bold Symbols
amsopn.sty 2016/03/08 v2.02 operator names
bm.sty 2019/07/24 v1.2d Bold Symbol Support (DPC/FMi)
color.sty 1999/02/16
color.cfg 2016/01/02 v1.6 sample color configuration
pdftex.def 2020/10/05 v1.2a Graphics/color driver for pdftex
float.sty 2001/11/08 v1.3d Float enhancements (AL)
graphicx.sty 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
graphics.sty 2020/08/30 v1.4c Standard LaTeX Graphics (DPC,SPQR)
trig.sty 2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg 2016/06/04 v1.11 sample graphics configuration
mathtools.sty 2021/03/18 v1.25 mathematical typesetting tools
calc.sty 2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
mhsetup.sty 2021/03/18 v1.4 programming setup (MH)
hyphenat.sty 2009/09/02 v2.3c hyphenation utilities
indentfirst.sty 1995/11/23 v1.03 Indent first paragraph (DPC)
caption.sty 1995/04/05 v1.4b caption package (HS)
geometry.sty 2020/01/02 v5.9 Page Geometry
ifvtex.sty 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead.
iftex.sty 2020/03/06 v1.0d TeX engine tests
tcolorbox.sty 2020/10/09 version 4.42 text color boxes
pgf.sty 2020/12/27 v3.1.8b (3.1.8b)
pgfrcs.sty 2020/12/27 v3.1.8b (3.1.8b)
pgfrcs.code.tex
pgfcore.sty 2020/12/27 v3.1.8b (3.1.8b)
pgfsys.sty 2020/12/27 v3.1.8b (3.1.8b)
pgfsys.code.tex
pgfsyssoftpath.code.tex 2020/12/27 v3.1.8b (3.1.8b)
pgfsysprotocol.code.tex 2020/12/27 v3.1.8b (3.1.8b)
xcolor.sty 2016/05/11 v2.12 LaTeX color extensions (UK)
color.cfg 2016/01/02 v1.6 sample color configuration
pgfcore.code.tex
pgfcomp-version-0-65.sty 2020/12/27 v3.1.8b (3.1.8b)
pgfcomp-version-1-18.sty 2020/12/27 v3.1.8b (3.1.8b)
verbatim.sty 2020-07-07 v1.5u LaTeX2e package for verbatim enhancements
environ.sty 2014/05/04 v0.3 A new way to define environments
trimspaces.sty 2009/09/17 v1.1 Trim spaces around a token list
etoolbox.sty 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
lineno.sty 2005/11/02 line numbers on paragraphs v4.41
setspace.sty 2011/12/19 v6.7a set line spacing
natbib.sty 2000/07/24 7.0a (PWD)
textcomp.sty 2020/02/02 v2.0n Standard LaTeX package
lscape.sty 2020/05/28 v3.02 Landscape Pages (DPC)
footmisc.sty 2011/06/06 v5.5b a miscellany of footnote facilities
boxedminipage.sty 2020/04/19 v1.1 Boxed LaTeX2e minipages
l3backend-pdftex.def 2021-03-18 L3 backend support: PDF output (pdfTeX)
supp-pdf.mkii
epstopdf-base.sty 2020-01-24 v2.11 Base part for package epstopdf
epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
umsa.fd 2013/01/14 v3.01 AMS symbols A
umsb.fd 2013/01/14 v3.01 AMS symbols B
omscmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions
Figure S1.png Graphic file (type png)
Figure S2.png Graphic file (type png)
Figure S3.png Graphic file (type png)
Figure S5.png Graphic file (type png)
Figure S4.png Graphic file (type png)
Figure S6.png Graphic file (type png)
***********