# Need directions on how to gain more control over graphical design of header/footers

I have a design of a letterhead which contains a header and a footer as seen below in ASCII-form. As you can see it contains a header and a footer which have both above and below a horizontal ruler. These rulers have color (ie: are not black) and more than 1 pixel high. Within those two horizontal ruler is text. In the header it has three text blocks, two lined out on the left, the 3rd lined out to the right. The footer just contains a line of text. Above a header is a logo, which partly falls out of the page-margins.

It seems fairly simple, however I am not very advanced when it comes to LaTeX. I have many people seen recommend the fancyhdr package in similar cases and took a look at it, but have not yet found out what is the best to start with. Anyone who can give me at least some directions on where to look to accomplish such a thing?

                                  a logo above
which partly falls
of page-margin
--------------------------------------
text    text                      text
block1  block2                  block3
--------------------------------------
this is where the header has ended and
the actual page starts

with lots of text

lorem ipsum and the likes

this is where the page ends and a
footer comes in
--------------------------------------
this is a footer with some text
--------------------------------------
page#

-
Do you want to use this layout for a letter as well or for other documents? Have a look at the layout options of koma-script classes (texdoc scrguien). They can do quite a lot out of the box. – Christoph Apr 3 '12 at 12:32
I've tried to look it up, but can't find anything on texdoc and scrguien within the koma script manual. To be honest, the koma script manual is a bit mind blowing when not an advanced latex writer... – grrrbytes Apr 3 '12 at 16:04
Btw: it's mainly for letters, but might be for other documents too. I have now set the design of the letterhead as a background in the latex-file. Which kind of works, but does not give me a lot of flexibility in terms of changing text or layout without opening inkscape... Anyhow, I'm reading manuals on fancyhdr and koma script, but it's a bit hard i must say – grrrbytes Apr 3 '12 at 16:14

Here's a possible option using the background package; the footer and header are placed as background material. Of course, depending on your actual settings, some dimensions will have to be adjusted:

\documentclass{article}
\usepackage{xcolor}
\usepackage{array}
\usepackage{fourier}
\usepackage{graphicx}
\usepackage{lipsum}

\definecolor{rulecolor}{RGB}{188,71,71}

\newcommand\fieldi{text1}
\newcommand\fieldii{text2}
\newcommand\fieldiii{text3}
\newcommand\fieldiv{text4}
\newcommand\fieldv{text5}
\newcommand\fieldvi{text6}

\newcommand\footertext{text text text}

\newcommand\ColRule{%
{\noindent\color{rulecolor}\rule{\textwidth}{1.5pt}}}

\noindent\makebox[\textwidth][l]{\parbox{1.2\textwidth}{%
\hfill\includegraphics[height=2cm]{cc}}}\par\vskip1ex%
\ColRule\par\noindent
\begin{tabular*}{\textwidth}%
{@{}>{\raggedright}p{.25\textwidth}@{}>{\raggedright}p{.25\textwidth}@{}>{\raggedleft}p{.5\textwidth}@{}}
\fieldi & \fieldii & \fieldiii \tabularnewline
\fieldiv & \fieldv & \fieldvi \tabularnewline
\end{tabular*}\par\ColRule\par}

\newcommand\Footer[1]{%
\ColRule\par
\noindent\begin{tabular*}{\textwidth}{@{}>{\raggedright}p{\textwidth}@{}}
\footertext
\end{tabular*}\par\vskip-1.5ex\ColRule\par\centering\thepage\par}

\usepackage{background}
\SetBgColor{black}
\SetBgAngle{0}
\SetBgScale{1}
\SetBgOpacity{1}
\SetBgContents{%
\begin{tikzpicture}[remember picture,overlay]
\node at (0,-0.55\textheight) {\parbox{\textwidth}{\Footer}};
\end{tikzpicture}
}

\pagestyle{empty}

\begin{document}

\lipsum[1-20]

\end{document}


The creative commons logo was taken from here.

And here's a solution using fancyhdr; as you can see, all the job was done with the definitions of \Header and \Footer; once these definitions are made, it is a matter of personal taste whether to follow the background or the fancyhdr approach:

\documentclass{article}
\usepackage{xcolor}
\usepackage{array}
\usepackage{fourier}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{fancyhdr}

\definecolor{rulecolor}{RGB}{188,71,71}

\newcommand\fieldi{text1}
\newcommand\fieldii{text2}
\newcommand\fieldiii{text3}
\newcommand\fieldiv{text4}
\newcommand\fieldv{text5}
\newcommand\fieldvi{text6}

\newcommand\footertext{text text text}

\newcommand\ColRule{%
{\noindent\color{rulecolor}\rule{\textwidth}{1.5pt}}}

\noindent\makebox[\textwidth][l]{\parbox{1.2\textwidth}{%
\hfill\includegraphics[height=2cm]{cc}}}\par\vskip1ex%
\ColRule\par\noindent
\begin{tabular*}{\textwidth}%
{@{}>{\raggedright}p{.25\textwidth}@{}>{\raggedright}p{.25\textwidth}@{}>{\raggedleft}p{.5\textwidth}@{}}
\fieldi & \fieldii & \fieldiii \tabularnewline
\fieldiv & \fieldv & \fieldvi \tabularnewline
\end{tabular*}\par\ColRule\par}

\newcommand\Footer[1]{%
\ColRule\par
\noindent\begin{tabular*}{\textwidth}{@{}>{\raggedright}p{\textwidth}@{}}
\footertext
\end{tabular*}\par\vskip-1.5ex\ColRule\par\centering\thepage\par}

\fancyhf{}
\fancyfoot[C]{\Footer}
\pagestyle{fancy}

\begin{document}

\lipsum[1-20]

\end{document}

-
Thanks Gonzalo. It seems to do quite what I want. Despite that when I load the code, the text overflows the footer. But it gives me some start to work from. Although I am still looking for a solution whereby you modify the standard header/footer functionalities as that will give it more flexibility, standardization and power – grrrbytes Apr 3 '12 at 23:26
@Mixhael: as I said, depending on your actual settings, you will have to adjust some of the lengths used. If I have the time, I will provide a solution using some of the packages providing tools for page style design. – Gonzalo Medina Apr 4 '12 at 0:41
@Mixhael: I've updated my answer with an example using fancyhdr. – Gonzalo Medina Apr 4 '12 at 1:12
Great, this works. Tthere are still some minor issues. See my markup here: pastebin.com/zRMLSgFP Issues: - text in footer and header between rules is not aligned vertically - when I make the slogan lines colored, they jump down and mess up the table-layout - Same when coloring the footer text color Two questions: 1) is there a quick way to say: the first three columns should be in italic, rather than styling each txt separately? 2) To what extent is this flexible in terms of: no pagenrs on title page, roman numbering on index pages, etc? Since it seems pagenumbering is hard-coded now – grrrbytes Apr 4 '12 at 12:59
@Mixhael: see this: pastebin.com/a1nx5msn. I fixed some issues the fourth column of header (better to use \textcolor instead of \color). Problem 1): you can add \itshape to the >{...} column declaration (as I did in the code). Problem 2: no, the page numbering is not hard-coded; all the code does is to place the numbering in a certain position. So, there will be no problems. Of course, this page style won't apply to the pages that have their own style assigned internally (first page of every \chapter, for example). – Gonzalo Medina Apr 4 '12 at 23:42