Forcefully positioning header page numbers for even and odd pages

Course Queries Syllabus Queries 3 years ago

5.63K 1 0 0 0

User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 3 years 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}

                                                
0 views
0 shares

No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Similar Forum