tags:

views:

253

answers:

2

Hi,

I'm trying to define a custom layout for my report for which I'm using fancyhdr. On the pages which contains a chapter start I want my header to contain a colorbox spanning across the whole page (0 cm margins) although keeping my defaults margin in the text area. I can get the box to span across the "margin notes" area, but not the other side. Here's some of my code:

\fancypagestyle{plain}{ % pages containing chapter start
    \fancyhead{}
    \fancyhead[RO]{\colorbox{NavyBlue}{\textcolor{White}{\raisebox{0cm}[1cm][0.5cm]{\makebox[3cm][c]{\textbf{\CNoV\thechapter}}}}}
}

Any ideas on how to do it?

UPDATE

alt text

As you can see I want my header to span across the whole page (on pages containing chapter start). The text should have the normal margins..

A: 

I'm not entirely sure what you want, but perhaps this is it:

\fancypagestyle{plain}{ % pages containing chapter start
        \fancyhead{}
        \fancyhead[RO]{\hspace*{-5cm}
        \colorbox{NavyBlue}{\textcolor{White}{\raisebox{0cm}[1cm][0.5cm]{\makebox[25cm][c]{%
            \textbf{\CNoV\thechapter}}}}}}
}
Rob Hyndman
A: 

Take a look at Fancy chapter headings example at the texample.net site. It appears to be what your are looking for.

alt text

midtiby
Good example. How do I place the chapter name in the middle (vertical) of the lightblue bar?
Morten