我最近将所有 TeX Live 2021 包都更新到了最新版本,之后使用memoir
、chemmacros
和的文档float
不再起作用。
以下是重现该问题的最小示例:
\documentclass{memoir}
\usepackage{chemmacros}
\usepackage{float}
\begin{document}
some text
\end{document}
编译此文档失败并出现以下错误:LaTeX Error: Missing \begin{document}.
到目前为止我发现了以下情况:
- 在更新到最新的软件包版本之前,这个问题没有出现。
- 如果我将 documentclass 切换为 ,则不会出现该问题
article
。 chemmacros
如果我删除或,问题就不会发生float
。chemmacros
如果我改变和的顺序,问题仍然会出现float
。- 我在两台计算机上尝试了此操作,其中一台运行 Linux,另一台安装了 Windows,两台计算机都发生了同样的事情。
- 我还尝试从头开始输入该文件,以确保没有可能导致问题的不可见字符。
我的问题是我应该如何处理这个问题?这看起来像是一个错误,但我不知道哪个软件包有这个错误,所以我不知道应该在哪里提交错误报告。
我能做些什么来实现这个功能?
我应该采取什么步骤来解决这个问题并找出问题的原因?
这是完整的输出。
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./document.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-01-21>
(/usr/local/texlive/2021/texmf-dist/tex/latex/memoir/memoir.cls
Document Class: memoir 2021/06/16 v3.7p configurable book, report, article docu
ment class
(/usr/local/texlive/2021/texmf-dist/tex/generic/iftex/iftex.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/memoir/mem10.clo)
(/usr/local/texlive/2021/texmf-dist/tex/latex/tools/array.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/tools/dcolumn.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/tools/delarray.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/tools/tabularx.sty)
LaTeX hooks Warning: Generic hook 'package/before/framed' is deprecated.
(hooks) Use hook 'package/framed/before' instead.
(/usr/local/texlive/2021/texmf-dist/tex/latex/textcase/textcase.sty)
LaTeX hooks Warning: Generic hook 'package/before/float' is deprecated.
(hooks) Use hook 'package/float/before' instead.
) (/usr/local/texlive/2021/texmf-dist/tex/latex/chemmacros/chemmacros.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)))
Loading the chemmacros module `base' ...
(/usr/local/texlive/2021/texmf-dist/tex/latex/tools/bm.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsgen.sty))
Loading the chemmacros module `errorcheck' ...
Loading the chemmacros module `lang' ...
(/usr/local/texlive/2021/texmf-dist/tex/latex/translations/translations.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
(/usr/local/texlive/2021/texmf-dist/tex/generic/infwarerr/infwarerr.sty)
(/usr/local/texlive/2021/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)))
Loading the chemmacros module `greek' ...
(/usr/local/texlive/2021/texmf-dist/tex/latex/chemgreek/chemgreek.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3packages/xparse/xparse.sty))
Loading the chemmacros module `chemformula' ...
Loading the chemmacros module `charges' ...
Loading the chemmacros module `acid-base' ...
Loading the chemmacros module `symbols' ...
Loading the chemmacros module `particles' ...
Loading the chemmacros module `phases' ...
Loading the chemmacros module `nomenclature' ...
Loading the chemmacros module `tikz' ...
(/usr/local/texlive/2021/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.te
x
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-li
sts.tex))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
) (/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/pgf.revision.tex)))
(/usr/local/texlive/2021/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics-def/pdftex.def)))
(/usr/local/texlive/2021/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.c
ode.tex))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.d
ef
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-p
df.def)))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.
code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.
code.tex)) (/usr/local/texlive/2021/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/graphics-cfg/color.cfg))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.
tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic
.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigo
nometric.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.rando
m.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.compa
rison.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.
code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round
.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.
code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integ
erarithmetics.code.tex)))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex)
) (/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfint.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.co
de.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconst
ruct.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage
.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.co
de.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicst
ate.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransform
ations.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.cod
e.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.c
ode.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathproce
ssing.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.co
de.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.cod
e.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.cod
e.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.
code.tex))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.co
de.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretranspare
ncy.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.
code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.
tex)))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.cod
e.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.
tex)
(/usr/local/texlive/2021/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version
-0-65.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version
-1-18.sty))
(/usr/local/texlive/2021/texmf-dist/tex/latex/pgf/utilities/pgffor.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex)
) (/usr/local/texlive/2021/texmf-dist/tex/latex/pgf/math/pgfmath.sty
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.cod
e.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothan
dlers.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.cod
e.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librarie
s/tikzlibrarytopaths.code.tex)))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librarie
s/tikzlibrarycalc.code.tex)
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librarie
s/tikzlibrarydecorations.pathmorphing.code.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/frontendlayer/tikz/librarie
s/tikzlibrarydecorations.code.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/modules/pgfmoduledecoration
s.code.tex))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/libraries/decorations/pgfli
brarydecorations.pathmorphing.code.tex))
Loading the chemmacros module `isotopes' ...
(/usr/local/texlive/2021/texmf-dist/tex/latex/elements/elements.sty)
Loading the chemmacros module `mechanisms' ...
Loading the chemmacros module `newman' ...
Loading the chemmacros module `orbital' ...
Loading the chemmacros module `polymers' ...
Loading the chemmacros module `reactions' ...
(/usr/local/texlive/2021/texmf-dist/tex/latex/mathtools/mathtools.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/tools/calc.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/mathtools/mhsetup.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsopn.sty)))
Loading the chemmacros module `redox' ...
(/usr/local/texlive/2021/texmf-dist/tex/latex/relsize/relsize.sty)
Loading the chemmacros module `xfrac' ...
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3packages/xfrac/xfrac.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/textcomp.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.st
y))
Loading the chemmacros module `scheme' ...
(/usr/local/texlive/2021/texmf-dist/tex/latex/chemnum/chemnum.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/psfrag/psfrag.sty))
Loading the chemmacros module `spectroscopy' ...
(/usr/local/texlive/2021/texmf-dist/tex/latex/siunitx/siunitx.sty)
Loading the chemmacros module `thermodynamics' ...
Loading the chemmacros module `units' ...
Loading the chemmacros module `reactants' ...
Loading the chemmacros module `translations' ...
) (/usr/local/texlive/2021/texmf-dist/tex/latex/float/float.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/chemformula/chemformula.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/units/nicefrac.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/ifthen.sty))
(/usr/local/texlive/2021/texmf-dist/tex/generic/pgf/libraries/pgflibraryarrows.
meta.code.tex))
./document.tex:6: LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.6 \begin{document}
?
./document.tex:6: Emergency stop.
...
l.6 \begin{document}
./document.tex:6: ==> Fatal error occurred, no output PDF file produced!
Transcript written on build/document.log.
Compilation failed.
答案1
问题是 执行此操作实际上取消了 的定义memoir
。现在,当加载时,的定义有效,而 的定义无效。但是 仍然认为 的定义有效。\AtBeginPackage{float}{\let\newfloat\relax}
\newfloat
float
\newfloat
float
memoir
chemmacros
memoir
memoir
的版本\newfloat
有一个可选参数,float
而 的版本没有。那么什么时候chemmacros
在文档开头执行这个
\newfloat[chapter]{scheme}{los}{scheme}
现在相当于
\newfloat{[}{c}{h}apter]{scheme}{los}{scheme}
[
定义并排版了一个名为的浮点数apter]{scheme}{los}{scheme}
,从而触发了错误。
整个事情可能被视为 的 bug chemmacros
。在版本 6 之前,chemmacros
这个问题没有被发现,因为默认情况下chemmacros
没有加载模块。现在它确实加载了。scheme
因此,在我修复此问题之前,您可以加载最少的模块chemmacros
并仅添加您需要的模块(不含模块scheme
)
\documentclass{memoir}
\usepackage[minimal,modules={redox,reactions}]{chemmacros}
\usepackage{float}
\begin{document}
some text
\end{document}
更新
chemmacros
此问题已在v6.1 (2022/02/13)中修复