7

I am transcribing an old book in LaTeX, trying to preserve the style.

I found the amsbook class to be the perfect solution for me. I produce chapters with \chapter{Thermodynamic Systems} and I get something like "Chapter I - Thermodynamic Systems". When I create the TOC, the word "Chapter" is repeated for each entry, but I want it as a heading for all chapters, and then print only the chapter number.

This is what I get:

Preface.................................................................iii

Introduction.........................................................vii

Chapter I. Thermodynamic Systems.......................1

  1. The state of a system......................................1

Chapter II. The First Law of Thermodynamics.........2

(actually, without points) and so on...

This is instead the original layout:

........................................................................Page Preface.................................................................iii

Introduction.........................................................vii

Chapter

I. Thermodynamic Systems....................................1

  1. The state of a system......................................1

II. The First Law of Thermodynamics......................2

(sorry for the poor reproduction, you have to imagine that "Chapter", "I" and "II" are vertically aligned.)

Is there also a way to write the word "Page" at the top of the pages numbers and to get the dots, like the original book?

I searched all around the web, but all the packages I found that allow to modify the TOC are incompatible with the amsbook class.

I DO NOT want to remove the word "Chapter" in the actual chapter name, I want to remove it only in the TOC.

Here is an axample of the document:

\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

\begin{document}

\frontmatter

\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


\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}

Thanks in advance for the help!

0

2 Answers 2

10

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:

enter image description here

4
  • Thank you so much @karlkoeller, this is what I was looking for!
    – Matteo
    Commented Aug 4, 2013 at 20:03
  • @user1255231 PS: Do you also want a line with "Page" right-aligned at the beginning of the TOC? Commented Aug 4, 2013 at 20:05
  • I redefined a bit your solution: ` \makeatletter \renewcommand\tocchapter[3]{% \indentlabel{\@ifnotempty{#2}{\ignorespaces\quad#2.\quad}}#3\dotfill% } \renewcommand\tocsection[3]{% \indentlabel{\@ifnotempty{#2}{\ignorespaces\quad#2.\quad}}#3\dotfill% } \makeatother ` Then I added a line before the Preface: ` \addtocontents{toc}{\protect\hfill\textsc{\small Page}} ` You you have a better solution, I'm happy to learn!
    – Matteo
    Commented Aug 4, 2013 at 20:24
  • 1
    @user1255231 I modified the answer for accomplishing all your requests. Commented Aug 4, 2013 at 20:42
0

Here's a modification based on karlkoeller's answer:

add the following to preamble:

\makeatletter
\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 plus4em \parfillskip-\@pnumwidth
    #5\leavevmode\hskip-\@tempdima #6\nobreak\relax
    \dotfill\hbox to\@pnumwidth{\@tocpagenum{#7}}\par
    \nobreak
    \endgroup
  \fi}
\makeatother

and use

\addtocontents{toc}{
\protect\raggedright
\protect\dotfill\textsc{Page}}

as well as

\addtocontents{toc}{
\protect\raggedright
\protect\vspace{8pt plus1pt}
\protect Chapter}

Result:

enter image description here

You must log in to answer this question.

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