# Set margin using geometry package

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
{   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,
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,
%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}
• it would be easier to answer if you provided test documents using the two forms and say how they differ – David Carlisle Jul 25 '17 at 20:58
• vmargin is outdated (and weird) – user31729 Jul 25 '17 at 21:02
• @DavidCarlisle Question updated. – picasso Jul 25 '17 at 21:18

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,