alihaider82 wrote:
1 - How to align CHAPTER1 in center header to the top or middle of the header?
You mean vertically? That's actually a little tricky to do. I'll put one way of doing it in a sample below; it involves merging the three part of the header and using hfill to align the images to the left and right.
2 - How to align right image in the header to the page border/frame?
That'll be covered in my answer to #1, though the real trick is that the frame is wider than the text block, and so you need to use a makebox to make the header bigger too.
3 - How can I merge cells A & B in the footer to print a single text entry like Title: \the title?
Use the \multicolumn command. I put this in my sample below.
4 - How to adjust cell size (width) according to the text and how to change the font size in the footer and header?
For adjusting cell size, you have already been instructed
twice to read the documentation for the tabularx package, and show no sign of having done so. Do that, and you'll probably answer your own question. If not, well, I can't give any better answer unless you're more specific about what you want to do. Since you presumably want the table width to be no narrower and no wider than the frame, you can't make all the columns match their width to their contents, and you haven't made it clear which ones should stretch, which ones should wrap, etc.
As for changing font size, you do that the normal way with commands like \small, \large, \footnotesize, etc.
Code: Select all
\documentclass[a4paper]{report}
\usepackage{tabularx}
\usepackage{fancybox}
\usepackage{titletoc}
\usepackage{graphicx}
\usepackage{color}
\usepackage{titling}
\title{Some title long enough to go into next cell}
\usepackage{geometry}
\geometry{%
left=1in,
right=1in,
top=1.5in,
headsep=8pt,
headheight=115pt,
bottom=2.5in,
footskip=8pt
}
\usepackage{fancyhdr}
\pagestyle{fancy}
\newlength{\hfwidth}
\setlength{\hfwidth}{\textwidth}
\addtolength{\hfwidth}{16pt}
\addtolength{\hfwidth}{2\fboxrule}
\renewcommand{\headrulewidth}{0pt}
\newcommand{\myvcenter}[1]{\ensuremath{\vcenter{\hbox{#1}}}}
\fancyhf{}
\fancyhead{\makebox[\hfwidth]{\myvcenter{\includegraphics[width=0.25\textwidth]{Sunset.jpg}}
\hfill
\color{blue}{\uppercase{chapter1}}
\hfill
\myvcenter{\includegraphics[width=0.25\textwidth]{Winter.jpg}}}}
\fancyfoot[L]{%
\vspace{0pt}\renewcommand{\arraystretch}{3}\begin{tabularx}{\hfwidth}{|X|X|X|X|}
\hline
\multicolumn{2}{|l|}{Title: \thetitle} & C & D \\ \hline
E & F & Date: \today & Page~\thepage \\ \hline
\end{tabularx}}
\begin{document}
\fancypage{\setlength{\fboxsep}{8pt}\fbox}{}
Body text
\end{document}