# Different header and footer for first page and for rest document

I need to define a specific header and footer for the first page and modified header and footer for rest pages. I am familiar with fancyhdr package but from my understanding, I can only define not complicated headers and footers the same for all document by commands:

\fancyhead[LO,RE]{}
\cfoot{}
\fancyfoot[LO,RE]{}
\fancyfoot[RO,LE]{}


I need to provide a template for the first page as follow: And for the rest pages without Logo and Table.

The problems that I have:

1. How to define different header and footer for the first page and for the rest document.
2. How to create complex footer (table, number below, and page below the number) because when I am using commands \fancyfoot and \cfoot I got everything in the same line

EDIT: Here is simple code:

\documentclass[a4paper]{article}

\usepackage{graphicx}

\pagestyle{fancyplain}{

\renewcommand{\footrulewidth}{1.2pt}
\fancyfoot[LO,RE]{\small Title}
\cfoot{\vspace{0pt} \small\bf Page \thepage\ of \pageref{END}}
\fancyfoot[RO,LE]{Version number}
}

\fancypagestyle{mypagestyle}{

\renewcommand{\footrulewidth}{1pt}
\fancyfoot[L]{\small number}
\fancyfoot[C]{\vspace{0pt} \small\bf Page \thepage\ of \pageref{END}}
\fancyfoot[R]{TEXT}
}

\begin{document}
\thispagestyle{mypagestyle}
\setcounter{page}{1}
Title page
\newpage
\pagestyle{fancyplain}
\section{The First Section}
Text text text text text text text text text text text text text text text         text text text text text text text text text text.
\newpage
\section{The Next Section}
Text text text text text text text text text text text text text text text text text text text text text text text text text.

\label{END}
\end{document}


Problems:

1. Text on the first page doesn't start after the header.
2. The header and footer for the second and first page are moved more than margins defined in geometry page (the footer is cut).

Based on geometry package the footer and header should "start" after margins:

• For question 1, define a new pagestyle with the command \fancypagesstyle{mypagestyle}{...} and use at the relevant place \thispagestyle{mypagestyle}. For question 2, please provide a small complete document with what you've tried. – Bernard Apr 12 '20 at 11:25
• Hello there! This is Tom from the Overleaf Support Team. Please note that I removed the overleaf tag as this is not directly overleaf-related. – yo' Apr 12 '20 at 13:33
• @Bernard, please look at the edited version. – begginer Apr 12 '20 at 13:42
• @begginer, add the showframe option to geometry so you can have better idea what is going on margins. – Sigur Apr 12 '20 at 14:20
• It should be noted that fancyhdr likes to keep the same size header for the entire document. Also, \fancypagestyle just changes the fancyhdr options and calls \pagestyle{fancy} again. – John Kormylo Apr 12 '20 at 20:41

first change --- icon in header tool large reduce size to 0.1 scale

second change -- vspace in the foote not required since its 0pt and gives white space on top

Now have alook at first page

\documentclass[a4paper]{article}
\usepackage{geometry}

\usepackage{graphicx}

\pagestyle{fancyplain}{

%
%\renewcommand{\footrulewidth}{1.2pt}
%\fancyfoot[LO,RE]{\small Title}
%\cfoot{\vspace{0pt} \small\bf Page \thepage\ of \pageref{END}}
%\fancyfoot[RO,LE]{Version number}
%}

\fancypagestyle{mypagestyle}{

\renewcommand{\footrulewidth}{1pt}
\fancyfoot[L]{\small number}
\fancyfoot[C]{ \small\bf Page \thepage\ of \pageref{END}}
\fancyfoot[R]{TEXT}
}

\begin{document}
\thispagestyle{mypagestyle}
\setcounter{page}{1}
Title page
\newpage
\pagestyle{fancyplain}
\section{The First Section}
Text text text text text text text text text text text text text text text         text text text text text text text text text text.
\newpage
\section{The Next Section}
Text text text text text text text text text text text text text text text text text text text text text text text text text.

\label{END}
\end{document}


For the second page

Redefine pagestyle as mypagestylea rather than interfere with pagestyle fancy which is the default

now have alook at second page

\documentclass[a4paper]{article}
\usepackage{geometry}

\usepackage{graphicx}

%\pagestyle{fancyplain}{

%
%\renewcommand{\footrulewidth}{1.2pt}
%\fancyfoot[LO,RE]{\small Title}
%\cfoot{\vspace{0pt} \small\bf Page \thepage\ of \pageref{END}}
%\fancyfoot[RO,LE]{Version number}
%}

\fancypagestyle{mypagestyle}{

%defn of footer
\renewcommand{\footrulewidth}{1pt}
\fancyfoot[L]{\small number}
\fancyfoot[C]{ \small\bf Page \thepage\ of \pageref{END}}
\fancyfoot[R]{TEXT}
}

\fancypagestyle{mypagestylea}{
%
\renewcommand{\footrulewidth}{1.2pt}
\fancyfoot[LO,RE]{\small Title}
\cfoot{\small\bf Page \thepage\ of \pageref{END}}
\fancyfoot[RO,LE]{Version number}
}

\begin{document}
\thispagestyle{mypagestyle}
\setcounter{page}{1}
Title page
\newpage
\pagestyle{mypagestylea}
\section{The First Section}
Text text text text text text text text text text text text text text text         text text text text text text text text text text.
\newpage
\section{The Next Section}
Text text text text text text text text text text text text text text text text text text text text text text text text text.

\label{END}
\end{document}