I use fancyhdr for my headers and footers. This works well on all pages except for the Contents page. Here the header displays leftmark and rightmark, Contents is displayed twice. Any idea why this is the case?
\documentclass[12pt,twoside]{book}
% set margin
\usepackage[paper=a4paper,left=25mm,right=25mm,top=25mm,bottom=40mm,bindingoffset=6mm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{totcount}
\usepackage{lastpage}
\usepackage{float}
% headers and footers (https://www.youtube.com/watch?v=mZcV1wIPCBo)
\usepackage{fancyhdr}
% beautiful cross-references with hyperref
\usepackage{xcolor,colortbl}
\definecolor{Green}{RGB}{121,141,33}
\usepackage{hyperref} % http://ctan.org/pkg/hyperref
\hypersetup{
colorlinks,
linkcolor=Green,
citecolor=Green,
filecolor=Green,
urlcolor=Green,
}
% change font
\usepackage[default,osfigures,scale=0.95]{opensans}
\usepackage[T1]{fontenc}
% \usepackage[sfdefault,light,condensed]{roboto} %% Option 'sfdefault' only if the base font of the document is to be sans serif
% \usepackage[sfdefault]{AlegreyaSans}
% \renewcommand*\oldstylenums[1]{{\AlegreyaSansOsF #1}}
%disable indent globally
\setlength{\parindent}{0pt}
\begin{document}
\input{"0"}
\pagestyle{fancyplain}
\fancyhf{}
\fancyhead{}
\fancyfoot{}
\fancyhead[LO,RE]{\rightmark}
\tableofcontents
\fancyhead{}
\fancyfoot{}
\fancyhead[LE,RO]{\leftmark}
\fancyhead[LO,RE]{\rightmark}
\fancyfoot[LE,RO]{my footer\\~\\Page~\thepage~of~\getpagerefnumber{LastPage}}
\fancyfoot[LO,RE]{my footer}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\makeatletter
\let\ps@plain\ps@fancy
\makeatother
\input{"Chapters/1"}
\input{"Chapters/2"}
\input{"Chapters/3"}
\input{"Chapters/4"}
\input{"Chapters/5"}
\input{"Chapters/6"}
\end{document}
\cleardoublepage
after\tableofcontents