Page LayoutHeaders After First Page...

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
EFaden
Posts: 24
Joined: Thu Jun 04, 2009 2:58 am

Headers After First Page...

Post by EFaden »

Hey All....

I am working on my resume and have run into a little problem I can't seem to solve. I have the first page setup such that it has no header and I just put a custom header on to that page. I then want to have a header on subsequent pages. I can't seem to figure out how to get the layout to work correctly.

Code: Select all

\geometry{	
	letterpaper,
	margin=0.5in,
	includeheadfoot
}

%% Header/Footer
\pagestyle{fancy} 
\lhead{Me}
\chead{}
\rhead{}
\lfoot{}
\cfoot{}
\rfoot{\thepage\ of \pageref{LastPage}} 
\renewcommand{\headrulewidth}{1.5pt}
\renewcommand{\footrulewidth}{1.5pt}
                    
%% First Page Style
\fancypagestyle{plain}{% 
	\fancyhf{} % clear all header and footer fields 
	\fancyfoot[R]{\thepage\ of \pageref{LastPage}} % except the center 
	\renewcommand{\headrulewidth}{0pt} 
	\renewcommand{\footrulewidth}{1.5pt}
}          
Then I use thispagestyle on the first page to clear the header, and readd the footer. The problem is that with inclueheaderfooter the spacing is right on the second page, but not the first since I don't actually want a header on the first. If I set it to just includefooter the second page is wrong but the first page is right.

I have looked at fancyhdr and geometry and I still can't seem to make it work correctly. Any thoughts?

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

Headers After First Page...

Post by localghost »

EFaden
Posts: 24
Joined: Thu Jun 04, 2009 2:58 am

Headers After First Page...

Post by EFaden »

Sorry....

If you compile the below you can see that I basically have a "custom" header on the first page. I want both pages to have the same footer, I just don't want the first page to have the custom header. I then want to have all subsequent pages have the header at the correct spot. You can see that the vertical alignment of the headers etc. in the example is all messed up.

MWE

Code: Select all

%% Resume

\documentclass[10pt,letter]{article}
      
\usepackage[T1]{fontenc}     % other or additional encodings might be suggestive
\usepackage[utf8]{inputenc}  % Unciode encoding, other encodings possible
\usepackage[english]{babel}  % other or additional languages possible, essential for documents not in English
\usepackage{lmodern}         % only if other font packages are not substantial
\usepackage{blindtext}       % alternatively the package »lipsum« is possible
\usepackage{filecontents}    % only if externals files are unavoidable which can be provided in a »filecontents« environment.

\usepackage{geometry}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\usepackage{lastpage}

\geometry{	
	letterpaper,
	margin=0.5in,
	includefoot
}

%% Header/Footer
\pagestyle{fancy} 
\lhead{My Name}
\chead{}
\rhead{}
\lfoot{}
\cfoot{}
\rfoot{\thepage\ of \pageref{LastPage}} 
\renewcommand{\headrulewidth}{1.5pt}
\renewcommand{\footrulewidth}{1.5pt}
                    
%% First Page Style
\fancypagestyle{plain}{% 
	\fancyhf{} % clear all header and footer fields 
	\fancyfoot[R]{\thepage\ of \pageref{LastPage}} % except the center 
	\renewcommand{\headheight}{0pt}
	\renewcommand{\headrulewidth}{0pt} 
	\renewcommand{\footrulewidth}{1.5pt}
}

\setlength\parindent{0.0in}
\setlength\parskip{0.0in}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Document

\begin{document} 
	\thispagestyle{plain}
	\begin{center}\fontfamily{phv}\selectfont\huge\scshape{}My Name\end{center}
	\vspace{-12pt} \rule{\textwidth}{1.5pt}

   	\blinddocument
\end{document}
Post Reply