0

I am typing an article. I have used fancyhdr for the header and footer. Now my problem is that the header, which is set by default to the name of the section appears on the top right of all pages. I want to change it. I want it to appear on the top right for odd pages and on the top left for even pages. please help.

1

You must use the option twoside for the standard class article.

\documentclass[twoside]{article}

article and report classes come with oneside as option by default.

\documentclass[twoside]{article}
\usepackage{mwe} %For blindtext
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\slshape\leftmark}
\fancyfoot[C]{\thepage}
\begin{document}
\section{First section}
\blindtext
\newpage
\blindtext
\newpage
\section{Second section}
\blindtext
\newpage
\blindtext
\end{document} 

enter image description here

|improve this answer|||||

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.