1

enter image description here

I'd like to change 'Contents' to say 'TABLE OF CONTENTS' in all capital letters. I would like for them to read as 'CHAPTER 1.' instead of just 'Chapter 1.'

Also, excuse me for being too needy, I'd like to have dots running from the chapter title to the page number.

I know I'm asking for a lot, but I've been covering 0 ground trying to find references on this stuff. I'm currently using the amsbook document class. I've tried to include tocloft, but the package wouldn't even let me run \tableofcontents, which leads me to believe that there is a conflict somehow.

Thanks in advance!

  • 1
    Welcome to LaTeX! Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – JP-Ellis Mar 4 '16 at 1:36
  • the ams document classes have a different approach to the toc than other classes, and "adjustment" packages such as tocloft are incompatible. a working approach to changing the text of a toc entry (using \for and \except is shown in tex.stackexchange.com/a/123763/579. the other requests are not difficult to fulfill, but i don't have access to a means of checking just now. tomorrow ... unless someone else answers first. – barbara beeton Mar 4 '16 at 2:28
3

Three simple patches:

\documentclass{amsbook}
\usepackage{etoolbox}

% 'Table of contents' instead of 'Contents'
\renewcommand{\contentsname}{Table of contents}
% Use the next line if you want capital letters
%\renewcommand{\contentsname}{\MakeUppercase{Table of contents}}

% Uppercase 'CHAPTER' label in toc
\patchcmd{\tocchapter}{#1}{\MakeUppercase{#1}}{}{}

% Leader dots in toc
\makeatletter
%\renewcommand\@pnumwidth{1em} % <-- depending on the total number of pages
\patchcmd{\@tocline}
  {\hfil}
  {\leaders\hbox{\,.\,}\hfil}
  {}{}
\makeatother

\begin{document}

\frontmatter

\tableofcontents

\mainmatter

\chapter{Introduction}

\chapter{Seminorms and the Minkowski functional}

\chapter{Convex polytopes}
\section{Convex}
\section{Polytopes}

\end{document}

The normal value of \@pnumwidth is 1.6em; reduce it as shown if you have less than 100 pages (or adjust the size to suit); in the first picture the default value is used, in the second one 1em is used.

\@pnumwidth at 1.6em

enter image description here

\@pnumwidth at 1em

enter image description here

  • This was very helpful, thankyou! – Prototank Mar 7 '16 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.