3

I am writing an article and as per the requirement of the journal article should be one side of paper. However, I am not able to adjust the different header on even and odd pages of the article. Minimum working example is given below.

\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}
  • In a oneside document, left hand pages are not existing. – Johannes_B Apr 21 '17 at 5:03
  • Then how we can put different header on even and odd page? – Ahmed Arif Apr 21 '17 at 5:06
  • Change the option oneside to twoside? – Mico Apr 21 '17 at 5:09
  • In that case header is indented. How I can finish this indenting? – Ahmed Arif Apr 21 '17 at 5:15
  • if you are submitting the article to a journal for publication, the journal editorial staff will reprocess it into the publication format. – barbara beeton Apr 21 '17 at 14:25
2

You can use conditionals in the header since the page counter would be definitive:

enter image description here

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

You can, of course, also use the twoside option, since this allows you to specify the use of Even and Odd header placement (which only exists under that option):

enter image description here

\documentclass[twoside]{article}

\usepackage{fancyhdr,lipsum}
\pagestyle{fancy}
\fancyhf{}% Clear header/footer
\fancyhead[LE]{\thepage{} Ahmed Arif}
\fancyhead[RO]{Finance Paper \thepage}

%...

True, the page layout will be different, but that can be restored using geometry, if needed.

  • Thank you Werner. The only problem that appears now is that it is headers are indented by one Tab space like a start of paragraph on the odd page. – Ahmed Arif Apr 21 '17 at 5:28
  • @AhmedArif: I don't see that in my example. What do your \fancyhead statements look like? – Werner Apr 21 '17 at 5:57
  • Werner.. I have edited my question. Now I have provide the full preamble. May be some command is in conflict. Please have a look at the edited question. The header at odd page is not fully right indented – Ahmed Arif Apr 21 '17 at 7:04
  • @AhmedArif: Aaahhh... you need to load fancyhdr (and it's accompanying settings) after geometry and setting the \geometry. – Werner Apr 21 '17 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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