I would like to create a package (.sty) for a titlepage. I followed this guide https://en.wikibooks.org/wiki/LaTeX/Title_Creation from which I took the following two codes: the first code is the package called columbidaeTitle.sty, the second code is the document where the package, earlier created, is loaded.
columbidaeTitle.sty
% Copyright note: This package defines how titles should
% be typeset at the columbidae University
% Please check for updates
\ProvidesPackage{columbidaeTitle}[2015/08/10 v.01 an
example package^^J for wikibooks]
\RequirePackage{graphicx}
\newcommand*{\project}[1]{\gdef\@project{#1}%
}
\newcommand*{\@project}{Final Year Project}
\newcommand*{\supervisor}[1]{\gdef\@supervisor{#1}%
}
\newcommand*{\@supervisor}{\texttt{\string\supervisor} currently
not set. Please fix this.}
\renewcommand*{\maketitle}{%
\begin{titlepage}
{\raggedleft%
\includegraphics[width=3cm]{example-image-16x9}\par
}\vspace{1cm}
\centering
{\scshape\LARGE Columbidae University \par}
\vspace{1cm}
{\scshape\Large\@project\unskip\strut\par}
\vspace{1.5cm}
{\huge\bfseries\@title\unskip\strut\par}
\vspace{2cm}
{\Large\itshape\@author\unskip\strut\par}
\vfill
supervised by\par
\@supervisor\unskip\strut\par
\vfill
{\large \@date\par}
\end{titlepage}
}
\endinput
Document:
\documentclass{book}
\usepackage{columbidaeTitle}
\supervisor{Dr. James Miller}
\project{Bachelor Thesis}
\author{A LaTeX enthusiast}
\title{Why i want to be a duck}
\begin{document}
\maketitle
\tableofcontents
\chapter{Ducks are awesome}
\end{document}
I have an issue. I would like the whole document to have this margin:
\usepackage[bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm]{geometry}
except for the titlepage, for which I would like to have
\newgeometry{left=3cm,right=3cm,bottom=2cm,top=3cm}
I tried to insert \RequirePackage{geometry} in the columbidaeTitle.sty file and then
\newgeometry{left=3cm,right=3cm,bottom=2cm,top=3cm}
\begin{titlepage}
...
\end{titlepage}
\restoregeometry
but it didn't work. How can I make?


\begin{titlepage}\newgeometry{left=3cm,right=3cm,bottom=2cm,top=3cm} ... \restoregeometry \end{titlepage}– touhami Jan 11 '16 at 17:39\RequirePackage{geometry}, then\begin{titlepage}\newgeometry{left=3cm,right=3cm,bottom=2cm,top=3cm} ... \restoregeometry \end{titlepage}and in document.texI inserted\usepackage[bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm]{geometry}but I get an error:! LaTeX Error: Option clash for package geometry.– Marco Jan 11 '16 at 18:04\geometry{bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm}– Johannes_B Jan 11 '16 at 18:07\usepackage[bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm]{geometry}in the.styfile and only\usepackage{geometry}in the.texfile. Now I do not get any error. Is it correct? I am going to think about what you said about the binding offset. – Marco Jan 11 '16 at 18:14.texfile\usepackage{geometry} \geometry{bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm}and in.styfile just\usepackage{geometry}? – Marco Jan 11 '16 at 18:21\@ifpackageloaded{geometry}{}{\RequirePackage[pass]{geometry}}. Ifgeometryhas already been loaded, OK, otherwise, load it so it doesn't harm the page parameters, but you'll have\newgeometryavailable. – egreg Jan 11 '16 at 18:40\RequirePackage{geometry}\geometry{bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm}in the.styfile and\usepackage{geometry}in the.texfile works. Putting\usepackage{geometry}in the.styfile and\usepackage{geometry} \geometry{bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm}in the.texfile also works. I did not understand how to make the egreg's solution works. – Marco Jan 11 '16 at 18:51\RequirePackage{geometry}\geometry{bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm}in the.styfile and\usepackage{geometry}in the.texfile works.\usepackage{geometry}in the.styfile and\usepackage{geometry} \geometry{bindingoffset=1.5cm, left=3cm, right=3cm, top=3cm, bottom=3cm}in the.texfile works. – Marco Jan 11 '16 at 20:00geometryto set the margins on the titlepage. Now egreg's line drops in: Test if the package is already loaded, if so, ddon't do anything. If not, load package geometry without changing the default margins (pass) because that would change the rest of the document.\newgeometrycan be used savely. – Johannes_B Jan 11 '16 at 20:11geometrywasn't already loaded at load time of the bird package ... It will be afterwards. If your normal preamble now tries to loadgeometrywith a specific set of options, you will get the option clash you mentioned earlier. You now have to use\geometry{bottom=2cm}. – Johannes_B Jan 11 '16 at 20:11