![不同页眉一个单面文档类文章](https://linux22.com/image/353432/%E4%B8%8D%E5%90%8C%E9%A1%B5%E7%9C%89%E4%B8%80%E4%B8%AA%E5%8D%95%E9%9D%A2%E6%96%87%E6%A1%A3%E7%B1%BB%E6%96%87%E7%AB%A0.png)
我正在写一篇文章,根据期刊文章的要求,它应该是纸张的一面。但是,我无法调整文章偶数页和奇数页上的不同页眉。下面给出了最小工作示例。
\documentclass[12pt,a4paper,oneside]{article}
\usepackage{authblk}
\usepackage{secdot}
\usepackage{titlesec}
\renewcommand{\thesection}{\Roman{section}}
\usepackage[T1]{fontenc}
\usepackage{newtxtext}
\usepackage[latin9]{inputenc}
\usepackage[english]{babel}
\usepackage{amsthm}
\usepackage{amsmath}
\usepackage{mathptmx}
\usepackage{mathrsfs}
\usepackage{calrsfs}
\usepackage{float}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}% Clear header/footer
\fancyhead[L]{\ifodd\value{page}\else\thepage{} Ahmed Arif\fi}
\fancyhead[R]{\ifodd\value{page}Finance Paper \thepage\fi}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\usepackage{url}
\usepackage[final]{graphicx}
\usepackage[natbibapa,indexpackage]{apacite}
\bibliographystyle{apacitex}
%page margins
\usepackage{geometry}
\geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=3cm,rmargin=3cm }
\setlength\parindent{24pt}
\usepackage{textcomp}
\usepackage{textgreek}
\usepackage[toc,page]{appendix}
\usepackage{libertineRoman}
%line spacing
\usepackage{setspace}
\doublespacing
\usepackage{caption}% <-- added
\captionsetup[table]{skip = 3pt}
\usepackage{tabulary}
\usepackage[para]{threeparttable}
\usepackage{array,booktabs,longtable}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{ltablex}% <-- added
\usepackage{siunitx}% <-- added
\usepackage{caption}% <-- added
\setlength{\LTcapwidth}{7in}
\usepackage[flushleft]{threeparttablex}
\usepackage{pdflscape}
\usepackage{hyperref}
\usepackage{acro}
\urlstyle{same}
\usepackage{amssymb}
\newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}}
\def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}}
\usepackage{abstract}
\AtBeginDocument{\renewcommand{\abstractname}{}}
\usepackage[hang]{footmisc}
\setlength{\footnotemargin}{.4em}
\renewcommand{\footnotelayout}{\doublespacing}
\renewcommand*\footnoterule{}
\usepackage{lipsum}
\title{My Finance Paper}
\author{\sc{Ahmed Arif}}
\begin{document}
\maketitle
\lipsum
\lipsum
\lipsum
\end{document}
答案1
page
由于计数器是确定的,因此您可以在标题中使用条件:
\documentclass[oneside]{article}
\usepackage{fancyhdr,lipsum}
\pagestyle{fancy}
\fancyhf{}% Clear header/footer
\fancyhead[L]{\ifodd\value{page}\else\thepage{} Ahmed Arif\fi}
\fancyhead[R]{\ifodd\value{page}Finance Paper \thepage\fi}
\title{My Finance Paper}
\author{Ahmed Arif}
\begin{document}
\maketitle
\sloppy\lipsum[1-50]
\end{document}
当然,您也可以使用该选项,因为这允许您指定ven 和dd 标头位置twoside
的使用(仅存在于该选项下):E
O
\documentclass[twoside]{article}
\usepackage{fancyhdr,lipsum}
\pagestyle{fancy}
\fancyhf{}% Clear header/footer
\fancyhead[LE]{\thepage{} Ahmed Arif}
\fancyhead[RO]{Finance Paper \thepage}
%...
确实,页面布局会有所不同,但可以使用geometry
, 如果需要的话。