# Page number intersects text when using fancyhdr

As i mentioned in title, i can't manage fancyhdr to work. I can't remove page numbers. And page numbering is not stable. And this is the result. As you can see one iii is at the bottom but iv is at the heading and intersecting with text.

This is mwe(i think) Because of the document is too long i did not dump the all code. But i can if it is needed.

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[turkish]{babel}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{pslatex}
\usepackage{setspace}
\setlength{\parindent}{0pt}
\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}
\setlength{\parskip}{\baselineskip}

\addto\extrasturkish{\uccodei=\string"9D \lccodeI=\string"19 }
\addto\noextrasturkish{\uccodei=I \lccodeI=i }

\setlength{\footskip}{20pt}
\setlength{\marginparwidth}{0 pt}

\raggedbottom
\usepackage{chngcntr}
\setcounter{secnumdepth}{6}

\counterwithin{paragraph}{subsubsection}
\counterwithin{subparagraph}{paragraph}
\makeatother

%\usepackage{graphicx,epstopdf}
%\epstopdfsetup{update}
%\DeclareGraphicsExtensions{.ps}

\usepackage{url}

\usepackage{tocloft}

\usepackage{titlesec}

\titlespacing{\section}
{0pt}
{-12 pt plus 4pt minus 2pt}
{-10 pt plus 2pt minus 2pt}

\titlespacing{\subsection}
{0pt}
{-12pt plus 4pt minus 2pt}
{-10pt plus 2pt minus 2pt}

\titlespacing{\subsubsection}
{0pt}
{-12pt plus 4pt minus 2pt}
{-10pt plus 2pt minus 2pt}

\titlespacing\paragraph
{0pt}
{-12pt plus 4pt minus 2pt}
{-10pt plus 2pt minus 2pt}

\titleformat{\section}
{\normalfont\normalsize\bfseries\MakeTextUppercase}
{\thesection.}
{1em}
{}

\titleformat{\subsection}
{\normalfont\normalsize\bfseries}
{\thesubsection.}
{1em}
{}

\titleformat{\subsubsection}
{\normalfont\normalsize\bfseries\itshape}
{\thesubsubsection.}
{1em }
{}

\titleformat{\paragraph}
{\itshape\normalsize}
{\theparagraph.}
{1em}
{}

\usepackage{fancyhdr}
\fancyhf{}
\renewcommand{\footrulewidth}{0pt}
\pagestyle{fancy}

\usepackage{enumitem}
\setlist{nolistsep}
%\raggedbottom
\setitemize{topsep=-12pt}
\setenumerate{topsep=-12pt}
\setenumerate[2]{label=\alph*.}
\let\stdsection\section
\renewcommand{\section}{\newpage\stdsection}

\begin{document}

\shorthandoff{=}

(...)

(...)

\begin{spacing}{1.0}
\setlength{\parskip}{0.245\baselineskip}

\tableofcontents
\setlength{\parskip}{\baselineskip}
\end{spacing}

(...)

(...)

\end{document}

-
Your problem may lie with the combination of nohead,nofoot via geometry in conjunction with requiring a header/footer via fancyhdr. –  Werner Jun 18 '12 at 10:32
wow thanks. But one page number is at the top one is the bottom this time –  interlude Jun 18 '12 at 10:34
This is because of the page styles set by your document class (and possibly packages loaded in the preamble). –  Werner Jun 18 '12 at 10:56

do not use any margin setting after loading fancyhdr. Delete your

\setlength{\headheight}{ 0 cm}


and use geometry for any setting. To get the same behaviour on the first page for chapters redefine the pagestyle:

\fancypagestyle{plain}{%

sure, that is the default. If you do not want that, then redefine \fancypagestyle{plain}{ ...settings ...}. See documentation on page 7/8. –  Herbert Jun 18 '12 at 10:50