[Tex/LaTex] Different margins within one document

margins

having the following code, how is it possible to insert another page, which would have different margin paramaters as opposed to those seen in the code? Basically, the first page is cover page with different margins (top=20, bottom=20, right=20, left=20) and this is the one I would like to integrate into this code. Thanks!

\documentclass[12pt,oneside,a4paper]{article}

\usepackage[
 left=40mm,
 top=30mm,
 right=20mm,
 bottom=20mm,
 headsep=12.5mm,
 headheight=14.5pt, %%% 3mm is too small
 heightrounded
]{geometry}

\usepackage{fancyhdr,xpatch}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.0pt}
\fancyhf{}
\fancyhead[R]{Title of topic --- \thepage}

\makeatletter
\let\ORI@section\section
\renewcommand{\section}{\@ifstar\s@section\ORI@section}
\newcommand{\s@section}[1]{%
  \ORI@section*{#1}
  \csname phantomsection\endcsname % for hyperref
  \addcontentsline{toc}{section}{#1}
}
\xpatchcmd{\tableofcontents}{\section}{\ORI@section}{}{} % toc not in toc
\makeatother

\begin{document}
\pagenumbering{roman}

\tableofcontents
\clearpage

\listoffigures
\clearpage

\listoftables 
\clearpage

\section*{Section A}

\clearpage
\pagenumbering{arabic}

\section{Section B}

\end{document}

Best Answer

Using the \newgeometry macro is the way to go here. Changing the page is as simple as adding to you MWE

\newgeometry{top=20mm, bottom=20mm, right=20mm, left=20mm}
A Title Page
\restoregeometry%
\clearpage

This gives a new complete MWE of

\documentclass[12pt,oneside,a4paper]{article}

\usepackage[
 left=40mm,
 top=30mm,
 right=20mm,
 bottom=20mm,
 headsep=12.5mm,
 headheight=14.5pt, %%% 3mm is too small
 heightrounded
]{geometry}

\usepackage{fancyhdr,xpatch}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.0pt}
\fancyhf{}
\fancyhead[R]{Title of topic --- \thepage}

\makeatletter
\let\ORI@section\section
\renewcommand{\section}{\@ifstar\s@section\ORI@section}
\newcommand{\s@section}[1]{%
  \ORI@section*{#1}
  \csname phantomsection\endcsname % for hyperref
  \addcontentsline{toc}{section}{#1}
}
\xpatchcmd{\tableofcontents}{\section}{\ORI@section}{}{} % toc not in toc
\makeatother

\begin{document}
\newgeometry{top=20mm, bottom=20mm, right=20mm, left=20mm}
A Title Page
\restoregeometry%
\clearpage

\pagenumbering{roman}

\tableofcontents
\clearpage

\listoffigures
\clearpage

\listoftables 
\clearpage

\section*{Section A}

\clearpage
\pagenumbering{arabic}

\section{Section B}

\end{document}
Related Question