I am writing my master thesis. I am facing the following errors:
LaTeX Error: Command \chead already defined. Or name \end... illegal, see p.192 of the manual. /usr/local/texlive/2018/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty, line 101
LaTeX Error: Command \cfoot already defined. Or name \end... illegal, see p.192 of the manual. /usr/local/texlive/2018/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty, line 107
and my code is as follow:
\documentclass[a4paper,twoside]{article}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
% package for including graphics with figure-environment
\usepackage{graphicx}
% package for bibliography
\usepackage{cite}
% package for header
\usepackage{subcaption}
\usepackage[automark]{scrlayer-scrpage}
\usepackage{float}
\usepackage{fancyhdr}
\usepackage{listings}
\usepackage{comment}
\usepackage{afterpage}
\KOMAoptions{headsepline=.4pt:head}
\renewcommand{\headrulewidth}{0.4pt}
\pagestyle{fancy}
\begin{document}
\begin{figure}[!tbp]
\centering
\begin{minipage}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{a.png}
\end{minipage}
\hfill
\begin{minipage}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{Logo.jpg}
\end{minipage}
\end{figure}
\title {
\large{\bfseries Masgy \\ (ggg SS16)}\\
\vspace{2cm}
\Huge \textbf{ker (PT) \\}
}
\vspace{2cm}
% if you are the only author, you might use the following
\author{\textbf {Submitted by: ad}}
\vspace{1cm}
% name of the course and module
\date{
\textbf {Master Thesis} \\
\vspace{2cm}
\large \textbf {Referees:} \\
\large Prof. D\\
\large Prof. D.\\
\vspace{1cm}
\large \textbf {Developed at:} \\
\large B\
\vspace{1cm}
\large \textbf {Supervisors:} \\
\large Dipl.-Ing. r\\
\large Dipl.-Ing. aa\\
\vspace{1cm}
\today
}
\maketitle
\setlength{\parindent}{0pt}
\vspace{2cm}
\newpage
\thispagestyle{plain}
\cleardoublepage
\begin{center}
\section*{STATUTORY DECLARATION}
\end{center}
I, hereby declare that I have authored this thesis independently, that I have
not used other than the declared sources, and that I have explicitly marked all materials which has
been quoted either literally or by content from the used sources. I furthermore declare that this
thesis has not been submitted to any other board of examiners yet.
\\
\\
\\
\\
v, January 5, 2020
\thispagestyle{plain}
\newpage
\thispagestyle{plain}
\cleardoublepage
\pagenumbering{roman}
\thispagestyle{fancy}
\cfoot{ }
\renewcommand{\headrulewidth}{0pt}
\begin{center}
\section*{Abstract}
\end{center}
hi, how are you
\addcontentsline{toc}{section}{Abstract}
\newpage
\thispagestyle{plain}
\cleardoublepage
\thispagestyle{fancy}
\cfoot{ }
\renewcommand{\headrulewidth}{0pt}
\begin{center}
\section*{Acknowledgments}
\end{center}
\addcontentsline{toc}{section}{Acknowledgement}
\newpage
\thispagestyle{plain}
\cleardoublepage
\thispagestyle{fancy}
\cfoot{ }
\renewcommand{\headrulewidth}{0pt}
\begin{center}
\section*{Abbreviations}
\end{center}
\addcontentsline{toc}{section}{Abbreviations}
\newpage
\thispagestyle{empty}
\tableofcontents
\newpage
\thispagestyle{empty}
\listoffigures
\newpage
\thispagestyle{empty}
\listoftables
\newpage
\pagenumbering{arabic}
\setcounter{page}{1}
\renewcommand{\headrulewidth}{1pt}
\section{Introduction} % (fold)
\label{sec:introduction}
interactive proofs and secure computation, among others.\cite{waghmarehistory}
\section{Historical Background} % (fold)
\label{sec:history}
to spies in "secret writing".\cite{waghmarehistory}
\section{End to End Encryption} % (fold)
\label{sec:e2e_encryption}
from the cryptographic community.\cite{isobe2018breaking}
\subsection{Pretty Good Privacy (PGP)} % (fold)
\label{sub:subsection_pgp}
OpenPGP .\cite{pgpcreator}
\newpage
\bibliographystyle{IEEEtran}
\bibliography{references} % expects file "references.bib"
\end{document}
Any Help is highly appreciated.
scrlayer-scrpage
andfancyhdr
(which causes the error) and using macros from both packages. Choose one.