3

Are amsart and savetrees incompatible (again)? I am using texlive 2023, and tlmgr gives the following package versions:

savetrees 2.4
amscls 2.20.6
geometry 5.9

This test latex file

\documentclass{amsart}
\usepackage{savetrees}

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

generates an Undefined control sequence error at the \section command:

$ 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
  • 1
    savetrees makes assumptions about how the \section command runs and those assumptions are not correct for amsart. It is possible to patch away the error, but the heading will then also not be centered anymore (presumably because of savetrees).
    – daleif
    Jan 18 at 14:50

1 Answer 1

4

By default savetrees loads titlesec which is not compatible with amsart.

Load it with the sections=normal option, so titlesec isn't loaded.

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

\begin{document}

\section{foo}

\kant[1-3]

\section{baz}

\kant[4-6]

\end{document}

enter image description here

On the other hand, you get essentially the same layout without 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}
5
  • Thanks, that works! (I needed bibliography=normal as well to make my actual document compile.)
    – user108903
    Jan 18 at 15:06
  • @user108903 I added an alternative solution without savetrees. With amsart spacings are already tighter than with article.
    – egreg
    Jan 18 at 15:13
  • I don't believe that there should be no space between the section number and the title. I will check, but I think there's something wrong here. Jan 18 at 15:35
  • I've checked. There is definitely a space between the section number and the title. Go to CTAN, look for amsart, open the "Instructions to authors" and go to page 6. This documentation was prepared with amsbook, but the headings are uniformly defined for all AMS document classes. Jan 18 at 15:41
  • @barbarabeeton I noticed it. But since savetrees can only be useful for rough drafts, I didn't investigate further.
    – egreg
    Jan 18 at 16:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .