使用 amsart 和 savetrees 时控制序列未定义

使用 amsart 和 savetrees 时控制序列未定义

amsart 和 savetrees 是否不兼容(再次)? 我正在使用 texlive 2023,并tlmgr给出以下软件包版本:

savetrees 2.4
amscls 2.20.6
geometry 5.9

这个测试 latex 文件

\documentclass{amsart}
\usepackage{savetrees}

\begin{document}
\section{foo}
\end{document}

Undefined control sequence在命令中生成错误\section

$ latex test
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-01-04>
(/.../texlive/2023/texmf-dist/tex/latex/amscls/amsart.cls
Document Class: amsart 2020/05/29 v2.20.6
(/.../texlive/2023/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/.../texlive/2023/texmf-dist/tex/latex/amsmath/amstext.sty
(/.../texlive/2023/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/.../texlive/2023/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/.../texlive/2023/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/.../texlive/2023/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/.../texlive/2023/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/.../texlive/2023/texmf-dist/tex/latex/savetrees/savetrees.sty
(/.../texlive/2023/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/.../texlive/2023/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/.../texlive/2023/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/.../texlive/2023/texmf-dist/tex/generic/xkeyval/keyval.tex))))
(/.../texlive/2023/texmf-dist/tex/generic/iftex/ifpdf.sty
(/.../texlive/2023/texmf-dist/tex/generic/iftex/iftex.sty))
(/.../texlive/2023/texmf-dist/tex/generic/iftex/ifluatex.sty))
(/.../texlive/2023/texmf-dist/tex/latex/titlesec/titlesec.sty)
(/.../texlive/2023/texmf-dist/tex/latex/geometry/geometry.sty
(/.../texlive/2023/texmf-dist/tex/generic/iftex/ifvtex.sty))
(/.../texlive/2023/texmf-dist/tex/latex/tools/calc.sty)
(/.../texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-dvips.def
) (./test.aux)
(/.../texlive/2023/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/.../texlive/2023/texmf-dist/tex/latex/amsfonts/umsb.fd)
*geometry* driver: auto-detecting
*geometry* detected driver: dvips
! Undefined control sequence.
<argument> ...on\endcsname \protect \@secnumpunct 
                                                  
l.5 \section{foo}
                 
? 
[1] (./test.aux) )
Output written on test.dvi (1 page, 376 bytes).
Transcript written on test.log.

答案1

默认情况下savetrees加载titlesec与不兼容的amsart

使用sections=normal选项加载它,因此titlesec未加载。

\documentclass{amsart}
\usepackage[sections=normal]{savetrees}
\usepackage{kantlipsum}

\begin{document}

\section{foo}

\kant[1-3]

\section{baz}

\kant[4-6]

\end{document}

在此处输入图片描述

另一方面,你可以获得基本相同的布局,而无需savetrees

\documentclass{amsart}
\usepackage{kantlipsum}

\addtolength{\textwidth}{170pt}
\addtolength{\textheight}{140pt}
\calclayout

\begin{document}

\section{foo}

\kant[1-3]

\section{baz}

\kant[4-6]

\end{document}

相关内容