TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm astonished how good and informational this site is. However, I was unable to find an answer to the following problem:

Background: I'm working on a book for IOS-press, and my first chapter is built with the class IOS-Book-Article. It has bunch of definitions required by publisher, but it forbids making a TOC. I need it for checking and draft working, also for my co-authors.

Problem: I'm unable to run pdflatex on my tex document, because it says \tableofcontents is undefined. Also the toc file is 0 size.

The error message:

! Undefined control sequence.
l.20 \tableofcontents

My TEX source:

% our definitions and macros
..... the rest of doc

Question: How to make table of contents in this document class? I need only draft version, nothing fancy, only sections/sub/subsub and chapters, with page numbers for revision.

My investigation: The class can be found on IOS Author Corner, but I give here only an url (it's too long to copy): http://www.iospress.nl/authco/iospressbookarticle-latex.zip (direct url, sorry). I've found that in this class there are some defs for:

% Block preparation of contents:

which I commented out, but it don't help. There is no \tableofcontents definition inside this class. I've copied one found in default book.cls class, but it didn't work, saying that some variables are empty and then set to 0. Nevertheless, I was unable to got anything similar to toc and I'm too beginner to make my own class.

Please, how to manage to do this?

share|improve this question
up vote 5 down vote accepted

Nothing fancy ... just copy-and-paste of the relevant macro definitions from the LaTeX sources and from article.cls.



% Copied from the LaTeX sources
    {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble}%

% Copied from article.cls
  \ifnum \c@tocdepth >\z@
    \addvspace{1.0em \@plus\p@}%
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      \leavevmode \bfseries
      \hskip -\leftskip
      #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\newcommand\listfigurename{List of Figures}
\newcommand\listtablename{List of Tables}






Some text.


EDIT: Removed definition of \l@part because IOS-Book-Article doesn't feature a \part command.

share|improve this answer
WOW, you've made my day! It is PERFECT solution, works like charm! Thank you. Now I have not only table of contents, but beautiful table of contents! :) – piotao Jul 20 '11 at 9:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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