Page Layout ⇒ Header Footer Margins
Header Footer Margins
I want my document header and footer to be wider than the main body of the text. How can I do that? I am using fancyheadings package currently.
Thank you,
NKal
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Header Footer Margins
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Header Footer Margins
I used the titlesec package. I am still not able to make the header and footer go longer than the text on both sides. I have some more packages added. This is what I have in my code so far in regard to the header & footer:
Code: Select all
\usepackage{fancyheadings}
\usepackage{ifthen}
\usepackage{titlesec}
\setlength{\oddsidemargin}{0.25in}
\setlength{\hoffset}{0.2in}
\setlength{\textwidth}{5.8in}
\setlength{\topmargin}{0.6in}
\setlength{\voffset}{-0.5in}
\setlength{\textheight}{8.8in}
\pagestyle{fancy}
\headheight 30pt
\footskip 40pt
\rhead{}
\lhead{\fancyplain{}{\ifthenelse{\thepage=1}{}{\textbf{\parbox{6.5in}{\fontsize{11pt}{30pt}\fontfamily{phv}\selectfont{\footnotesize{I Want a wide header \hspace{0.4in} XXXX}\small{100010} \hspace{0.7in} \small{PAGE} \small{\thepage}} \\ }}}}}
\rhead{\fancyplain{}{\ifthenelse{\thepage=1}{}{\parbox{6.5in}{\fontsize{11pt}{0pt}\fontfamily{phv}\selectfont{\hspace{4.2in}\small{ \textbf{Checking Report 2}}} }}}}
\cfoot{}
\lfoot{\parbox{6.3in}{\fontsize{11pt}{0pt}\fontfamily{phv}\selectfont{\textbf{WASHINGTON (CNN) -- The federal government is at risk of being unable to fight off attacks on the nation's computer networks unless it strengthens its cyber-security work force, according to a report released Wednesday.}}}}
\widenhead[0.5in][0.5in]{0.5in}{0.5in}
Re: Header Footer Margins
Thank you for the references and the welcome!
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Header Footer Margins
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Header Footer Margins
I could get the right margins for the header and footer. However, I have a new issue now. The head separation increases from page 2 to 3. The whole text shifts downwards after the header on page 3. So the position of the header does not change but rest everything moves almost 24 pt downwards vertically.
May be my textwidth and other margins dont add up. I have the code included.
Would you know a possible reason for this?
Thanks a ton!
NKal
Code: Select all
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mitpress}
\usepackage{chicago}
\usepackage{alltt}
\usepackage{fancyhdr}
\usepackage[dvips]{graphicx}
\usepackage{ulem}
\usepackage{ifthen}
% ******************* page settings *****************************************
\newdimen\dummy
\dummy=\oddsidemargin
\setlength{\oddsidemargin}{0.25in}
\setlength{\hoffset}{0.2in}
\setlength{\textwidth}{5.8in}
\setlength{\topmargin}{0.6in}
\setlength{\voffset}{-0.5in}
\setlength{\textheight}{8.8in}
% ******************* HEADER & FOOTER ******************************************
\pagestyle{fancy}
\headheight 0.33in
\headsep 0.25in
%\footskip 40pt
\rhead{}
\lhead{\fancyplain{}{\ifthenelse{\thepage=1}{}{\textbf{\parbox{6.8in}{\fontsize{11pt}{30pt}\fontfamily{phv}\selectfont{\footnotesize{I Want a wide header \hspace{0.4in} XXXX}\small{100010} \hspace{0.7in} \small{PAGE} \small{\thepage}} \\ }}}}}
\rhead{\fancyplain{}{\ifthenelse{\thepage=1}{}{\parbox{6.8in}{\fontsize{11pt}{0pt}\fontfamily{phv}\selectfont{\hspace{4.2in}\small{ \textbf{Checking Report 2}}} }}}}
\cfoot{}
\lfoot{\parbox{6.8in}{\fontsize{11pt}{0pt}\fontfamily{phv}\selectfont{\textbf{WASHINGTON (CNN) -- The federal government is at risk of being unable to fight off attacks on the nation's computer networks unless it strengthens its cyber-security work force, according to a report released Wednesday.}}}}
\fancyhfoffset[L]{0.5in}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\begin{document}
% BODY TEXT HERE
\end{document}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Header Footer Margins
Omit the dvips driver option for the graphicx package. It detects on its own which compiler is running and loads the right driver automatically.
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10