Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to format my document with different header and footer for first page. I have done it successfully for the first page but the footer of the second page is not visible. I think the margins of the second page are changed somehow. Would you please help me to fix this problem? Below is the code.

\documentclass[times,10pt,twocolumn]{cls/IEEEtran}

\usepackage{graphicx}
\usepackage{authblk}
%============== For header and footer
\usepackage{fancyhdr}
\pagestyle{fancy}
%  --------   Normal Headers
\lhead{\textbf{\thepage}}
\chead{Paper Title: Modeling Reliability of the Grid}
\rhead{}
\lfoot{Copyright \textcopyright 2014 MECS}
\cfoot{}
\rfoot{\emph{I.J. Computer Network and Information Security}, 2014, vol, issue, pages}
\renewcommand{\headrulewidth}{0pt} % to remove line on header
\renewcommand{\footrulewidth}{0pt} % to remove line on footer

% ----------------------------define new page style for first page
\fancypagestyle{first}{
\fancyhf{} % clear all header and footer fields
\lhead{\emph{\textbf{I.J. Computer Network and Information Security}}, 2014, Vol,     issue, pages\\
Published Online Month 2014 in MECS (http://www.mecs-press.org/)\\
DOI: }
\chead{}
\rhead{\includegraphics[width=2.5cm]{logo.pdf}}
\lfoot{Copyright \textcopyright 2014 MECS}
\cfoot{}
\rfoot{\emph{I.J. Computer Network and Information Security}, 2014, vol, issue, page}
\renewcommand{\headrulewidth}{0pt} % to remove line on header
\renewcommand{\footrulewidth}{0pt} % to remove line on footer
}
%==============

\begin{document}

\title{\vspace{1.3cm}Modeling Reliability of the Grid\vspace{0.5cm}}

\author{\textbf{My name}}
\affil{\vspace{-0.3cm}\small my affiliation and email}

\maketitle
\begin{abstract}
This is abstract
\end{abstract}

\begin{keywords}
Reliability modeling, Grid computing, Grid site reliability, Network reliability
\end{keywords}

\section{Introduction}
\label{sec:introduction}
\thispagestyle{first}

\newpage
this is second page
\newpage
another page

%\bibliographystyle{abbrv} %plain
%\bibliography{refs}

\end{document} 
share|improve this question
    
The excessive height of the first header is pushing the footer too down in the pages after the first. You find a warning by fancyhdr in the log file. –  egreg Jun 22 at 10:05
    
Thank you for your reply. How can I fix it? –  user55914 Jun 22 at 10:21

1 Answer 1

Your first header is too high and this causes fancyhdr to increase the header height from the second page on.

You can fix it by pretending the first header has no height:

\documentclass[10pt,twocolumn]{IEEEtran}

\usepackage{graphicx}
\usepackage{authblk}

%============== For header and footer
\usepackage{fancyhdr}
\pagestyle{fancy}
%  --------   Normal Headers
\fancyhf{} % clear all fields
\fancyhead[L]{\bfseries\thepage}
\fancyhead[C]{Paper Title: Modeling Reliability of the Grid}
\fancyfoot[L]{Copyright \textcopyright 2014 MECS}
\fancyfoot[R]{\emph{I.J. Computer Network and Information Security}, 2014, vol, issue, pages}
\renewcommand{\headrulewidth}{0pt} % to remove line on header
\renewcommand{\footrulewidth}{0pt} % to remove line on footer

% ----------------------------define new page style for first page
\fancypagestyle{first}{%
  \fancyhf{}% clear all header and footer fields
  \fancyhead[L]{\JournalDataAndLogo}%
  \fancyfoot[L]{Copyright \textcopyright 2014 MECS}%
  \fancyfoot[R]{\emph{I.J. Computer Network and Information Security}, 2014, vol, issue, page}%
  \renewcommand{\headrulewidth}{0pt}% to remove line on header
  \renewcommand{\footrulewidth}{0pt}% to remove line on footer
}

\newcommand{\JournalDataAndLogo}{%
  \leavevmode\smash{%
    \raisebox{-2ex}{% <----- adjust to suit
      \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lr@{}}
        \begin{tabular}[b]{@{}l@{}}
        \emph{\textbf{I.J. Computer Network and Information Security}}, 2014, Vol, issue, pages\\
        Published Online Month 2014 in MECS (http://www.mecs-press.org/)\\
        DOI:
        \end{tabular}
        &
        \includegraphics[width=2.5cm,height=1.5cm]{example-image.pdf}
     \end{tabular*}%
    }% end of \raisebox
  }% end of \smash
}
%==============

\begin{document}

\title{\vspace{1.3cm}Modeling Reliability of the Grid\vspace{0.5cm}}

\author{\textbf{My name}}
\affil{\vspace{-0.3cm}\small my affiliation and email}

\maketitle
\begin{abstract}
This is abstract
\end{abstract}

\begin{keywords}
Reliability modeling, Grid computing, Grid site reliability, Network reliability
\end{keywords}

\section{Introduction}
\label{sec:introduction}
\thispagestyle{first}

\newpage
this is second page
\newpage
another page

\end{document} 

Since I don't have your logo, it's not possible to know what's its vertical size; adjust the 2ex in the marked place.

enter image description here

share|improve this answer
    
Great! That worked perfect. Thank a lot. –  user55914 Jun 22 at 12:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.