[Tex/LaTex] Set margin using geometry package

geometrypdftex

I am trying to alter the margins of a certain page in my document to have different margins from rest of document. So I'm using the geometry package. However, the margins of my document look weird even when I call \restoregeometry. In my latex class file I have a line like this:

\usepackage{vmargin} \setmarginsrb           { 1.5in}  % left margin
                        { 0.6in}  % top margin
                        { 1.0in}  % right margin
                        { 0.8in}  % bottom margin
                        {  20pt}  % head height
                        {0.25in}  % head sep
                        {   9pt}  % foot height
                        { 0.3in}  % foot sep

I try to replicate this using geometry but without any luck

\usepackage[ left=1.5in,
top=0.6in,
right=1.0in,
bottom=0.8in,
headsep=0.25in,
headheight=20pt,
heightrounded,
a4paper]
{geometry}

What am I missing?

UPDATE

I've created a minimum working example. If you comment out the geometry bits, it works, otherwise, it looks weird.

\documentclass{ecsthesis}      % Use the Thesis Style 
\usepackage[utf8]{inputenc}

%\usepackage[ left=1.5in, 
%top=0.6in, 
%right=1.0in, 
%bottom=0.8in, 
%headsep=0.25in, 
%headheight=20pt, 
%heightrounded, 
%a4paper] 
%{geometry}        
    \begin{document}        
    %\restoregeometry

    \frontmatter \title{Title page title page}

    \authors    {\texorpdfstring
                 {\href{mailto:}{Name}}
                 {Name}
                } \addresses  {\groupname\\\deptname\\\univname} \date       {\today} \subject    {} \keywords   {} \maketitle

    \end{document}

Best Answer

With geometry the settings in the preamble are for the whole document. \restoregeometry after \begin{document} has no effect, since it sets the layout back to the way it was set up in the preamble.

You need to use \newgeometry before the pages with changed margins and \restoregeometry after them.

In the following code, I did not use your class, but it nevertheless shows how to change and restore the layout mid document.

\documentclass[a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{lipsum}      

\begin{document}        
\frontmatter
\title{Title page title page}
\author{Some One}
\maketitle

\mainmatter
\chapter{Normal Pages}
\lipsum[1-20]

\newgeometry{left=1.5in, 
top=0.6in, 
right=1.0in, 
bottom=0.8in, 
headsep=0.25in, 
headheight=20pt, 
heightrounded}
\chapter{Special Pages}
\lipsum[1-20]

\restoregeometry
\chapter{Normal Pages again}
\lipsum[1-20]

\end{document}