# How to align fancy footer and header with text?

I use fancyhdr for customized headers/footers. I have the following code :

\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}
\renewcommand{\chaptermark}[1]{\markboth{\chaptername\ \thechapter.\ #1}{}}
\fancyfoot{}


\fancyheadoffset[L]{\dimexpr\marginparsep+\marginparwidth}


Each the headers/footers dont align with my text.I have a twosided scrreprt. What i want to achieve is that on odd page numbers the header should align left and even page numbers on the right.And the same for the footer.Like this :

When

 \fancyheadoffset[L]{\dimexpr\marginparsep+\marginparwidth}


is added, the footers seems to be ok (WHY ?) and on even page numbers also, but on odd page numbers it is not aligned. Like this :

• Are you loading geometry perhaps? If so, you need to load geometry before fancyhdr. However, you're using KOMA-script, which has its own header-setting options... – Werner Dec 29 '15 at 22:04
• Welcome to TeX.SX! Since you're using scrreprt: KOMA classes and fancyhdr may work together, but often they are conflicting! – user31729 Dec 29 '15 at 22:05
• @Werner yes i load geometry before fancyhdr – greedsin Dec 29 '15 at 22:06
• @ChristianHupfer Ok good to know,i will try another class – greedsin Dec 29 '15 at 22:07
• @lolio: Alright. If that does not work as desired come back please and provide a compilable document that shows the issues. – user31729 Dec 29 '15 at 22:31

 \fancyheadoffset[L]{0pt}