Saturday, August 28, 2010

LaTeX quirks - omitting things in TOC

Everyone knows how LaTeX can make your life easier and at the same time drive you insane with a tiny little 'gotcha'. I'm using a LaTeX template to write my thesis and the template sets up the Abstract and the Acknowledgment sections as follows:

\begin{abstract}
... text goes here...
\end{abstract}

\begin{acknowledgment}
blah blah Thank you blah
\end{
acknowledgment}

which works just fine, generates the appropriate titles, puts them on separate pages and all that. Then I realize that these sections are not supposed to be included into the table of contents, but, unfortunately, they are. As the wonderful LaTeX magically creates the TOC for you with the inclusion of single command, I start searching how to fix this. Guess what I find - numerous entries on how to add sections to TOC that won't be there by default but nothing on omitting the Abstract from it... Then I stumble on something odd looking:

\chapter*{Abstract}
... text goes here

I try that removing the \end{} commands, followed by double typeset run and Eurika! It works! Granted, the title is no longer centered, but that can be easily fixed as long as my TOC is correct. Thought I'd share in hopes of saving someone the aggravation of trying to do the same.

Happy TeX-ing :)