Page LayoutChapter in the head of the page

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Chapter in the head of the page

Post by localghost »

QwareeqMathematics wrote:[...] But , I wonder why I should take them out of center environment.?? [...]
It simply doesn't make any sense because these commands have not effect on the local output. They just add some information to the ToC layout.


Best regards
Thorsten

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
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Chapter in the head of the page

Post by gmedina »

QwareeqMathematics wrote:...But , I wonder why I should take them out of center environment.??...
In fact, it's enough to protect[1] the \addvspace command, and it's advisable to always do so. Instead of simply

Code: Select all

\addtocontents{toc}{\addvspace{-10pt}}
one should always use

Code: Select all

\addtocontents{toc}{\protect\addvspace{-10pt}}
[1]Here you can find some explanation about "protection" and fragile commands:

TeX Frequently Asked Questions -- question label "protect"

The \addvspace command has some particularities and subtleties, which you can find explained, for example, in the LaTeX Companion (2nd Edition).

Addendum: for clarity's sake (and to prevent possible future misunderstandings) I will edit the reply in which I suggested the use of \addvspace for the first time, to protect those commands.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
QwareeqMathematics
Posts: 68
Joined: Mon Jul 06, 2009 7:44 pm

Re: Chapter in the head of the page

Post by QwareeqMathematics »

Thank You ;)
Post Reply