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?
Amsbook – Using the Amsbook Class
amsbook
Related Solutions
Here's one possibility: I suppressed the undesired indentation for the entries, and I defined a command \atotoc
with a mandatory argument (the name of the author) to add the author information:
\documentclass{amsbook}
\AtBeginDocument{%
\makeatletter
\expandafter\renewcommand\csname r@tocindent0\endcsname{0pt}
\makeatother
}
\newcommand\atotoc[1]{\addtocontents{toc}{#1\par}}
\begin{document}
\tableofcontents
\chapter*{Test Chapter One}
\atotoc{Author One}
\chapter*{Test Chapter Two with a Long Title that will Span Two Lines in the Table of Contents}
\atotoc{Author Two}
\end{document}
An image of the resulting ToC:
If dots between text and page number are required for the entries, some additional work needs to be done:
\documentclass{amsbook}
\makeatletter
\newcommand\@dotsep{4.5}
\def\@tocline#1#2#3#4#5#6#7{\relax
\ifnum #1>\c@tocdepth % then omit
\else
\par \addpenalty\@secpenalty\addvspace{#2}%
\begingroup \hyphenpenalty\@M
\@ifempty{#4}{%
\@tempdima\csname r@tocindent\number#1\endcsname\relax
}{%
\@tempdima#4\relax
}%
\parindent\z@ \leftskip#3\relax \advance\leftskip\@tempdima\relax
\rightskip\@pnumwidth plus1em \parfillskip-\@pnumwidth
#5\leavevmode\hskip-\@tempdima{#6}\nobreak
\leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$}\hfill
\nobreak
\hbox to\@pnumwidth{\@tocpagenum{#7}}\par
\nobreak
\endgroup
\fi}
\makeatother
\AtBeginDocument{%
\makeatletter
\expandafter\renewcommand\csname r@tocindent0\endcsname{0pt}
\makeatother
}
\newcommand\atotoc[1]{\addtocontents{toc}{#1\par}}
\begin{document}
\tableofcontents
\chapter*{Test Chapter One}
\atotoc{Author One}
\chapter*{Test Chapter Two with a Long Title that will Span Two Lines in the Table of Contents}
\atotoc{Author Two}
\end{document}
To remove the word "Chapter" from the chapters lines (see this answer of egreg) and to add the dots to every line you can write the following lines in the preamble:
\makeatletter
\renewcommand\tocchapter[3]{%
\indentlabel{\@ifnotempty{#2}{\ignorespaces#2.\quad}}#3\dotfill%
}
\renewcommand{\tocsection}[3]{%
\indentlabel{\@ifnotempty{#2}{\ignorespaces#1 #2.\quad}}#3\dotfill%
}
\makeatother
Moreover, to insert the line with "Chapter" in the TOC, you can add the line
\addtocontents{toc}{\protect\contentsline{chapter}{Chapter}{}{}}
just after the \mainmatter
and, to have a line with the word "Page" right-aligned at the beginning of the TOC, add this
\addtocontents{toc}{\protect\contentsline{chapter}{}{\textsc{\small Page}}{}}
just after the \frontmatter
.
In other words, the following MWE:
\documentclass[10pt,twoside,titlepage,reqno]{amsbook}
\usepackage[a5paper]{geometry}
\geometry{papersize={5.375in,8.500in}}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[%hypertex,
unicode=true,
plainpages = false,
pdfpagelabels,
bookmarks=true,
bookmarksnumbered=true,
bookmarksopen=true,
breaklinks=true,
backref=false,
colorlinks=true,
linkcolor = blue,
urlcolor = blue,
citecolor = red,
anchorcolor = green,
hyperindex = true,
hyperfigures
]{hyperref}
\hypersetup{
pdftitle={Thermodynamics},
pdfauthor={Enrico Fermi},
pdfsubject={Unabridged, unaltered republication of 1937 edition.}
}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{lettrine}
\usepackage{type1cm}
\renewcommand{\LettrineTextFont}{\MakeUppercase}
\renewcommand{\thechapter}{\Roman{chapter}}
\usepackage{chngcntr}
\counterwithout{section}{chapter}
\author{\scshape{Enrico Fermi}}
\title{\Huge \MakeUppercase{Thermodynamics}}
\copyrightinfo{1936}{Enrico Fermi\\Copyright holder, Laura Fermi}
\makeindex
\makeatletter
\renewcommand\tocchapter[3]{%
\indentlabel{\@ifnotempty{#2}{\ignorespaces#2.\quad}}#3\dotfill%
}
\renewcommand{\tocsection}[3]{%
\indentlabel{\@ifnotempty{#2}{\ignorespaces#1 #2.\quad}}#3\dotfill%
}
\makeatother
\begin{document}
\frontmatter
\addtocontents{toc}{\protect\contentsline{chapter}{}{\textsc{\small Page}}{}}
\maketitle
\makeatletter
\@setcopyright
\makeatother
\chapter*{Preface}
\lettrine{T}{his} book originated in a course of lectures held at Columbia University,
New York, during the summer session of 1936.
Blablabla...
\begin{flushright}
\textsc{E. Fermi}
\end{flushright}
\tableofcontents
\chapter*{Introduction}
\lettrine{T}{hermodynamics} is mainly concerned with the transformations
of heat into mechanical work and the opposite transformations of mechanical work into heat.
Blablabla...
\mainmatter
\addtocontents{toc}{\protect\contentsline{chapter}{Chapter}{}{}}
\chapter{Thermodynamic Systems}\index{Thermodynamical systems}
\section{The state of a system and its transformations}\index{Thermodynamical state of a system}
The state of a system in mechanics is completely specified at a
given instant of time if the position and velocity of each mass
point of the system are given. For a system composed of a
number $N$ of mass-points, this requires the knowledge of
$6N$ variables.
Blablabla...
\subsection*{A system composed of a chemically defined homogeneous fluid}
\index{Chemically homogeneous systems}\index{Chemically homogeneous fluid}
We can make the following measurements on such a
system: the temperature $t$, the volume $V$, and the pressure $p$.
Blablabla...
\chapter{The First Law of Thermodynamics}
\section{The statement of the first law of thermodynarnics}
Some text...
\chapter{The Second Law of Thermodynamics}\label{chap:2ndLawOfThermo}
\printindex
\end{document}
gives the result:
Best Answer
There are several questions here.
You can define a new page style to change the header format. In my example code this is done defining
\ps@spheadings
.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.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
, andbook
, the document classesscrbook
andmemoir
could be an option for you.Here's a simple schematic document showing
titlesec
andamsthm
in action with thebook
document class: