# can Latex recognise odd and even pages without 'twoside'

I am using the following document class:

\documentclass[a4paper,12pt]{ociamthesis}


I am also using the fancyhdr package to put headers and footers on my pages.

\pagestyle{fancy}
\fancyhf{}


At the moment, the header appears on the left-hand side of every page, whether or not it is odd or even. I want it to be on the outer edge of each page.

If I use 'twoside' in the document class line, then it works. But having 'twoside' screws up other things that I haven't been able to find a fix for, and so I'm trying to find another way around the problem.

Is it possible to not use 'twoside' but have the fancyhdr package still put headers in different places, depending if the page is odd or even?

• try \fancyhead[L]{\ifodd\value{page}\else\hfill\fi\leftmark} Aug 24 '15 at 14:40
• This works almost perfectly, thank you. Only issue it, if the header text is so long that it goes onto two lines. Now, the second line always aligns to the left. I need it to alternate left and right. Is that a quick fix? Aug 24 '15 at 18:02

Here is what you need

\documentclass{report}
\usepackage{lipsum}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}