1

I am trying to customize my resume template and I want to have contact info on every page of the document. I tried to use fancyhdr achieve this but however it introduced some extra space/margin on my second page which is unwanted, and now I have been stuck here for a while. Any idea what could be the cause and suggestion for a fix would be greatly appreciated!

PS: in my code I have written the comment %THE PROBLEM!!!!!!!!!! where I introduced the fancyhdr header.

The issue

resume.cls

\ProvidesClass{resume}[2010/07/10 v0.9 Resume class]

\LoadClass[11pt,letterpaper]{article} % Font size and paper type

\usepackage[parfill]{parskip} % Remove paragraph indentation
\usepackage{array} % Required for boldface (\bf and \bfseries) tabular columns
\usepackage{ifthen} % Required for ifthenelse statements

% My custom packages
\usepackage{xcolor}
\usepackage{fancyhdr}

% My custom definitons
\definecolor{MyBlue}{HTML}{013587}

\pagestyle{empty} % Suppress page numbers

%----------------------------------------------------------------------------------------
%   HEADINGS COMMANDS: Commands for printing name and address
%----------------------------------------------------------------------------------------


\pagestyle{plain}% Set page style to plain.
\def \name#1{\def\@name{#1}} % Defines the \name command to set name
\def \@name {} % Sets \@name to empty by default

\def \addressSep {\space\textbar\space}
% \def \addressSep {$\diamond$} % Set default address separator to a diamond


% One, two or three address lines can be specified 
\let \@addressone \relax
\let \@addresstwo \relax
\let \@addressthree \relax

% \address command can be used to set the first, second, and third address (last 2 optional)
\def \address #1{
  \@ifundefined{@addresstwo}{
    \def \@addresstwo {#1}
  }{
  \@ifundefined{@addressthree}{
  \def \@addressthree {#1}
  }{
     \def \@addressone {#1}
  }}
}

% \printaddress is used to style an address line (given as input)
\def \printaddress #1{
  \begingroup
    \def \\ {\addressSep\ }
    \centerline{#1}
  \endgroup
  \par
  \addressskip
}


% \printname is used to print the name as a page header
\def \printname {
  \begingroup
    \hfil{\MakeUppercase{\namesize\bf \@name}}\hfil
    \nameskip\break
  \endgroup
}

%----------------------------------------------------------------------------------------
%   PRINT THE HEADING LINES
%----------------------------------------------------------------------------------------


% THE PROBLEM!!!!!!!!!!
\renewcommand\headrulewidth{0pt} % remove the header rule

\let\ori@document=\document
\renewcommand{\document}{
  \ori@document  % Begin document
  
    \newgeometry{left=0.75in,top=1.6in,right=0.75in,bottom=0.6in}
    \pagestyle{fancy} % the default page style for the document
    
    \fancyhead[C]{
        \printname % Print the name specified with \name
          \@ifundefined{@addressone}{}{ % Print the first address if specified
            \printaddress{\@addressone}}
          \@ifundefined{@addresstwo}{}{ % Print the second address if specified
            \printaddress{\@addresstwo}}
             \@ifundefined{@addressthree}{}{ % Print the third address if specified
            \printaddress{\@addressthree}}
    }
    

}



%----------------------------------------------------------------------------------------
%   SECTION FORMATTING
%----------------------------------------------------------------------------------------

% Defines the rSection environment for the large sections within the CV
\newenvironment{rSection}[1]{ % 1 input argument - section name
  \sectionskip
  \textcolor{MyBlue}{\MakeUppercase{\bf #1}} % Section title
  \sectionlineskip
  \hrule % Horizontal line
  \begin{list}{}{ % List for each individual item in the section
    \setlength{\leftmargin}{1.5em} % Margin within the section
  }
  \item[]
}{
  \end{list}
}

%----------------------------------------------------------------------------------------
%   WORK EXPERIENCE FORMATTING
%----------------------------------------------------------------------------------------

\newenvironment{rSubsection}[4]{ % 4 input arguments - company name, year(s) employed, job title and location
 {\bf #1} \hfill {#2} % Bold company name and date on the right
 \ifthenelse{\equal{#3}{}}{}{ % If the third argument is not specified, don't print the job title and location line
  \\
  {\em #3} \hfill {\em #4} % Italic job title and location
  }\smallskip
  \begin{list}{$\cdot$}{\leftmargin=0em} % \cdot used for bullets, no indentation
   \itemsep -0.5em \vspace{-0.5em} % Compress items in list together for aesthetics
  }{
  \end{list}
  \vspace{0.5em} % Some space after the list of bullet points
}

% The below commands define the whitespace after certain things in the document - they can be \smallskip, \medskip or \bigskip
\def\namesize{\huge} % Size of the name at the top of the document
\def\addressskip{\smallskip} % The space between the two address (or phone/email) lines
\def\sectionlineskip{\medskip} % The space above the horizontal line for each section 
\def\nameskip{\bigskip} % The space after your name at the top
\def\sectionskip{\medskip} % The space after the heading section

Resume.tex

\documentclass{resume} % Use the custom resume.cls style

\usepackage{lipsum}
\usepackage[left=0.75in,top=0.6in,right=0.75in,bottom=0.6in]{geometry} % Document margins
\usepackage{times}
\usepackage{fontawesome}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{array}
\usepackage{tikz}
\newcommand{\tab}[1]{\hspace{.2667\textwidth}\rlap{#1}}
\newcommand{\itab}[1]{\hspace{0em}\rlap{#1}}
\def\ci#1{\textcircled{\resizebox{0.55em}{!}{#1}}}

% header
\name{name}  
\address{  
    {{\faPhone} {\fontsize{10}{10} \selectfont (+00)00000000}} \\
    {{\faEnvelope} {\fontsize{10}{10} \selectfont \href{mailto:[email protected]}{[email protected]} }} \\
    {{\faLinkedin} {\fontsize{10}{10} \selectfont \href{https://www.linkedin.com}{name} }}
}

\begin{document}

\begin{rSection}{section 1}

\lipsum[2-4]
\end{rSection}


\begin{rSection}{section 2}
\lipsum[1-2]
\end{rSection}

\clearpage

\begin{rSection}{section 3}
\lipsum[2-4]
\end{rSection}

\begin{rSection}{section 4}
\lipsum[1-2]
\end{rSection}



\end{document}
10
  • 2
    your header is too large for the reserved space, either change the page geometry so that the content can fit, or smash the content so that its actual height is hidden. May 1, 2021 at 13:51
  • I tried playing around with the geometry parameters, but it didn't seem to affect the space between the header and the body.
    – Enigma
    May 1, 2021 at 14:56
  • I am not entirely sure how to use the \smash, will have to investigate a bit more.
    – Enigma
    May 1, 2021 at 14:58
  • In my system there is no such extra space on page 2. Your posted code woks fine. May 1, 2021 at 15:09
  • 1
    fancyhdr changed its behaviour here in the last release @SimonDispa May 1, 2021 at 15:22

1 Answer 1

0

Thanks to the comments I solved it. The problem was that the header took up a too much space as Ulrike mentioned, and I had to make up for it by adding the geometry parameter headheight and give it a greater value. However Simon noticed for some reason rendering it in TeXworks instead of Overleaf seemed to automatically take care of the issue.

2
  • Overleaf probably uses an older version of fancyhdr which causes the second and following pages to shift down. May 1, 2021 at 17:06
  • @PietervanOostrum Yes, I also believe that is the reason! Overleaf will probably do an update later.
    – Enigma
    May 1, 2021 at 17:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .