Page LayoutFancyHdr with color background and Picture Env

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
pthowe
Posts: 17
Joined: Thu Mar 25, 2010 5:47 am

FancyHdr with color background and Picture Env

Post by pthowe »

I am trying to create a page header using fancyHdr.
I have not been successful. I am attaching 3 items.
1. First version of the header (odd pages)
2. Second version of the header (even pages)
3. My attempt LaTeX file.

The macro I am creating takes 2 parameters. One is the text to display. The other is a macro which is a picture graphics/text.
I am using the table to hold everything together. I have tried using the commands in FancyHdr to create the header but nothing gives the color background.

Thanks

PTH
Attachments
Image of original page. (Odd page numbers)
Image of original page. (Odd page numbers)
FirstImagePageHeader.jpg (18.13 KiB) Viewed 7699 times
Image of original page. (Even page numbers)
Image of original page. (Even page numbers)
SecondImagePageHeader.jpg (19.92 KiB) Viewed 7699 times
PSKK_test.tex
LaTeX example trying to create macro which creates header
(791 Bytes) Downloaded 351 times
Last edited by pthowe on Mon Jun 14, 2010 4:16 pm, edited 1 time in total.

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
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

FancyHdr with color background and Picture Env

Post by localghost »

There is an example that might inspire you [1]. It works with pgf/tikZ and titlesec.

[1] Fancy chapter headings | TikZ example


Thorsten
pthowe
Posts: 17
Joined: Thu Mar 25, 2010 5:47 am

Re: FancyHdr with color background and Picture Env

Post by pthowe »

As Directed I took a look at the tikz package. I used the example as a starting point. Here is a link to the example I started with.

http://www.texample.net/tikz/examples/f ... -headings/

I was able to build a sectionlabel command. This looks at the page number for \isodd.
If found it reverses the placement of the graphic and the text label.

Two issues: 1. I can not remove the \chapterlabel command with out losing the \sectionlabel commands function? (I thought they were independent.)

2. I get a section number with the text and the graphics. I would like to remove both but can live with only removing the number from the graphics.

3. I would like to have 2 parameters. One for the text and a second for the graphics. I have not been able to get the second parameter to work.

Thanks
Attachments
HeaderTest_tikz.tex
Test using tikz as bases.
(4.07 KiB) Downloaded 349 times
pthowe
Posts: 17
Joined: Thu Mar 25, 2010 5:47 am

Re: FancyHdr with color background and Picture Env

Post by pthowe »

Hi Everyone,
Some progress. I have one issue remaining.
I would like to pass 2 parameters to the macro

\section{The Section}{\MFP}
\section{The Other}{\MFP2}

It is accepting the first parameter but I can not get the second.
I have reduced my example to be smaller.

Thanks
Attachments
HeaderTest_tikz_2.tex
Example of macro and test document using the macro. Does not accept second parameter to macro.
(3.13 KiB) Downloaded 344 times
pthowe
Posts: 17
Joined: Thu Mar 25, 2010 5:47 am

Re: FancyHdr with color background and Picture Env

Post by pthowe »

Hi Everyone,
I reworked the example. I have an example which uses FancyHdr.
I need some direction. I want to make the RED block wider.

The section text needs to be higher in the block. I do not know
how to adjust the position of this text.

Putting red block higher and correctly setting page length would also help
Can not see footer.

HELP

Thanks
Attachments
HeadTest_fancyhdr.tex
Test using fancyhdr package. Needs position of section title updated
(2.26 KiB) Downloaded 404 times
pthowe
Posts: 17
Joined: Thu Mar 25, 2010 5:47 am

FancyHdr with color background and Picture Env

Post by pthowe »

Hi everyone, I have made progress but not found success. I have gaps in my header and I have lost the margins. Here is the code for my header.

Code: Select all

\newcommand{\formPageHeader}[2]{
	\fancyhead{}
	\addtolength{\voffset}{-3cm} % remove gap at top
	\addtolength{\headsep}{5cm}	% space betwen header and text
	\fancyhead[CE,CO]{\colorbox{red}{
	\begin{tabular}[t]{l}
	  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \\
	  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \\
	  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \\
	  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \\
	  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \\
	  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \\
	  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \\
	  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \\
	  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \\
	  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \\
	  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  \\
	\end{tabular}
	 }}
	\fancyhead[LE,RO]{\colorbox{red}{
	\begin{tabular}[t]{l}
		 \ \\
		 \textbf{\textcolor{white}{\Huge{#1}}}  \\
		 \  \\
		 \  \\
 \   \\			 
\    \\				 
\   \\				 
\   \\				
\   \\
\   \\
\end{tabular}
		}}
\fancyhead[LO,RE]{\colorbox{red}{
\begin{tabular}[t]{lll} 
\ & \  									  & \ \\
\ & \textbf{\textcolor{white}{#2}} & \ \\
\ & \  									  & \ \\
\end{tabular}}}
\addcontentsline{toc}{section}{#1}
\fancyfoot{} % clear all footer fields
\fancyfoot[LE,RO]{\thepage}
\fancyfoot[RE,LO]{\copyright Philadelphia School Korean Karate}
\renewcommand{\footrulewidth}{0.5pt}
}
Using the center option to fill in the middle seems like a bad idea but it works. I am attaching a complete working example. (image files may need to be removed)
Attachments
FancyHdr_example.tex
Example produces 3 pages
(6.85 KiB) Downloaded 414 times
Post Reply