Categories

See More
Popular Forum

MBA (4887) B.Tech (1769) Engineering (1486) Class 12 (1030) Study Abroad (1004) Computer Science and Engineering (988) Business Management Studies (865) BBA (846) Diploma (746) CAT (651) B.Com (648) B.Sc (643) JEE Mains (618) Mechanical Engineering (574) Exam (525) India (462) Career (452) All Time Q&A (439) Mass Communication (427) BCA (417) Science (384) Computers & IT (Non-Engg) (383) Medicine & Health Sciences (381) Hotel Management (373) Civil Engineering (353) MCA (349) Tuteehub Top Questions (348) Distance (340) Colleges in India (334)
See More

Forcefully positioning header page numbers for even and odd pages

Course Queries Syllabus Queries

Max. 2000 characters
Replies

usr_profile.png

User

( 3 months ago )


I'm trying to write a syllabus and I want the page numbers to be on alternating sides of each page. I am using the package fancyhdr, and know the command to accomplish this, \fancyhead[LE,RO]{\thepage}. But, when I typeset it, the page numbers stay on the right side of the header in all pages. How do I fix this? Please and thank you.

\documentclass[11pt, a4paper]{article}
%\usepackage{geometry}
\usepackage[inner=1.5cm,outer=1.5cm,top=2.5cm,bottom=2.5cm]{geometry}
\pagestyle{empty}
\usepackage{graphicx}
\usepackage[usenames,dvipsnames]{color}
\definecolor{darkblue}{rgb}{0,0,.6}
\definecolor{darkred}{rgb}{.7,0,0}
\definecolor{darkgreen}{rgb}{0,.6,0}
\definecolor{red}{rgb}{.98,0,0}
\usepackage[colorlinks,pagebackref,pdfusetitle,urlcolor=darkblue,citecolor=darkblue,linkcolor=darkred,bookmarksnumbered,plainpages=false]{hyperref}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[RE]{ACC 202: Intro to Managerial Accounting}
%\lhead{ \fancyplain{}{Spring 2019 Syllabus} }
%\chead{ \fancyplain{}{} }
%\rhead{ \fancyplain{}{\emph{ACC 202: Intro to Managerial Accounting}} }
%\rfoot{\fancyplain{}{page \thepage\ of \pageref{LastPage}}}
%\fancyfoot[RO, LE] {page \thepage\ of \pageref{LastPage} }
\thispagestyle{plain}

%%%%%%%%%%%% LISTING %%%
\usepackage{listings}
\usepackage{caption}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}
\captionsetup[lstlisting]{format=listing,labelfont=white,textfont=white}
\usepackage{verbatim} % used to display code
\usepackage{fancyvrb}
\usepackage{acronym}
\usepackage{amsmath}
\usepackage{amsthm}
%\VerbatimFootnotes % Required, otherwise verbatim does not work in footnotes!
\newcommand{\SubItem}[1]{
    {\setlength\itemindent{15pt} \item[-] #1}
}
\usepackage{setspace}
\usepackage{enumitem}
\usepackage{array}


\definecolor{OliveGreen}{cmyk}{0.64,0,0.95,0.40}

what's your interest