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.
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}
Well, class article is onesided. If you want to be printed twosided you need to add class option twoside. Or perhaps you can then use class report with option twoside, depending on what should happen with the title(page) ...
Please see the following MWE with used package blindtext to generate some dummy text with command \blinddocument
\documentclass[%11pt, a4paper,
twoside % <===========================================================]{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{
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.
manpreet
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.