GeneralUnnumbered Section listed before unnumbered Chapter in ToC

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Tissie
Posts: 32
Joined: Wed Feb 18, 2009 9:40 pm

Unnumbered Section listed before unnumbered Chapter in ToC

Post by Tissie »

Hi All,

In the preface for my thesis, which is an unlabeled chapter (\chapter*)
I have a section like this:

Code: Select all

\chapter*{Preface} \label{chap:Preface}
\markboth{Chapter {\protect\ref{chap:Preface}}. Preface}{ }

\section*{Goals and Objectives}\label{Preface:Objectives}
\addtocontents{toc}{\protect \contentsline {section}{Goals and Objectives}{{\protect \pageref{Preface:Objectives}}}{}}

bla blab bal bla

For some reason the section is placed BEFORE the Chapter in the ToC, which is ocourse wrong (see attached pdf)
If I remove the * from the code, it puts it in the correct order in ToC.

Any ideas on how to solve the problem?

Thanks!
Attachments
ToC_Error.pdf
Example of problem
(85.15 KiB) Downloaded 239 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Unnumbered Section listed before unnumbered Chapter in ToC

Post by Stefan Kottwitz »

Hi Tissie,

in this code you don't make the ToC entry for the unlabeled chapter. Btw. I would use \addcontentsline instead of \addtocontents, if there would not be other special requirements. Anyway, use the \add... command for the chapter before you start the section.

Stefan
LaTeX.org admin
Tissie
Posts: 32
Joined: Wed Feb 18, 2009 9:40 pm

Re: Unnumbered Section listed before unnumbered Chapter in T

Post by Tissie »

Baah, silly mistake I was staring myself completely blind on the problem.. I need to get out in the fresh air :D

Thanks for the help
Post Reply