## LaTeX forum ⇒ General ⇒ Header and footer Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
Jchen066
Posts: 13
Joined: Tue Aug 28, 2018 12:50 am

Tried to use pictures for header and footer. please see below code used and the output:

The header picture doesn't covere the entire header area. Can I change the header height to match the picture or other way around.

\documentclass[12pt,english]{article} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PACKAGES%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % GEOMETRY - Provide the geometry settings of document\usepackage{geometry}\geometry{	left = 28mm,	right = 28mm,	top = 50mm,	bottom = 28mm,	bindingoffset = 0mm,	headheight = 103pt,	headsep = 15mm,	footskip = 0mm} \usepackage{lmodern} % AMSFONTS - Allows for \mathbb fonts\usepackage{amsfonts} % MARGINNOTE - Allows for additive calculations\usepackage{marginnote,calc,kantlipsum} % TIKS & PGFPLOTS - Allows the creation of graphics\usepackage{tikz}\usepackage{pgfplots} % PARSKIP - Provides instant formatting to indents on paragraphs. Having this package will remove indentation.\usepackage{parskip} % LIPSUM - For debugging purposes; provides text in Latin\usepackage{lipsum} % ESO-PIC - Allows floating text (and perhaps pictures) to be placed in either the foreground or backgrounds\usepackage[pscoord]{eso-pic} % COLOR - Allows user to user colours on text\usepackage{color}\usepackage{xcolor} % TCOLORBOX - Allows for coloured boxes\usepackage{tcolorbox} % VLecture Colours \definecolor{vlecture}{RGB}{63,163,175}\definecolor{vlecture2}{RGB}{184,189,38} % TITLESEC - Stylign on default section headings \usepackage{titlesec} % RELSIVE - Increase the size of equations in the math environment \usepackage{relsize} % CONTOUR - Contours on titles \usepackage{contour} \titleformat{\section}{\color{vlecture}\normalfont\Large\bfseries}{\color{vlecture}\thesection}{1em}{} \titleformat{\subsection}{\color{vlecture2}\normalfont\large\bfseries}{\color{vlecture2}\thesubsection}{1em}{} % MULTICOL - For multiple columns \usepackage{multicol} % DASHRULE \usepackage{arydshln} \setlength{\dashlinedash}{0.2pt}\setlength{\dashlinegap}{4.5pt}\setlength{\arrayrulewidth}{0.2pt} % FANCYHDR - For additional options on headers and footers\usepackage{fancyhdr}\usepackage{array} \newlength{\myoddoffset}\setlength{\myoddoffset}{\marginparwidth + \marginparsep} \pagestyle{fancy}\fancyheadoffset[leh,roh]{\myoddoffset} \fancyheadoffset[loh,reh]{\myoddoffset} \fancyheadoffset[lf,rf]{\myoddoffset + 25pt} %\fancyheadoffset[lof,ref]{\myoddoffset + 25pt} %\lhead{\Large \bfseries\begin{tabular}{c}Year 11 \\ Mathematics \\ Extension 1\end{tabular}} \fancyhead[L]{	\large \bfseries \sffamily 	\begin{tabular}{c}		Year 11 \\ Mathematics \\ Extension 1	\end{tabular}} \fancyhead[C]{	\begin{tabular}{c}		\includegraphics[height=2.9cm, width=22cm]{C:/Users/jiech/Documents/Tuition/pictures/pictures/header.png}	\end{tabular}} \fancyhead[R]{	\large \bfseries	Volume (i)} \fancyfoot[L]{	\includegraphics[height=2.8cm, width=22cm]{C:/Users/jiech/Documents/Tuition/pictures/pictures/footer.png}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% COMMANDS%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%      \begin{document}  	% Create title page   	\section{Introduction}   \end{document}
Attachments
head 2.PNG (32.24 KiB) Viewed 8581 times
Last edited by Stefan Kottwitz on Sun Sep 16, 2018 4:37 pm, edited 1 time in total.
Reason: code marked

rais
Posts: 177
Joined: Sun Nov 16, 2014 8:51 pm
Hi there,
There's nothing wrong with that as such, but according to the column declaration---the {c}---you want \tabcolsep space left (and right) of this column.
Try {@{}c@{}} instead (the @{} cuts off the additional space, here on both sides of the c column).

KR
Rainer

Jchen066
Posts: 13
Joined: Tue Aug 28, 2018 12:50 am
rais wrote:Hi there,
There's nothing wrong with that as such, but according to the column declaration---the {c}---you want \tabcolsep space left (and right) of this column.
Try {@{}c@{}} instead (the @{} cuts off the additional space, here on both sides of the c column).

KR
Rainer

Thanks Rainer. Indeed, it removed the space from both left and right side.

Is there a way to align the logo (the blue golden line) to the header line (dark line)

rais
Posts: 177
Joined: Sun Nov 16, 2014 8:51 pm
Well, you could put the image in a \raisebox and let it tell LaTeX, its contents has neither height nor depth.
However, your header image will then most likely overwrite the stuff from the left side; looks like you've already considered that and used a transparent background (otherwise, year 11' wouldn't have been visible). So for those using a header file without transparency, I'd put the header image into a \makebox in the left header part already, where I can tell LaTeX to overwrite this box:
\fancyhead[L]{%  \makebox[0pt][l]{%    \raisebox{-8mm}[0pt][0pt]{%      \includegraphics[height=3.5cm, width=22cm]{header}%    }%  }%  \large \bfseries \sffamily   \begin{tabular}{c}    Year 11 \\ Mathematics \\ Extension 1  \end{tabular}%}`

Or, you could use the eso-pic package for putting the header image in the background at top of the page (you're already loading it).

KR
Rainer