# Using the amsbook Class

I am trying to figure out how to tweak various stylistic aspects of the amsbook class. For example, I would like for the chapter and section headers to be left-aligned instead of centered. Also, using the plain theorem style, I would like for the words "theorem", "proof" etc. to be bold. I would also like to figure out how to make theorems not be indented. So, are there simple ways of accomplishing these things or would I be better off basing a custom book class based on the amsbook class? Are there other book classes available that would perhaps be easier to style than the amsbook class?

-

There are several questions here.

1. You can define a new page style to change the header format. In my example code this is done defining \ps@spheadings.

2. You can define a new theorem style to change the format for the theorem-like structures. In my example code this is done defining \th@spplain.I defined this new style using low-level commands, but you could use the features provided by the amsthm package.

\documentclass{amsbook}
\usepackage{lipsum}

\makeatletter
\rlap{\thepage}\hfil \leftmark{}{}}%
\rightmark{}{}\hfil \llap{\thepage}}%
\let\@mkboth\markboth
\def\chaptermark{%
\def\sectionmark{%
}
\def\th@spplain{%
\let\thm@indent\relax
\thm@preskip.5\baselineskip\@plus.2\baselineskip
\@minus.2\baselineskip
\thm@postskip\thm@preskip
\normalfont
}
\makeatother

\theoremstyle{spplain}
\newtheorem{theo}{Theorem}

\begin{document}

\chapter{A test chapter}
\section{A test section}
\begin{theo}
\lipsum[1]
\end{theo}
\lipsum[1-30]

\end{document}


Although both modifications are not difficult to achieve, you should think carefully if amsbook is really the best class for you, or if perhaps some other class would suit you better.

To customize the theorem-like structures, you can use the amsthm package (I already provided the link); the ntheorem package could also be a possibility if your document class is not from the AMS collection.

If you decide not to use the amsbook document class, but to use some of the standard document classes, then you can customize the headers using either the fancyhdr or the titlesec packages.

In What are the available “documentclass” types and their uses? you can find a description of some of the available document classes; besides amsbook, and book, the document classes scrbook and memoir could be an option for you.

Here's a simple schematic document showing titlesec and amsthm in action with the book document class:

\documentclass[twoside]{book}
\usepackage{amsthm}
\usepackage[pagestyles]{titlesec}
\usepackage{lipsum}

\newpagestyle{mystyle}{
\setfoot[left-odd][center-odd][right-odd]{left-even}{center-even}{right-odd}
}

\newtheoremstyle{mystyle}
{3pt}% ⟨Space above⟩
{3pt}% ⟨Space below⟩
{\normalfont}% ⟨Body font⟩
{}% ⟨Indent amount⟩
{\bfseries}% ⟨Theorem head font⟩
{.}% ⟨Punctuation after theorem head⟩
{.5em}% ⟨Space after theorem head⟩
{}% ⟨Theorem head spec (can be left empty, meaning ‘normal’)⟩
\theoremstyle{mystyle}
\newtheorem{theo}{Theorem}

\pagestyle{mystyle}

\begin{document}

\chapter{A test chapter}
\section{A test section}
\begin{theo}
\lipsum[1]
\end{theo}
\lipsum[1-30]

\end{document}

-
Thank you very much for the example. Although of course I can copy your code, this seems neither easy nor simple. I would certainly be open to using another book class; do you have a suggestion? –  3Sphere Nov 17 '11 at 21:43
OK, that definitely works but now the theorem text is back to being italicized (which I don't want). I certainly hope there's a document class that's easier to configure... –  3Sphere Nov 17 '11 at 21:48
@3Sphere: see my updated answer. –  Gonzalo Medina Nov 17 '11 at 21:55
Thank you; your examples have been very helpful –  3Sphere Nov 17 '11 at 22:31
\theoremstyle{definition} is identical to the default \theoremstyle{plain} in every way except that the body font is not italic. so if that is the only reason to want to change the style, there's no need to define a new one. (and \theoremstyle{remark} is like definition without the extra space above and below.) –  barbara beeton Sep 28 at 12:54

You can change the style and indentation of the theorems using the amsthm package, which is loaded automatically when you use amsbook. Use

\newtheoremstyle{mytheorem}% ⟨name⟩
{3pt}% ⟨Space above⟩
{3pt}% ⟨Space below⟩
{\itshape}% ⟨Body font⟩
{}% ⟨Indent amount⟩
{\bf}% ⟨Theorem head font⟩
{.}% ⟨Punctuation after theorem head⟩
{.5em}% ⟨Space after theorem head⟩
{}% ⟨Theorem head spec (can be left empty, meaning ‘normal’)⟩

\theoremstyle{mytheorem}


You can also change the proof; see Changing style of Proof.

If you would like a recommendation for a book class, I'd say use scrbook (part of the KOMA-Script bundle). You'll need to load any AMS classes you want to use, but KOMA-Script makes it really easy to customize book layout using commands. It has the added benefit (to you) of left-aligning chapters and section by default.

-
Thanks for the recommendation; I'll take a look at it. –  3Sphere Nov 17 '11 at 22:32

Regarding the various stylistic aspects of amsbook class, the following code worked well for me to adjust Caption and the Section heading styles. I just pasted it into the preamble of my LyX document.

The caption package seems to work with amsbook class. But, sectsty package will not work with amsbook.

\usepackage[format=plain,labelsep=period,justification=justified,
singlelinecheck=false,font=small,labelfont=bf, margin=10pt]{caption}

\renewcommand{\section}{\@startsection
{section}%              % the name
{1}%                    % the level
{0mm}%                  % the indent
{-0.5\baselineskip}%    % the before skip
{0.25\baselineskip}%    % the after skip
{\normalfont\large\bf}} % the style

\renewcommand{\subsection}{\@startsection
{subsection}%                % the name
{2}%                         % the level
{0mm}%                       % the indent
{0mm}%                       % the before skip
{0.1mm}%                     % the after skip
{\normalfont\normalsize\bf}} % the style

\renewcommand{\subsubsection}{\@startsection
{subsubsection}%                % the name
{3}%                            % the level
{0mm}%                          % the indent
{0mm}%                          % the before skip
{0.1mm}%                        % the after skip
{\normalfont\normalsize\bf\it}} % the style

-