I wanted to have all document with geometry parameters as follow:
\usepackage[top=1.5cm, bottom=2cm, left=2.5cm, right=1.25cm, includehead,includefoot, footskip=5mm,headsep=5mm]{geometry}
But the first page with the smaller left margin (1.25cm) so I defined new geometry for the first page. Everything works but the header and footer are moved to the right even when the right margin is set (but the text of section is ok).
but the first page (with new geometry is ok):
The code:
\documentclass[a4paper,11pt]{article}
\usepackage[top=1.5cm, bottom=2cm, left=2.5cm, right=1.25cm, includehead,includefoot, footskip=5mm,headsep=5mm]{geometry}
%\usepackage[showframe]{geometry}
\usepackage{graphicx}
\usepackage{fancyhdr} % fancy headers/footers
\usepackage[T1]{fontenc}
\usepackage{newtxtext,newtxmath}
% Use fancyheadings stuff
\fancypagestyle{mytitlestyle}{
%Set up new layouts values for title page
\renewcommand{\headheight}{30mm}
% Definition of the header
\renewcommand{\headrulewidth}{0.6pt}
\fancyhead[L]{\bf Number}
\fancyhead[R]{\includegraphics[width=57mm]{Logo}}
%defn of footer
\renewcommand{\footrulewidth}{0pt}
\fancyfoot[L]{\textbf{Title}}
\cfoot{\vspace*{5mm} \bf Page \thepage\ of \pageref{END}}
\fancyfoot[R]{\textbf{Version number}}
}
\fancypagestyle{mypagestyle}{
% Definition of the header
\renewcommand{\headrulewidth}{0.6pt}
\fancyhead[LO,RE]{\bf Number}
\fancyhead[RO,LE]{\bf Commercial in Confidence}
%
\renewcommand{\footrulewidth}{0.6pt}
\fancyfoot[LO,RE]{\textbf{Title}}
\cfoot{\vspace*{5mm} \bf Page \thepage\ of \pageref{END}}
\fancyfoot[RO,LE]{\textbf{Version number}}
}
\begin{document}
\thispagestyle{mytitlestyle}
\newgeometry{top=1.5cm, bottom=5cm, left=1.25cm, right=1.25cm, includehead,includefoot, footskip=5mm,headsep=5mm}
\setcounter{page}{1}
\begin{center}
\vspace*{20mm}
{\Large \textbf{TITLE}}\\
\vspace*{30mm}
{\large \textbf{ABSTRACT}}
\end{center}
\newpage
\pagestyle{mypagestyle}
\restoregeometry
\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.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.Text text text text text text text text text text text text text
\label{END}
\end{document}
\tikz[overlay]
.