1

I'm trying to add a customized header as follows, but nothing changes in the file (I'm using overleaf):

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{CE_images/}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\lhead{EA}
\rfoot{Page \thepage}


\usepackage[margin=2.54cm]{geometry}

\title{Episode 1}
\date{}

\setlength{\parindent}{0em}
\setlength{\parskip}{1em}

\begin{document}
\maketitle
\section*{Introduction}
\end{document}
2
  • Welcome :) could you provide a full compilable code example showing what's going wrong? Mar 27 '19 at 8:20
  • 1
    edited my question :)
    – E. Aly
    Mar 27 '19 at 8:26
0

You don't see the changes because your title page is by default defined as "plain", i.e. no fancy headers or page numbers to make it look cleaner. If you go to the 2nd page you'll see your changes.

enter image description here

enter image description here

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{CE_images/}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\lhead{EA}
\rfoot{Page \thepage}


\usepackage[margin=2.54cm]{geometry}

\title{Career Episode 1}
\date{}

\setlength{\parindent}{0em}
\setlength{\parskip}{1em}

\begin{document}
\maketitle
\newpage
\section{Foo}
\newpage
\section{Bar}
\end{document}

You can also define the title page to not be plain by adding \thispagestyle{fancy} right after \maketitle:

enter image description here

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{CE_images/}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\lhead{EA}
\rfoot{Page \thepage}


\usepackage[margin=2.54cm]{geometry}

\title{Career Episode 1}
\date{}

\setlength{\parindent}{0em}
\setlength{\parskip}{1em}

\begin{document}
\maketitle
\thispagestyle{fancy}
\section{Foo}
\end{document}
1
  • @E.Aly I'm glad! Please remember to mark an answer as accepted with the green check mark if it works for you :) Mar 27 '19 at 8:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.