如何在类型为\documentclass[conference]{IEEEtran}
和/或的两列科学文章的第一页添加页脚和页眉\documentclass{article}
?
答案1
使用fancyhdr
创建firstpage
页面样式并应用它后 \maketitle
使用\thispagestyle{firstpage}
:
\documentclass[conference]{IEEEtran}
\usepackage{fancyhdr,lipsum}
\fancypagestyle{firstpage}{% Page style for first page
\fancyhf{}% Clear header/footer
\renewcommand{\headrulewidth}{0.4pt}% Header rule
\renewcommand{\footrulewidth}{0.4pt}% Footer rule
\fancyhead[C]{My Title --- An Author}% Header
\fancyfoot[C]{-~\thepage~-}% Footer
}
\pagestyle{plain}% Default page style
\title{My Title}
\author{An Author}
\begin{document}
\maketitle
\thispagestyle{firstpage}% firstpage page style for first page
\lipsum[1-17]
\end{document}
答案2
用洲际弹道导弹击中一只小鸟怎么样? ;)。以下是使用以下内容的答案tikzpagenodes
:
%\documentclass{article}
\documentclass[conference]{IEEEtran}
\usepackage{tikzpagenodes}
\usepackage{lipsum}
\title{Some title}
\author{Not me}
\begin{document}
\maketitle
\begin{tikzpicture}[remember picture,overlay]
\node[align=center,text=red] at ([yshift=1em]current page text area.north) {This is some
header text};
\node[align=center,text=blue] at ([yshift=-1em]current page text area.south) {This is some
footer text};
\end{tikzpicture}%
\lipsum[1-14]
\end{document}