All,
my beloved wife is writing her PhD manuscript under LaTeX and we are stuck with
a strange behaviour.
What she would like to achieve is:
To write a sort of a preamble giving the context for the two following chapters.
This "Context" should sit between Chapter 3 and 4.
She does not want the "Context" to be numbered like any other chapter in the manuscript (e.g. Chapter x) and she wants it to appear in the ToC and also unnumbered.
So we started using:
\chapter*{Context}
This indeed creates a new chapter in the document, which is not numbered in the document. Good.
The bad thing is that in the header of the pages of this "Context" chapter appear the number and title of the last Chapter 3 section (i.e. 3.6 titleofthesection), just like if this chapter was parter of the section 3.6.
When writing instead : \chapter{Context}
This of course does not happen but creates a numbered chapter in the document, and also in the ToC
Any solution to this?
Second point is to have the "Context" chapter appear in the ToC.
so below the above command we wrote:
\addcontentsline{toc}{chapter}{Context}
This again, partially works.
"Context" indeed appears in the ToC, unnumbered, but the minitoc just below the following
chapter (Chapter 4) has now disappeared.
We would really welcome your help. Thanks.
General ⇒ Stange effect - unnumbered chapter in document body and ToC
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Stange effect - unnumbered chapter in document body and ToC
Hi,
or perhaps write \markboth{Context}{Context}.
Stefan
you could use \markboth:hpsmartyz wrote: The bad thing is that in the header of the pages of this "Context" chapter appear the number and title of the last Chapter 3 section (i.e. 3.6 titleofthesection), just like if this chapter was parter of the section 3.6.
Code: Select all
\chapter*{Context}
\markboth{}{}
Stefan
LaTeX.org admin
Re: Stange effect - unnumbered chapter in document body and ToC
Hi
many thanks for your prompt response!
What you have suggested indeed corrects the behaviour related to the section title
in the header.
we now have:
\chapter*{Context}
\markboth{Context}{Context}
this in fact writes "Context" in the headers of the two sides of the pages
while markboth{}{} leaves empty headers.
One problem solved, one remaining
if left like this, the commands are such that Context does not appear
in the ToC.
So we add:
\addcontentsline{toc}{chapter}{Context}
but the problem is that the minitoc of Chapter 4 is now empty and the minitoc of chapter 5 is now the minitoc of Chapter 4, looks like a shift on minitocs.
Any clue?
thanks again

many thanks for your prompt response!
What you have suggested indeed corrects the behaviour related to the section title
in the header.
we now have:
\chapter*{Context}
\markboth{Context}{Context}
this in fact writes "Context" in the headers of the two sides of the pages
while markboth{}{} leaves empty headers.
One problem solved, one remaining

if left like this, the commands are such that Context does not appear
in the ToC.
So we add:
\addcontentsline{toc}{chapter}{Context}
but the problem is that the minitoc of Chapter 4 is now empty and the minitoc of chapter 5 is now the minitoc of Chapter 4, looks like a shift on minitocs.
Any clue?
thanks again

Re: Stange effect - unnumbered chapter in document body and ToC
Hi,
I have found the answer, in the documentation of minitoc
the command should be:
\addstarredchapter{Context}
instead of
\addcontentsline{toc}{chapter}{Context}
thanks for your help.
I may come back in the near future
ps: I have one small subsidiary question:
The text of the Context chapter is positioned just like for the other chapters,
on a new page. Knowing that the Context chapter does not have a minitoc
is there a way to bring the text up and have it start below the Chapter title
instead of on a new page?
thanks.
I have found the answer, in the documentation of minitoc
the command should be:
\addstarredchapter{Context}
instead of
\addcontentsline{toc}{chapter}{Context}
thanks for your help.
I may come back in the near future

ps: I have one small subsidiary question:
The text of the Context chapter is positioned just like for the other chapters,
on a new page. Knowing that the Context chapter does not have a minitoc
is there a way to bring the text up and have it start below the Chapter title
instead of on a new page?
thanks.