[texhax] trying to modify book.cls to automatically add TOC entry for \chapter* gives errors

Donald Arseneau asnd at triumf.ca
Thu May 8 23:43:40 CEST 2008

Niall Mansfield <texhax at uit.co.uk> writes:

> - Using book.cls
> - Want to change \chapter*{} in order to:
> 	* add a TOC entry
> 	* set the running heads
>    so that we can use \chapter*{} for Preface, Foreword,
>    Glossary, etc.

No, you should use \frontmatter and \backmatter instead.
If you do what you intend then there is no option for fragile
commands in titles to \chapter*.

>    ! TeX capacity exceeded, sorry [input stack size=300].
>    \originalTeX ->\noextrasenglish
> 				  \let \originalTeX \@empty \lefthyphenmin =2\...
>    l.1 \select at language {english}

classic fragile command in a moving argument.  I don't what the argument
was, but the moving is done by \addcontentsline or \markboth.

>    \addcontentsline{toc}{chapter}{foobar}

foobar contains no fragile commands.

Donald Arseneau                          asnd at triumf.ca

More information about the texhax mailing list