缺少页脚问题

缺少页脚问题

我正在尝试为第一页设置不同的页眉和页脚来格式化我的文档。我成功地为第一页设置了页眉和页脚,但第二页的页脚不可见。我认为第二页的页边距以某种方式发生了变化。你能帮我解决这个问题吗?以下是代码。

\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} 

答案1

您的第一个页眉太高,这导致fancyhdr从第二页开始增加页眉高度。

您可以通过假装第一个标题没有高度来修复它:

\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} 

由于我没有您的徽标,所以无法知道它的垂直尺寸;请2ex在标记的位置进行调整。

在此处输入图片描述

相关内容