# Import \chapter into amsart

I would like to create a document with the appearance of amsart, but with added \chapter command (styled as in amsbook, or differently). How can I do that?

I tried to make LaTeX load both amsbook and amsart by various combinations of \LoadClass and \documentclass, but it seems to be a failing strategy since they both define a lot of things using \newcommand, causing an infinity of errors. I also realized I can't do it the other way around since I want to stick to the look of theorems as in amsart and not in amsbook. I also know that I can, in theory, style it myself using titlesec, but it would be a lot of manual work to get the spacing of amsart's titles, and I would like to avoid doing that manually.

A MWE is the following:

%\documentclass[openany,11pt]{amsbook}
\documentclass[11pt]{amsart}

\newtheorem{lemma}{Lemma}[chapter]
\newtheorem{theorem}[lemma]{Theorem}

\begin{document}

\chapter{My Fair Chapter}

\section{Lovely section}

\begin{theorem} % Should show "Theorem" in bold, unintended.
I love ducks.
\end{theorem}

\end{document}


I'd change the parts of amsbook.cls that are not of your liking. Adding just the infrastructure for chapters requires much more lines of code than those added by David Carlisle, because also the table of contents and the other listings should be taken into account.

\documentclass{amsbook}
\usepackage{etoolbox}

\makeatletter
\numberwithin{section}{chapter}
\def\@secnumfont{\mdseries}
\def\section{\@startsection{section}{1}%
\z@{.7\linespacing\@plus\linespacing}{.5\linespacing}%
{\normalfont\scshape\centering}}
\def\subsection{\@startsection{subsection}{2}%
\z@{.5\linespacing\@plus.7\linespacing}{-.5em}%
{\normalfont\bfseries}}

\patchcmd{\@thm}{\let\thm@indent\indent}{\let\thm@indent\noindent}{}{}

\makeatother

\newtheorem{thm}{Theorem}[section]

\begin{document}

\chapter{Chapter title}

\section{Title of this section}
\subsection{Title of this subsection}

\begin{thm}
Whatever the theorem says.
\end{thm}

\begin{thm}[Somebody]
Whatever the theorem says.
\end{thm}

\end{document}


Here's what I get if I remove \chapter{Chapter title}, the customizations and load amsart instead.

Just copy the lines relating to \chapter from amsbook

%\documentclass[openany,11pt]{amsbook}
\documentclass[11pt]{amsart}

\makeatletter

\def\chaptermark#1{}%whatever

\def\chapter{%
\if@openright\cleardoublepage\else\clearpage\fi
\thispagestyle{plain}\global\@topnum\z@
\@afterindenttrue \secdef\@chapter\@schapter}

\def\@chapter[#1]#2{\refstepcounter{chapter}%
\ifnum\c@secnumdepth<\z@ \let\@secnumber\@empty
\else \let\@secnumber\thechapter \fi
\typeout{\chaptername\space\@secnumber}%
\def\@toclevel{0}%
\ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#2}%
\else \@tocwriteb\tocchapter{chapter}{#2}\fi
\chaptermark{#1}%
\def\@schapter#1{\typeout{#1}%
\let\@secnumber\@empty
\def\@toclevel{0}%
\ifx\chaptername\appendixname \@tocwriteb\tocappendix{chapter}{#1}%
\else \@tocwriteb\tocchapter{chapter}{#1}\fi
\chaptermark{#1}%
\newcommand\chaptername{Chapter}

\begingroup
\fontsize{\@xivpt}{18}\bfseries\centering
\ifnum\c@secnumdepth>\m@ne
\leavevmode \hskip-\leftskip
\rlap{\vbox to\z@{\vss
\centerline{\normalsize\mdseries
\uppercase\@xp{\chaptername}\enspace\thechapter}
\vskip 3pc}}\hskip\leftskip\fi
#1\par \endgroup
\vskip\skip@ }
\begingroup
\fontsize{\@xivpt}{18}\bfseries\centering
#1\par \endgroup
\vskip\skip@ }
\def\appendix{\par
\c@chapter\z@ \c@section\z@
\let\chaptername\appendixname
\def\thechapter{\@Alph\c@chapter}}

\newcounter{chapter}

\newif\if@openright

\makeatother

\newtheorem{lemma}{Lemma}[chapter]
\newtheorem{theorem}[lemma]{Theorem}

\begin{document}

\chapter{My Fair Chapter}

\section{Lovely section}

\begin{theorem} % Should show "Theorem" in bold, unintended.
I love ducks.
\end{theorem}

\end{document}

• What about \tableofcontents? Apr 29 '15 at 14:14
• @egreg exercise for the reader, in the best pedagogical tradition. Apr 29 '15 at 14:46
• @DavidCarlisle thanks for your useful answer above; I'm trying to do the same thing as the OP. I can't for the life of me determine what the correct lines are from amsbook for the table of contents. Should I be looking in the .dtx file somewhere? Apr 9 '20 at 12:57
• @Mr.Chip you could just look in amsbook.cls, but despite the answer I posted above a better answer is "dont do this" why not use amsbook that has chapters already? just search for the string chapter the toc layout is \def\l@chapter{\@tocline{0}{8pt plus1pt}{0pt}{}{}} \let\tocchapter\tocsection Apr 9 '20 at 13:23